Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
MVP
MVP

Try '$(vData)'

Highlighted
Champion III
Champion III

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>) )


Highlighted
Contributor II
Contributor II

DOES NOT WORK

Highlighted
Contributor II
Contributor II

What fields will be here <list of fields here>

Highlighted
Champion III
Champion III

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.

Highlighted
Specialist
Specialist

try just =$(vdata)

Highlighted
Contributor II
Contributor II

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

Sorry, doesnot work!!!

Highlighted
Specialist III
Specialist III

what is inside of you variable ?

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

Highlighted
Contributor II
Contributor II

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])))))))))))))