Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
vanand3535
Creator III
Creator III

how to find % change in total sales

Hi everyone,

I want to find total % change in my sales since previous year like:

How can I apply this formula?

[Sales(2011)-sales(2010)] / sales(2010)

7 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Something like

=(Sum({<Year = {2011}> Sales) - Sum({<Year = {2010}> Sales)) / Sum({<Year = {2011}> Sales)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
vanand3535
Creator III
Creator III
Author

I know this but

I don't want to  write year hard coded . I want it by dynamically.

Because I have table with year 2011,2012,2013,2014

So it should calculate % change for every year automatically.

vanand3535
Creator III
Creator III
Author

it should be like:-

[sum(current year)-sum(last year)]/sum(last year)

jonathandienst
Partner - Champion III
Partner - Champion III

You did not ask for that in your original post.

Then you need to specify how you would like to set the dates dymanically (eg today, latest date in model, latest date - 1....)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
vanand3535
Creator III
Creator III
Author

[sales(current year)-sales(last year)]/sales(last year)

vanand3535
Creator III
Creator III
Author

yeah, I missed to post dynamically

arulsettu
Master III
Master III

try this

=(Sum({<Year = {"$(=max(Year))"}> Sales) - Sum({<Year = {"$(=max(Year)-1)"}> Sales)) / Sum({<Year = {"$(=max(Year))"}> Sales)