Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Trying to use a variable in a set analysis expression and I can't figure out the syntax. It currently looks like
SUM({$<TIME_Year={vMax_Year}>} Employee_Salary)
'vMax_Year' is a variable set to the latest year in my data (2012).
Try this...
SUM({$<TIME_Year={$(#vMax_Year}>} Employee_Salary)
Thanks,
Dan
Thanks Dan, but it didn't work. However I did get it to work with
SUM({$<TIME_Year={"$(vMax_Year)"}>} Employee_Salary)
Can you help me understand why? Do you know of a good resource for set analysis syntax?
Hi there,
When you were trying to run your expression without the dollar sign you were effectively mixing syntaxes. Use of the variable at that point was not valid. However, when you put a variable in $() what QlikView does is 'swaps out' the dollar sign expanded variable for it's contents. This would mean that your code would effectively read as:
SUM({$<TIME_Year={"2012"}>} Employee_Salary)
This is then valid syntax.
There are a couple of PDF files on Set Analysis that you should be able to find if you Google for them.
I've uploaded a couple of Set Analysis examples as 'Shared QlikViews' that may be of help:
http://community.qlik.com/qlikviews/1175
http://community.qlik.com/qlikviews/1113
Hope that helps,