Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have reviewed almost every thread on this but can't get it to work.
I want to be able to use less and greater than variables in set analysis. Please see below and let me know how I can fix the variable part.
sum({<field1={'1'},field2={>"$(vVariable2)"},[field3]={<"$(vVariable3)"}>}[field4])
Thanks!!
Try like
sum({<field1={'1'},field2={">$(vVariable2)"},[field3]={"<$(vVariable3)"}>}[field4])
Try this:
Sum({<field1={'1'}, field2={">$(=vVariable2)"}, [field3] = {"<$(=vVariable3)"}>}[field4])
or
Sum({<field1={'1'}, field2={">$(=$(vVariable2))"}, [field3] = {"<$(=$(vVariable3))"}>}[field4])
Thanks! Can I also do a calculation inside that as well? Realized I need to add 1 to vVariable2, but dont want to introduce a new variable.
sum({<field1={'1'},field2={">$(vVariable2)+1"},[field3]={"<$(vVariable3)"}>}[field4])
Thanks! Can I also do a calculation inside that as well? Realized I need to add 1 to vVariable2, but dont want to introduce a new variable.
sum({<field1={'1'},field2={">$(vVariable2)+1"},[field3]={"<$(vVariable3)"}>}[field4])
or if I can have an if right after that does it for me, that should work too?
May be this:
Sum({<field1={'1'}, field2={">$(=$(vVariable2)+1)"}, [field3] = {"<$(=$(vVariable3))"}>}[field4])
or
Sum({<field1={'1'}, field2={">$(=vVariable2+1)"}, [field3] = {"<$(=vVariable3)"}>}[field4])
None seem to work, is there a way to have the variable greater/less than outside the {<>} and use an if statement for that?
Sure, this should be possible.
How is your variable defined? Is it just a static number?
Maybe like Sunny suggested, or try also
sum({<field1={'1'},field2={">$(=vVariable2+1)"},[field3]={"<$(vVariable3)"}>}[field4])
didn't work...my variable is defined in the load script based on a field.
how can I have it as a combination of if and set analysis? wanna do the following:
sum({<field1={'1'}>} if (field2 > $(vVariable2+1),field3=$(vVariable3)), [field4])