Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Community,
with an expression i simply want to check if a value exists inside a listbox.
How can this be done?
Example:
Data:
Load *,DepthSN As DepthSN_New Inline [
Producer, DepthSN
p1,aaa
p2,bbb
p3,ccc ];
How to check that the value 'aaa' exists inside 'Data'?
Count({<DepthSN ={"aaaa"}>} DepthSN ) > 0
You can use a expression like this in a list box:
=If(SubStringCount(Concat(DISTINCT DepthSN,'|'), 'aaa') = 1, 'aaa exists', 'aaa does not exist')
This will change results based on your selection. So for instance if you don't select 'aaa' in your list box it will say aaa does not exist. If you don't want that you can change the expression to this:
=If(SubStringCount(Concat({1}DISTINCT DepthSN,'|'), 'aaa') = 1, 'aaa exists', 'aaa does not exist')
HTH
Best,
Sunny
Count({<DepthSN ={"aaaa"}>} DepthSN ) > 0
Thanks for your answer,
unfortunately concat is not good, if you have million of rows