Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
sunilkumarqv
Specialist II
Specialist II

Compare current quarter year with previous quarter year

Hi Friends,

I have to compare same quarter year with previous year quarter year than I'm trying to Replace Sales example Q1 2016 sales is 4 with Q1 2015 sales 10 then i will get Q1 2016 as 10 similarly  all ,please help me to achieve this

Quarter Year ,Sales

Q1 2015, 10

Q2 2015,23

Q3 2015,20

Q4 2015,5

Q1 2016,4

Q2 2016,6

Q3 2016,10

Output :

Dimension as "Quarter Year" and expression sum (Sales) then output should be like


Quarter year ,Curr sales ,Presales

Q1 2015, 10,0

Q2 2015,23,0

Q3 2015,20,0

Q4 2015,5,0

Q1 2016,10

Q2 2016,23

Q3 2016,20

4 Replies
Anil_Babu_Samineni

Front end solution may be this?

Create object and use dimensions are [Quarter Year]

Expressions are

Curr Sales

Sum({<[Quarter Year] = {'$(=Max([Quarter Year]))'}>}Sales)

Presales

Sum({<[Quarter Year] = {'$(=Max([Quarter Year]-1))'}>}Sales)

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
sunilkumarqv
Specialist II
Specialist II
Author

Hi Anil,

$(=Max([Quarter Year])) this not work [Quarter Year] only when we have numeric also the value will get max Q3 2016,10


I have to get growth of sales  Q1 2016/Q1 2015 -1

so im trying to create a new column or any other solution let me know



Anil_Babu_Samineni

Q1 2016 is the Max year of first quarter and then Q1 2015 - 1  is that you meant is Last year of Max year and then it should be first quarter (Here what does -1) . Would you describe more please

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
jayaseelan
Creator III
Creator III

Hi Sunil,

I have got your desired output. I have done this on edit Script. Please find the attachment. i hope this will helps you.

Thanks,