Calculated field with Multi Value Parameter

Hi! I have a multivalue parameter f.ex. called ${fruit} that can be e.g. ‘BANANA’, ‘APPLE’. I have a field fruit_pairs that consist of two fruits separated by a dash e.g. ‘BANANA-KIWI’, ‘PEAR-APPLE’, ‘PEAR-KIWI’. I want to check if my field has any of my ${fruit} parameter values - I know I can use the IN() function - but the problem is I want to differentiate if I have my parameter at the beginning or at the end of the fruit_pairs - so e.g. when:

  • no fruit from parameter ${fruit} is in the pair → -1
  • one of the fruit is at the beginning like in ‘BANANA-KIWI’ then → 0
  • one of the fruit is at the end then like in ‘PEAR-APPLE’ → 1

Sometimes the fruit can be NULL but it never happens that both fruit are in the pair e.g. ‘BANANA-APPLE’ or ‘APPLE-BANANA’.

Hi @JRoz

You could probably do as follows:

  1. Use Split function to split your field value from fruit_pairs column using - as delimter
  2. Evalualte the split values independently vs the paramter value
  3. Combine the results of the independent checks to determine the final value you want per your document

Regards,
Giri

Hi @JRoz,
It’s been awhile since we last heard from you on this thread, did you have any additional questions regarding your initial post?

If we do not hear back within the next 3 business days, I’ll close out this topic.

Thank you!