Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ejacob
Contributor II
Contributor II

Set Analysis - Dynamic Record Set

Hi,

What's wrong with this Dynamic Record Set, based on the user's current selections?

=Sum({$<month_cal={'$(=Month(AddMonths(Makedate(year_cal, Num(month_cal,'00')),-1)))'}>} DISTINCT active_employees)

Thanks.

1 Solution

Accepted Solutions
jerem1234
Specialist II
Specialist II

It is not working because set analysis is calculated once per chart and not per row. Therefore it will not change dynamically with each row. You'll have to use the above() function or create a field in loadscript that uses peek() or previous().

Hope this helps!

View solution in original post

8 Replies
ejacob
Contributor II
Contributor II
Author

I'll try to explain better what I need with this analysis

ejacob escreveu:

Hi,

What's wrong with this Dynamic Record Set, based on the user's current selections?

=Sum({$<month_cal={'$(=Month(AddMonths(Makedate(year_cal, Num(month_cal,'00')),-1)))'}>} DISTINCT active_employees)

Thanks.

I have this values

month_calactive_employeesset_analysis calc
jan155december value - year before
feb203155
mar205203

I can't use Above(), because it's a bar chart.

Not applicable

what is the error you're getting?

ejacob
Contributor II
Contributor II
Author

When I use this code on set_analysis_calc expression

=Month(AddMonths(Makedate(year_cal, Num(month_cal,'00')),-1))

I have this values

month_calactive_employeesset_analysis calc
jan155dec
feb203jan
mar205feb

But the entire code

=Sum({$<month_cal={'$(=Month(AddMonths(Makedate(year_cal, Num(month_cal,'00')),-1)))'}>} DISTINCT active_employees)

Results on something like this

month_calactive_employeesset_analysis calc
jan1550
feb2030
mar2050
Not applicable

Try this

=Sum({$<month_cal={$(=Chr(39) & Month(AddMonths(Makedate(year_cal, Num(month_cal,'00')),-1))) & Chr(39)}>} DISTINCT active_employees)

ejacob
Contributor II
Contributor II
Author

Hi. Unfortunately, didn´t work.

jerem1234
Specialist II
Specialist II

It is not working because set analysis is calculated once per chart and not per row. Therefore it will not change dynamically with each row. You'll have to use the above() function or create a field in loadscript that uses peek() or previous().

Hope this helps!

ejacob
Contributor II
Contributor II
Author

Now It works. Thanks.

IAMDV
Luminary Alumni
Luminary Alumni

I've made video tutorials on Previous() and Peek(). Just in case if you need them.

http://qlikshare.com/184/

http://qlikshare.com/172/

Thanks,

DV

www.QlikShare.com