Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

arvindjha2050
New Contributor II

Trailing Twelve months data on line chart

Hello Team,

I would like to trailing twelve month's data,below is sample data for same

Script :

Load * Inline

[

TransactionDate , Sales

01/25/2017 , 15

04/25/2017 , 10

07/25/2017 , 12

10/25/2017 , 11

12/25/2017 , 10

01/25/2018 , 09

03/31/2018 , 33

04/01/2018 , 28

04/25/2018 , 25

];


I tried the below formula but how to get it for all time periods on a line chart


Sum({$<TransactionDate = {"<=$(=QuarterEnd(QuarterEnd(Today(),-1)))>$(=AddYears(Today(),-1))"}>}Sales)


For example in March,2018 it will show sum of sales from 1st March,2017 to 28th February,2018.

For example in April,2018 it will show sum of sales from 1st April,2017 to 31st March,2018 .......


Thanks,

Arvind



1 Reply
arunaerra
Contributor

Re: Trailing Twelve months data on line chart

Hi

Try Below one.

=Sum({<Date={">=$(=MonthStart(Max(Date),-11))<=$(=Date(Max(Date)))"}>} Sales )