Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts
I have 12 measures: "January" , "February", ...."December". These measure come along with an excel file as a key figure model.
In a set expression I would like to filter on one of those 12 measures depending on the Year-Month dimension. Each Year-Month values has 12 measures: Jan up to Dec. I think we have to define a variable on those measures. Am I right? How would you define this variable?
Thanks, Tom
If you want to use a variable in an expression, define it in the variables section found at the very bottom of the assets pane, and the definition of the varaible can be blank (set by a script, Vizlib, etc), or itself an expression.
If you want to use a variable in the load editor, just state it by using a statement like LET vmonth = something; (Or use SET if you want the expression to not be calculated until called by $() expansion)
You can also do this directly in the field by using a complex seeded IF statement, like:
If([field] = 'JAN', do january thing, If([field] = 'FEB', do february thing, If([field] = 'MAR', do march thing, else)))
Where the syntax is effectively If(expression, THEN, ELSE)