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: 
Not applicable

Problem with Rolling 12 months

Hello Everyone,

I am using below variables and expressions to get rolling 12 months data.

variables:

vMaxYearMonth=max({<Flag={'XXX'}>} Date( Date# ( Month&'-'&Year_No,'MMM-YYYY'),'MMM-YYYY'))

(vMaxMonthYear_PY12)==date(AddMonths(vMaxYearMonth,-11),'MMM-YYYY')

Expression:

=(sum({$<Year_No={$(vCY)},DATE=,WeekStart=,Month=,Year_No=,Month_Year={'>=$(vMaxMonthYear_PY12) <=$(vMaxYearMonth)'}>}aggr(sum({$<Year_No={$(vCY)},DATE=,WeekStart=,Month=,Year_No=,Month_Year={'>=$(vMaxMonthYear_PY12) <=$(vMaxYearMonth)'}>}D360.Revenue_Prop),CODE,Month_Year)))

but i am not getting any value. my data at date level,

Can any body tell me where i am doing mistake

Thanks

2 Replies
PrashantSangle

Hi,

It is really long expression, Very difficult to find error.

But still you can try like below

1: Write your variable Name in text Object.

Did you get any value for it

vMaxYearMonth=max({<Flag={'XXX'}>} Date( Date# ( Month&'-'&Year_No,'MMM-YYYY'),'MMM-YYYY'))

(vMaxMonthYear_PY12)==date(AddMonths(vMaxYearMonth,-11),'MMM-YYYY')

I am not getting why there is == in your variable

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
HirisH_V7
Master
Master

hi,

You can use like this at calendar  At back end

    If(Date>= AddMonths(Today(), -12), 1)as Last12MonthFlag

At front end

Last12MonthFlag={1}


Hope this Helps


Regards,

hirish

HirisH
“Aspire to Inspire before we Expire!”