Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Hi,

recently I came across a requirement that was to test if a value was in list where the list was in a variable. The variable, [list] = "123;234;456;1114678;768;999111", I I need to test if the value of a certain dimension , [numero], was in the list [list]. As you know, the InlList operator can be used only with a literal list (that´s it a text, like "123;234;456;1114678;768;999111", not in a variable. Then testing for [numero] InList([test]) will throw an error.

To overcome this situation, one can test for the Pos of [test] in [list], if the result is >0, [numero] is present in [list]. The downside is when [numero] is contained in another value for instance , "111" is not part of the list, but is contained in "1114678". To parcialy overcome this issue, you can test for ";"+[numero] and [numero]+";". So my formula will be :

If( (Pos([list];";"+[numero)>0)or (Pos([list];[numero]+";")>0);"InList";"NotInList")

Regards,

Rogerio

4 Comments
Labels in this area