Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
rougeherring
Contributor III
Contributor III

Variable as Field and Value in Set Analysis Not Working

My Set Analysis is not working properly. A variable (vPeriodType) is set to equal the field [Year]. Then another variable is set to equal the maximum value of that field vPeriodTypeMax = Max($(vPeriodType))

vPeriodType = 'Year'

vPeriodTypeMax = 2021

I have test the variables above and get the values I'd expect. The following set analysis is not working.

Sum({<$(vPeriodType) = {"$(vPeriodTypeMax)"}>}NET_SALES)

It evaluated properly in the bottom and if I switch the value to 2021 manually, it works. It's just now working if I used the variable as the field value. 

2 Replies
Lisa_P
Employee
Employee

The double quotes are not relevant here, try this:

Sum({<$(vPeriodType) = {$(vPeriodTypeMax)}>}NET_SALES)

rougeherring
Contributor III
Contributor III
Author

I was able to get the following to work:

Sum({<$(vPeriodType) = {'$(=$(vPeriodTypeMax))'}>}NET_SALES)

Please let me know if I should have any concerns about using this method. Thanks.