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

Rolling months bar chart

I want to know how to make a bar chart display the past 12 months (including the months selected). How can that be done?

1 Solution

Accepted Solutions
amit_saini
Master III
Master III

Amit,

See the attachment.

Thanks,

AS

View solution in original post

10 Replies
senpradip007
Specialist III
Specialist III

Try this expression Sum({<Date={">=$(=AddMonths(Max(Date),-12)) <=$(=Max(Date)) "}>} Value) with Month as dimension.

Anonymous
Not applicable
Author

Hi Amit,

    You can achieve the Rolling months chart by using  addmonths function. Define a variable which holds the current day. And equal another variable for last 12 months. By calling you date field to match this variable you can achieve the same.

-Jay

Not applicable
Author

What is Date in this expression?

senpradip007
Specialist III
Specialist III

Date may be calendar date or financial date, as you've created the calendar in your application.

amit_saini
Master III
Master III

Amit,

See the attachment.

Thanks,

AS

Not applicable
Author

try like this

sum({<monthid={">=$(=max(monthid)-11) <=$(=max(monthid))"},year=,quarter=,month=>}sales}

or

sum(aggr(rangesum(above(totalsum({<month=>}amount),0,12)),month))

sujeetsingh
Master III
Master III

Use accumulation option provided in Charts

ashfaq_haseeb
Champion III
Champion III

Hi,

Try this

Sum({<DATE={">=$(=MonthStart(Max(DATE),-12)) <=$(=MonthEnd(Max(DATE)))"}>} SALES)

Regards

ASHFAQ