Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
curiousfellow
Specialist
Specialist

no result in expression in set analysis

In my app I want to show 4 charts.

First displays results of a year chosen in a listbox

Second shows year + 1

third shows year +2

For the second ,third and fourth chart I use a variable that is a result of the chosen year (=getfieldselections(tbl.year)

expression in the other charts  :

=(sum(
if((aggr(max({<
tbl.year
={$(=var_year+1)}
>}
sales),%employee))
>1000,
1, 0 ) ) )

$(=var_year+1) can be +2 or +3

I don't get any results. even when I make a new variable with the expression getfieldselections(tbl.year)+1 I don't get results, allthough that variable shows the correct result in a textbox.

when I use the calculated variable in other set analysis expressions I get correct results, so I assume it has something to do with the aggr(max part in my expression.

Can I use calculated variables with the aggr function or is there another way to make my charts kind of dynamic ?

3 Replies
sunny_talwar

May be you need to add the set analysis to out aggregation also

=(Sum({<tbl.year={$(=var_year+1)}>} If((Aggr(Max({<tbl.year={$(=var_year+1)}>} sales),%employee))>1000, 1, 0)))

curiousfellow
Specialist
Specialist
Author

Thank you, seems to work.

sunny_talwar

Awesome!! Please close this thread by marking the correct response if you got what you were looking for.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny