Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good Morning,
I've a simple expression like this: Sum(if($(bCondition),Adults))
$(bCondition) is a boolean variable.
How can I "translate" it correctly in set analysis syntax ?
Thanks in advance.
Paolo.
I 100% agree with Chanty! While loading the data create a flag field with definition of $(bCondition) i.e. 1 or 0; later you can consume it in set expression as Sum({<flag={1}>}Adults).
Regards!
Rahul Pawar
how your bCondition variable looks like ?
try with single quotes
Sum(if('$(bCondition)',Adults))
It's a (very complex) boolean expression, that I don't want to replicate with set analysis syntax...
That's not set analysis syntax...
if you want to create set ,
create a flag for bCondition value inside it and use that in frontend set analysis
i guess you can't.
why are you thinking to use set analysis ?
i think you should rewrite the boolean variable logic inside the script adding a new field, after you can use it in set analysis.
Because lot of people told me that "if" lacks on performance, so I'm evaluating how to convert these expressions with set analysis.
An alternative would be convert them and store expressions into variables, then use them.
Example: let's say $(bCondition) is something taking everything that current selection excludes, built with "if" and other script functions. In set analysis it's intended as {1-$}. <pseudo-syntax mode on> So: LET bCondition = "{1-$}". Then: sum(<$(bCondition)>Adults) </pseudo-syntax mode off>
But I don't think it's an available way...
yes, you are correct,
but one or two if doesn't make any issue i believe , if it is complex and multiple if conditions if you use in front end it causes performance issue.
read this
I 100% agree with Chanty! While loading the data create a flag field with definition of $(bCondition) i.e. 1 or 0; later you can consume it in set expression as Sum({<flag={1}>}Adults).
Regards!
Rahul Pawar