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

Calculate YOY % Change By Year

Hello,

I am trying to calculate YOY % change for some one my graphs, but cannot seem to sum total 2018, then sum 2017, and manually work out the % growth in the calculation in the function section. 

Ideally I would like a bar chart that shows +/- % change, or even just to give me the number for % change somehow

I can only figure out how to see yearly performance in the "Year" filter selection on my sheet, but not sure how to actually sum individual years for growth calculations in the function section. 

I am trying to show market growth for my measure: "Market Sales", and the year is simply called "Year". Ideally I would like to do something like the following to give me the growth %:

(2018 market sales) - (2017 market sales) / (2017 market sales)

thank you

Labels (1)
4 Replies
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

I will try to help you out though I do not see any script or data sample:

This year 2019 sales:

Sum(
{<
	[Date]={'>=$(=YearStart(Today()))<=$(=YearEnd(Today()))'}
>}
Sales)

2018y sales:

Sum(
{<
	[Date]={'>=$(=YearStart(Today(), -1))<=$(=AddYears(Today(), -1))'}
>}
Sales)

 2017y sales:

Sum(
{<
	[Date]={'>=$(=YearStart(Today(), -2))<=$(=AddYears(Today(), -2))'}
>}
Sales)

 

Now the YOY % calculation would be easy to make even in graphics.

GReeeeN
Contributor
Contributor
Author

thank you for the reply!, i have tried the following to calculate the % change but it appears to be giving me a result of 0. Am I missing some open/ close brackets anywhere?

((Sum(
{<
[Date]={'>=$(=YearStart(Today(), -1))<=$(=AddYears(Today(), -1))'}
>}
[Shop Values]))
-
(Sum(
{<
[Date]={'>=$(=YearStart(Today(), -2))<=$(=AddYears(Today(), -2))'}
>}
[Shop Values])))
/
Sum(
{<
[Date]={'>=$(=YearStart(Today(), -2))<=$(=AddYears(Today(), -2))'}
>}
[Shop Values])

 

essentially trying to (2018 Shop Values - 2017 shop Values) / 2017 Shop Values: which should give me the % change?

 

jonathandienst
Partner - Champion III
Partner - Champion III

If you are using a recent version of QV, then you may need to change the single quotes  around the Date search term to double quotes. Single quotes imply a literal string, whereas double quotes imply a search expression.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
GReeeeN
Contributor
Contributor
Author

I am using the latest version of Qlik Sense Desktop.

Tried adding another pair of [ ] around the dates but it errored out.