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: 
Faiz
Contributor
Contributor

Ignore first year data in YoY calculation

 

Hi,

I want to show Year on Year growth through a graph. The data in the table is shown below.

 

Faiz_0-1616198211600.png

I drew the below graph using the formula: 

Aggr(Sum(SALES)/Above(Sum(SALES)) - 1, ([Date.autoCalendar.Year], (NUMERIC)))*100

Faiz_1-1616198305411.png

1) How can I start the graph from 2014 instead of 2013 since the data for 2013 is not correct?

2) How can I make 2013 data as zero instead of -99.59?

 

 

 

 

1 Reply
rubenmarin

Hi, you can try with set analysis to fix selected years:

Aggr(Sum({<[Date.autoCalendar.Year]={">2013"}>} SALES)/Above(Sum({<[Date.autoCalendar.Year]={">2013"}>} SALES)) - 1, ([Date.autoCalendar.Year], (NUMERIC)))*100

Or using *= so year selections still filters data:

Aggr(Sum({<[Date.autoCalendar.Year]*={">2013"}>} SALES)/Above(Sum({<[Date.autoCalendar.Year]*={">2013"}>} SALES)) - 1, ([Date.autoCalendar.Year], (NUMERIC)))*100

To make 2013 as 0 I think the easy and simplest way is to use an if:

IF([Date.autoCalendar.Year]=2013, 0, Aggr(Sum({<[Date.autoCalendar.Year]*={">2013"}>} SALES)/Above(Sum({<[Date.autoCalendar.Year]*={">2013"}>} SALES)) - 1, ([Date.autoCalendar.Year], (NUMERIC)))*100)