Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to be able to easily add and subtract fields from possible values in a calculation condition. If there is any other combination I don't want it to be true. In the example below I get it to work with two values; Value1 and Value2.
if(concat(distinct [Field1], ', ') = 'Value1' or
concat(distinct[Field1], ', ') ='Value2' or
concat(distinct[Field1], ', ') ='Value1, Value2',1,0)
I want to be able to do it easily for more than 2 values. For each value added the code would get longer, the next example is with a third added value;
if(concat(distinct [Field1], ', ') = 'Value1' or
concat(distinct[Field1], ', ') ='Value2' or
concat(distinct[Field1], ', ') ='Value3' or
concat(distinct[Field1], ', ') ='Value1, Value2' or
concat(distinct[Field1], ', ') ='Value1, Value3' or
concat(distinct[Field1], ', ') ='Value2, Value3' or
concat(distinct[Field1], ', ') ='Value1, Value2, Value3',1,0)
So the code will get exponentially longer and longer, even though I just want another field value added. Has anyone done anything similar without the hassle of longer and longer code?
This would have the same built in mistake where if something has Value5 as well as Value1 it would get a Flag
How? Value1 will have Flag 1, and Value5 will have Flag 0... and Min(Flag) = 0?
What if you do a comparison like the one I've done below? In my quick test it seems to work as desired.
if(
Concat(DISTINCT Field1, ', ')
=
Concat({< Field1 *= {'Value1', 'Value2'}>}DISTINCT Field1, ', ')
,1,0)
I've attached my test qvw app
Oh, I didn't see the last part. That might actually be it!
Thank you for your time and help!