Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

rolling 12 months

HI

I have date field with 3 years dates. But i need to get 12 months rolling.

How can we get 12 months rolling

can some one suggest on this

22 Replies
Anonymous
Not applicable
Author

hi

i need rolling 12 months, For example if the user filters to March of 2017 the chart will show April of 2016 – March of 2017.

Based on your expression, i tried below but getting as invalid dimension

=({<DateField={">=$(=addmonths(max(DateField),-11))<=$(=max(DateField))"},Year=,Month=,Quarter=>})

Anonymous
Not applicable
Author

Hi

Using  Calendar.qvw, I have used rolling type: R3M and period:22-05-2014 then I@ am able to see May, Jun, July in the 2014 year.

but my requirement is if I give period:22-05-2014 then I need to get  March, April, May in 2014.


How can I get that?

Not applicable
Author

first make date field to month year

          date(date#(datefield,'YYYYMMDD'),'MM-YYYY') as MONTH_YEAR

and use below expression

sum(MONTH_YEAR={">=$(=date(AddMonths(date(num(max(MONTH_YEAR)),'MM-YYYY'),-11),'MM-YYYY'))<=$(=date(num(max(MONTH_YEAR)),'MM-YYYY'))"}>}Amount)

Anonymous
Not applicable
Author

HI

thanks for reply, this is working.

if i want to get 12 months rolling always comparing with current date , how We have to use current date here.

Can you please suggest

Not applicable
Author

use date(today(),'date format') for current date

Anonymous
Not applicable
Author

try this its work fine

sum({<Date = {">=$(=num(MonthStart(Max(Date),-11)))<=$(=num(MonthEnd(Max(Date))))"}

,YEAR=,MONTH=>}[Opportunity Amount])

Regards

Sahadev

Anonymous
Not applicable
Author

hi,

i am using below expression , but i am geting blank data, where i suppose to get 12 records with last 12 months.

IF((date(AddMonths(date(date(today(),'YYYYMMDD'),'MM-YYYY'),-11),'MM-YYYY'))<=date(date(today(),'YYYYMMDD'),'MM-YYYY'),$(MONTH_YEAR))

Anonymous
Not applicable
Author

HI

Can you please give provide qvw, where it shows 12 months rolling data, please dont add measures here as usm or max.

Anonymous
Not applicable
Author

HI

Can you please give provide qvw, where it shows 12 months rolling data, please dont add measures here as usm or max.

Anonymous
Not applicable
Author

HI

i am able to get have created two varaibles var1 , where i am able to get value as month -year and var2 getting last 12 months as month- year

But when i trying to do var2 >= var1 to get difference as 12 months in one column  it is just  giving data as -1 ( whcih shos as correct) and it is not giving 12 months.

Can someone please help

var2:date(AddMonths(date(date#(datecolumn,'YYYYMMDD'),'MM-YYYY'),-11),'MM-YYYY')

var1:date(date#(datecolumn,'YYYYMMDD'),'MM-YYYY')

I need all var2>=var1 values

please help