Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 ?
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)))
Thank you, seems to work.
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