How can I get some values from a Multi Value field

I have a field with the following in it:FRUIT;apples;pears;bananas;VEG;potato;beans; sweet potato

(Note: yes, FRUIT will always be first set, and BEG will always be 2nd set, WHEN there are 2 sets. - sometimes there are not 2 sets so we need to look for VEG, but not take the ‘heading’ of VEG)

I want to get only the potato;beans from it…

if I use @Word, it only works on strings, so I have to Implode it and then i have no way to Explode it back to separate elements.

Suggestions of other ways to get these values?

Subject: How can I get some values from a Multi Value field

Have you tried something like this?

impTmp := @Implode(YourField;“~”);

tmp := @Explode(@Right(impTmp;“VEG”);“~”);

First implode the field with a delimiter then take everything to the right of VEG and explode it based on your delimiter. Note this is assuming that you wanted all the VEG items.

if you want the separate values you can use the following:

tmp[1] - Will equal potato

tmp[2] - Will equal beans

tmp[3] - Will equal sweet potato (with an e for some politicians) :0)

Subject: RE: How can I get some values from a Multi Value field

…(with an e for some politicians) :0)

Hey now…don’t you be dissin’ da man what invented the inner tubes! (with a tip-o-the-hat to an un-named Alaskan senator)!

Sorry, off topic but couldn’t pass that one up!

Doug

Subject: How can I get some values from a Multi Value field

If I understand your question- and what you have written, the example given has 8 values in it- but your question seems to indicate you think there are two- so, do you mean FRUIT: apples:Pears:bananas;VEG:potato:beans:sweet potato

This would be two lists in multivalue field w/ two values -

You could then @count(FieldName) > 1 …do something to get the second value