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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
joshibabu_are
Contributor
Contributor

QOQ variance Calculation for First Quarter

Hi All,

I want to show      QoQ Varaiance.

Expression For 2017 Q1 Variance:

(Q4 Amount -Q1 Amount )/Q1*100

Same Logic For All Quarters .

I want dynamic Expression to achieve this .

please find the attached screen shot and data file and Qvf file

Result for 2017 Q1 should be: -20%


Any Help would be greatly appreciated.


stalwar1

Thanks,

Joshi

1 Solution

Accepted Solutions
sunny_talwar

This should do it

Aggr(Sum({<Year = {"$(=Max(Year))"}>}Amount)/Above(Sum({<Year, Quarter, YearQuarter>}Amount))-1, Division, (YearQuarter, (Text)))

View solution in original post

13 Replies
Anil_Babu_Samineni

What are these (400-500)/(500)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
joshibabu_are
Contributor
Contributor
Author

hi,

2016 Q4 Amount - 2017 Q1 Amount/2017 Q1 Amount.

hard coded figures should be replaced with Expression

Anil_Babu_Samineni

True, But when i filtering from Pane why i got 800 instead of 400 ??

Capture.PNG

From Expression prospective, Can you try a luck as Static

(sum({<Quarter = {'Q4'}, Year = {'2016'}>}Amount)-sum({<Quarter = {'Q1'}, Year = {'2017'}>}Amount))/sum({<Quarter = {'Q1'}, Year = {'2017'}>}Amount)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
joshibabu_are
Contributor
Contributor
Author

Hi Anil,

Thanks for your time

800 is sum for 2017.

Division 1 400+Division2 400=800

i used ur expression but it showing -100%

Thanks,

joshi

joshibabu_are
Contributor
Contributor
Author

hi Anil,

if i use Aggr its showing correct for your hard coded expression.

Aggr((sum({<Quarter = {'Q4'}, Year = {'2016'}>}Amount)-sum({<Quarter = {'Q1'},

Year = {'2017'}>}Amount))/sum({<Quarter = {'Q1'}, Year = {'2017'}>}Amount),Division)

how to achieve the same with Dynamic Expression?

Thanks,

Joshi

Anil_Babu_Samineni

Then may be use this?

Aggr((sum({<Quarter = {'$(=MaxString(Quarter))'}, Year = {'$(=Max(Year-1))'}>}Amount) - sum({<Quarter = {'$(=MinString(Quarter))'},Year = {'$(=Max(Year))'} >}Amount)) / sum({<Quarter = {'$(=MinString(Quarter))'}, Year = {'$(=Max(Year))'}>}Amount),Division)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
joshibabu_are
Contributor
Contributor
Author

Hi ,

thanks for your time spent to help me out.

Its working fine for 2017 Q1 but Q2,Q3,Q4 its showing blank QoQ variance %.

2017 Q2 variance =2017 Q1 - 2017 Q2 / 2017 Q2

Thanks,

Joshi

sunny_talwar

Check the attached... once you select 2017... it will work... but what do you want to see when nothing is selected?

joshibabu_are
Contributor
Contributor
Author

hi Sunny,

if nothing selected Max year data it should show