Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a set analysis as below:
vYear : Year(today() )
vDayOfYear: daynumberofyear(today())
AccidentsTYTD: Count(Distinct {<Year, Year={'$(vYear)'}, DayOfYear={'<$(vDayOfYear)'} >} AccidentID)
If I enter this as master item it behaves OK against other dimensions, but if it is set via load script (from a variable sheet) it calculates incorrectly against the dimension. My Question, why do master item and variable behave differently, and how can it be fixed?
See an example below:
The first column is entering expression directory in the table measures,
second col is same expression already entered as master item,
last column is calling a variable which is populated at load time using LET $(vName) = '=' & lookup(...)
Thanks.
hi
when you have the '=' sign in the variable function
then qlik will calculate the expression and the variable is actually representing
the result of the expression on the whole data set
you just need to remove the '=' from your variable definition and it'll work
Hello,
when using < > <= or >= you need quotations in set analysis
use
AccidentsTYTD: Count(Distinct {<Year, Year={'$(vYear)'}, DayOfYear={"<$(vDayOfYear)"} >} AccidentID)
(I changed ' to " in the DayOfYear parameter).
Regards
hi
when you have the '=' sign in the variable function
then qlik will calculate the expression and the variable is actually representing
the result of the expression on the whole data set
you just need to remove the '=' from your variable definition and it'll work