Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get percentage Difference

hi Everyone. i nee one help.. i calculate a Difference Between Current Year Sale and Last Year

like..

=if(sum({$<Year = {$(=max(Year))}>}Price_Pcs_Incl_Discount) > sum({$<Year = {$(=max(Year)-1)}>}Price_Pcs_Incl_Discount),

sum({$<Year = {$(=max(Year))}>}Price_Pcs_Incl_Discount) - sum({$<Year = {$(=max(Year)-1)}>}Price_Pcs_Incl_Discount),

sum({$<Year = {$(=max(Year)-1)}>}Price_Pcs_Incl_Discount) - sum({$<Year = {$(=max(Year))}>}Price_Pcs_Incl_Discount))..

so i m getting and answer Suppose.. This Year sale is 100 Rs and Last Year sale was 50 Rs.. so total growth 50 Rs.. But i want

to show growth in %.. in this case my Revenue growth is 50 %.. because it got double from last year..

Plz help me how to do this

Labels (1)
4 Replies
MayilVahanan

Hi

Try like this

=if(sum({$<Year = {$(=max(Year))}>}Price_Pcs_Incl_Discount) > sum({$<Year = {$(=max(Year)-1)}>}Price_Pcs_Incl_Discount),

(sum({$<Year = {$(=max(Year))}>}Price_Pcs_Incl_Discount) - sum({$<Year = {$(=max(Year)-1)}>}Price_Pcs_Incl_Discount)) / sum({$<Year = {$(=max(Year))}>}Price_Pcs_Incl_Discount),

(sum({$<Year = {$(=max(Year)-1)}>}Price_Pcs_Incl_Discount) - sum({$<Year = {$(=max(Year))}>}Price_Pcs_Incl_Discount)) / sum({$<Year = {$(=max(Year)-1)}>}Price_Pcs_Incl_Discount)

)

Number tab, please check "Show in Percent"

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
marcus_sommer

I would use something like this (simplified without conditions):

sum(CurrentYear) / sum(LastYear)

maybe extended to a 1 - Expressions or reversed or wrapped within a fabs() to display the result from a certain direction.

- Marcus

Not applicable
Author

hi Marcus,

on selecting any year ... its need to give current year sale and last year sale and Difference between and Percent Difference between them... can u able to send me the complete expression.. how to write,,..

CELAMBARASAN
Partner - Champion
Partner - Champion

Actually formula for growth percentage is

((Current Value - Old Value)/Old Value) * 100

So your expression would be

=((sum({$<Year = {$(=max(Year))}>}Price_Pcs_Incl_Discount) - sum({$<Year ={$(=max(Year)-1)}>}Price_Pcs_Incl_Discount))/ sum({$<Year = {$(=max(Year)-1)}>}Price_Pcs_Incl_Discount)) * 100