Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kushalthakral
Creator III
Creator III

Need to calculate Perc diff this month last month

Hi All

i have a requirement to show data like below

where i am calculating % diff of current month and same month last year for all the months and also calculating % diff of current three months and same three months last year

Can any one help me or suggest something

   

YearMonthABCIncrease on same monthIncrease on same quarter in previous Year
2016Aug10=(10-40)/40
2016Jul20
2016Jun30
2016May40
2016Apr50
2016Mar60
2016Feb70
2016Jan80
2015Dec90
2015Nov10
2015Oct20
2015Sep30
2015Aug40
2015Jul50
2015Jun60
2015May80
2015Apr10
2015Mar30
2015Feb10
2015Jan30
2014Dec50
2014Nov60
2014Oct10
2014Sep50
2014Aug30
2014Jul40
2014Jun30
2014May50
2014Apr60
2014Mar20
2014Feb30
2014Jan50

Thanks

Kushal

1 Solution

Accepted Solutions
sunny_talwar

Attaching a sample

Capture.PNG

View solution in original post

8 Replies
sunny_talwar

There is two way to do this, I recommend the first way

1) Use The As-Of Table

2) Use Above()/Below() function

(Sum(ABC) - Below(Sum(ABC), 12)) / Below(Sum(ABC), 12)

kushalthakral
Creator III
Creator III
Author

Hi Sunny

Below function is not working as i am deriving ABC values using count function and it is not working with below function

Regards

Kushal

sunny_talwar

Do you have multiple dimensions? May be you need a TOTAL. The reason I say that is because I don't think Count should cause any issues.

(Count(ABC) - Below(TOTAL Count(ABC), 12)) / Below(TOTAL Count(ABC), 12)

If this doesn't work, would you be able to share the expression you are using?

kushalthakral
Creator III
Creator III
Author

it is giving null because year is changing if i use 12 from 2016 to 2015

sunny_talwar

The one where we added TOTAL is the one which is giving null?

sunny_talwar

Attaching a sample

Capture.PNG

kushalthakral
Creator III
Creator III
Author

Thanks Sunny its working

Can you also helo how we can do for last 3 months againt those 3 months in last year

Regards

Kushal

sunny_talwar

Like you had an example for the increase on the same month, can you also provide an example for this quarter change you are looking for? I think it will be easier for me to understand what you want if there is an example to look at