Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rolling 6 months

Hi!

I want to calculated the sum of 6 rolling months in a table graph dynamically based on the period selected by the user.

If the user select period 201006 (i.e PeriodCounter) I want the table to sum the amount for 201001-201006.

I'm trying to use this expression but i don't get the correct result. What am I doing wrong?

sum({$< PeriodCounter = {">$(=max(PeriodCounter)-6)"},PeriodCounter = {"<=$(=max(PeriodCounter))"},[Year Month]={"*"}>} Amount))



BR

Zandra

2 Replies
Not applicable
Author

I had the same problem......and use this
sum( { < Period_Counter= {">=$(var_inicio)<=$(var_final)"} >} Amount )
Where i set the variables:
var_inicio = NUM(MonthName(AddMonths(Period_Counter,-6)))
var_final = NUM(Period_Counter)
If you have some doubt....ask me...


Not applicable
Author

Thank you!

I managed to solve it another way:

= sum({$< PeriodCounter = {">$(#=max(PeriodCounter)-6) <=$(#=max(PeriodCounter))"},[Year Month]={"*"} >} Amount)