Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I am trying to make a Chart If Statement work using a field to inject the logic.
Here are my test data:
Data:
LOAD * INLINE [
Value, Dimension
1, Cars
3, Bikes
];
Logic:
LOAD * INLINE [
Dimension, Logic, Target_Value
Cars, Value < Target_Value, 2
Bikes, Value > Target_Value, 2
];
In my chart, I have used the following test If statement:
if($(=Logic), 1,0)
The challenge I have is that my formula works when one of the dimensions is selected (eg Cars or Bikes):
But it does not work in the default state with no selections. It only returns the dash '-' see below:
Does anyone have a way to make this scenario work so that the logic works when no selections are made? File attached...
Thanks in advance,
Will
Hi William,
Have a look at the attached file.
If(Pick(Match(Logic,$(=Concat(Chr(39)& Logic & Chr(39), ','))),$(=Concat(Logic,','))),1,0)
Hi,
Create a variable vTest
Use the expression $(vTest)
You will get your output.
Thanks,
Uj
Hi William,
Have a look at the attached file.
If(Pick(Match(Logic,$(=Concat(Chr(39)& Logic & Chr(39), ','))),$(=Concat(Logic,','))),1,0)
Many thanks Tamil - that works brilliantly!
Thanks Uj - I like that idea. However, I want to keep the Logic field within the table for now. See Tamil's solution below.