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 12 expression gives zero

Hi Qlik Experts,

I have the following scenario for rolling 12 calculation for which I am getting zero as result. Please help me in identifying the gap in my expression. I have referred many threads and re-aligned my expression , but no luck

I have a qvd with a non-date column which I have converted to date in load script(Refer attached sample app) . I have some other QVDs which have date columns itself for which my rolling 12 expression works fine. So while using similar expression to calculate rolling 12 , I am getting 0 as result. Please help.

-Jamy. !

1 Solution

Accepted Solutions
sunny_talwar

Try these:

=  Num(Sum({<SpendPeriod ={"$(='>' & Date(AddMonths(Max(SpendPeriod), -12), 'YYYYMM') & '<=' & Date(Max(SpendPeriod), 'YYYYMM'))"}>} SpendInvoiceAmount) ,'### ### ### ### ##0,00', ',', ' ') & ' €'

=Num(Sum({< SpendPeriod ={"$(='>' & Date(AddMonths(Max(SpendPeriod), -12), 'YYYYMM') & '<=' & Date(Max(SpendPeriod), 'YYYYMM'))"} >} SpendPOValue) ,'### ### ### ### ##0,00', ',', ' ') & ' €'

View solution in original post

1 Reply
sunny_talwar

Try these:

=  Num(Sum({<SpendPeriod ={"$(='>' & Date(AddMonths(Max(SpendPeriod), -12), 'YYYYMM') & '<=' & Date(Max(SpendPeriod), 'YYYYMM'))"}>} SpendInvoiceAmount) ,'### ### ### ### ##0,00', ',', ' ') & ' €'

=Num(Sum({< SpendPeriod ={"$(='>' & Date(AddMonths(Max(SpendPeriod), -12), 'YYYYMM') & '<=' & Date(Max(SpendPeriod), 'YYYYMM'))"} >} SpendPOValue) ,'### ### ### ### ##0,00', ',', ' ') & ' €'