# Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Highlighted
New Contributor

## Trend graph calculation for rolling 12 months

Hi ,

I just want to show rolling 12 months in graph when I select a particular month. It is working fine for all months except the latest month. When I select latest month my trend graph is showing rolling 11 months except latest month. But when I select any other month rolling 12 months are shown including selected month.

Example: If I have data Apr 2017 to Jan 2019 if I select Jan 2019 graph is showing Feb 2018-Dec 2018 but not till Jan 2019

when I select Dec 2018 it showing Jan 2018 to Dec 2018 which is correct. The following is the formula I am using:

{<MyDatecol={"<=\$(=MyDatecol)>=\$(=date(addmonths(max(MyDatecol),-11),'DD-MMM-YYYY'))"}

Labels (2)

6 Replies
MVP

## Re: Trend graph calculation for rolling 12 months

Can add this to a KPI object and see what this shows?

`='>=' & Date(AddMonths(Max(MyDatecol), -11), 'DD-MMM-YYYY') & '<=' & Date(MyDatecol, 'DD-MMM-YYYY')`
Honored Contributor II

## Re: Trend graph calculation for rolling 12 months

{<MyDatecol={"<=\$(=date(max(MyDatecol)))>=\$(=date(addmonths(max(MyDatecol),-11),'DD-MMM-YYYY'))"}
Learning never stops.
New Contributor

## Re: Trend graph calculation for rolling 12 months

I tried implementing the formula you posted but the issue now is it is working fine for latest month but not for the other months.

MVP

## Re: Trend graph calculation for rolling 12 months

With date range do you see with this new expression?

New Contributor

## Re: Trend graph calculation for rolling 12 months

Date range for?? Please explain it ...

MVP

## Re: Trend graph calculation for rolling 12 months

In your response to Pradosh, you mentioned that this works for the latest month, but not for the other months. What date range do you see for other months? Why do you think it isn't working for other months?

Does that clarify my question?