Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
bkn
Contributor II
Contributor II

Variable inside Set Analysis

Anyone please help to solve this issue.

// Not Working

SUM({$<Account={'Major','Non-Major'}>}$(vData))   // vData is a variable which pulls data

Thanks!!!

6 Replies
danielact
Partner - Creator III
Partner - Creator III

Can you post what vData is defined as?

bkn
Contributor II
Contributor II
Author

If(MonthName='FEB', SUM({<MonthName={'NOV'},FYYear={'$(vFYCurrentYear)'},Account="Major","Non-Major"}>}[CurrentData])

stigchel
Partner - Master
Partner - Master

$(vData) should be the name of a fiield, check by putting =vData in a textbox. Are there spaces in the field name, put square brackets around [$(vData)]

danielact
Partner - Creator III
Partner - Creator III

You're using a nested sum, which won't work. You can't have a Sum in your original function as well as in the variable you're calling.

Anonymous
Not applicable

your vData should be a field of your data model

Anonymous
Not applicable

Looking at your vData expression,

create another field (i.e. a flag) =1 for Month='FEB' in your script (considering this is the only condition you want to use), then write your expression as below,

SUM({<MonthName={'NOV'},FYYear={'$(vFYCurrentYear)'},Account={"Major","Non-Major"}>}[CurrentData]*New_Field)