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

Variables inside Set Analysis

I have a variable which store expression. I need to use that variable in Set Analysis.

Variable = vData

Eg.  =SUM({<Account={"Prime"}>}vData) // this does not work

11 Replies
MK_QSL
MVP
MVP

Try '$(vData)'

Anonymous
Not applicable

It depends what the expression is inside the variable.  If it contains an aggregation (e.g. sum or count), you have sum( of sum()), which is not allowed.  You have to use aggr:

sum(aggr(sum(),fields))

In your case probably something like this:

SUM({<Account={"Prime"}>} aggr(vData,<list of fields here>) )


bkn
Contributor II
Contributor II
Author

DOES NOT WORK

bkn
Contributor II
Contributor II
Author

What fields will be here <list of fields here>

Anonymous
Not applicable

This is something I cannot guess - it is specific to your application and the chart.  If you can upload your app or a simplified example, then I (or someone else) will be able to help.

vvvvvvizard
Partner - Specialist
Partner - Specialist

try just =$(vdata)

bkn
Contributor II
Contributor II
Author

=NUM((SUM({<[ID]={"=Rank(Aggr(SUM([Current Quarter]),[ID]))<=20"}>} $(vData))),'$#,##0')

Sorry, doesnot work!!!

ramoncova06
Specialist III
Specialist III

what is inside of you variable ?

once you provide that we can understand what can be causing the problem

bkn
Contributor II
Contributor II
Author

These expressions are inside variable:

If(UnbilledMonthName='FEB', SUM({<UnbilledMonthName={'NOV'},UnbilledFYYear={'$(vFYCurrentYear)'}>}[Unbilled Current Quarter])

,If(UnbilledMonthName='MAR', SUM({<UnbilledMonthName={'DEC'},UnbilledFYYear={'$(vFYCurrentYear)'}>}[Unbilled Current Quarter])

,If(UnbilledMonthName='APR', SUM({<UnbilledMonthName={'JAN'},UnbilledFYYear={'$(vFYCurrentYear)'}>}[Unbilled Current Quarter])

,If(UnbilledMonthName='MAY', SUM({<UnbilledMonthName={'FEB'},UnbilledFYYear={'$(vFYCurrentYear)'}>}[Unbilled Current Quarter])

,If(UnbilledMonthName='JUN', SUM({<UnbilledMonthName={'MAR'},UnbilledFYYear={'$(vFYCurrentYear)'}>}[Unbilled Current Quarter])

,If(UnbilledMonthName='JUL', SUM({<UnbilledMonthName={'APR'},UnbilledFYYear={'$(vFYCurrentYear)'}>}[Unbilled Current Quarter])

,If(UnbilledMonthName='AUG', SUM({<UnbilledMonthName={'MAY'},UnbilledFYYear={'$(vFYCurrentYear)'}>}[Unbilled Current Quarter])

,If(UnbilledMonthName='SEP', SUM({<UnbilledMonthName={'JUN'},UnbilledFYYear={'$(vFYCurrentYear)'}>}[Unbilled Current Quarter])

,If(UnbilledMonthName='OCT', SUM({<UnbilledMonthName={'JUL'},UnbilledFYYear={'$(vFYCurrentYear)'}>}[Unbilled Current Quarter])

,If(UnbilledMonthName='NOV', SUM({<UnbilledMonthName={'AUG'},UnbilledFYYear={'$(vFYPriorYear)'}>}[Unbilled Current Quarter])

,If(UnbilledMonthName='DEC', SUM({<UnbilledMonthName={'SEP'},UnbilledFYYear={'$(vFYPriorYear)'}>}[Unbilled Current Quarter])

,If(UnbilledMonthName='JAN', SUM({<UnbilledMonthName={'OCT'},UnbilledFYYear={'$(vFYPriorYear)'}>}[Unbilled Current Quarter])))))))))))))