The orginal poster has clarified his requirement in this regard, but if the
situation was that the ending semicolon varied, then this could be handled
by string functions as well:
     REPLACE(($Dept$ + ";"),";;",";")
Basically, always add a semicolon, then replace doubles with singles.  That
would also clean up any doubles that were in the middle.

Granted, there are lots of vairations to this, but it sounds like the format
of the field is well controlled anyway.

Thad
On Fri, Jun 3, 2011 at 11:07 AM, Joe Martin D'Souza <jdso...@shyle.net>wrote:

> **
>
> This would however fail if the last value of the string is inconsistent..
> meaning if some strings have a semi colon in the last value and some do
> not..
>
> You would need to append logic to see what the last value of that string is
> and then continue with using what you described.. which by the way is
> cleaner and should be faster on significantly long strings, than running a
> loop as I earlier suggested.. I like the approach..
>
> Again also if there are some strings that happen to have something like
> value1;;value2;value3...
>
> with 2 or more semicolons separating two values then you would need to do a
> replace to replace 2 or more consecutive semi colons with a single one..
>
> Cheers
>
> Joe
>
>  *From:* Thad Esser <thad.es...@gmail.com>
> *Sent:* Friday, June 03, 2011 2:01 PM
>  *Newsgroups:* public.remedy.arsystem.general
>  *To:* arslist@ARSLIST.ORG
> *Subject:* Re: Workflow
>
> **
>  If you were to replace the semicolon's with Null values, then the
> difference in length between the two strings would give you a count.
>
> zLen = LENGTH($Dept$)
> zTmp = REPLACE($Dept$,";","")
> zInt = LENGTH(zTmp)
>
> valueCount = (zLen - zInt) + 1  (assumes pre-check for non-null)
>
> Of course, you could combine all that into one action.  Depending on your
> rules for semi-colon placement you may need to change the "+1" part.
>
> Thad
>
> On Fri, Jun 3, 2011 at 10:42 AM, <oracle...@aol.com> wrote:
>
>> **
>>  Hi,
>>
>> I want to count the multiple values within 1 field that are separated by a
>> semicolon ;
>>
>>  For example:
>> The Dept field contains -----  IT Services; Accounting; Facilities
>>  I want to set another field with the value of 3.
>>
>> I am not sure what command I can use to count the semicolons.
>> _attend WWRUG11 www.wwrug.com ARSlist: "Where the Answers Are"_
>
>
> _attend WWRUG11 www.wwrug.com ARSlist: "Where the Answers Are"_
>  _attend WWRUG11 www.wwrug.com ARSlist: "Where the Answers Are"_
>

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug11 www.wwrug.com ARSList: "Where the Answers Are"

Reply via email to