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: 
Not applicable

compare selected Quarter with previous Quarter

Hi,

I want to compare Selected Quarter with Previous Quarter using Set Analysis. Can any1 help me with this?

- Yojas

1 Solution

Accepted Solutions
deepakk
Partner - Specialist III
Partner - Specialist III

hi Yojas,

I used one of the method of calculating previous qtr. I hope the attach application helps you out.

Deepak

View solution in original post

5 Replies
deepakk
Partner - Specialist III
Partner - Specialist III

hi Yojas,

I used one of the method of calculating previous qtr. I hope the attach application helps you out.

Deepak

Not applicable
Author

Thanx.....

-Yojas

Not applicable
Author

Really efficient way to do this calculation.  If you have strings in your Qtr field, simply use this slight code change from the App -

Sum({<FiscalQuarter={$(=Maxstring(FiscalQuarter))}>}Sales)

Not applicable
Author

Wanted to add to the post and thank Deepak, who ended my full-day search through the community for the solution to a similar problem. As mine was a bit more complex - I could not work with a Year Dimension in my Pivot Chart and had to get the "Year" information into the Quarter selection. I adapted the variable approach like this:

1. Created a List box based on my dates but used an expression to condense to Quarters, so to a user it would appear as a single-selection, whereas all days of the quarter are selected.  =Year(Date)&'_Q'&ceil(month(Date)/3)

2. Defined a variable vYQ-1 based on the current date selection, calculated one quarter back (minus 92 days) and used Year Function:   =Year(date(max(Date)-92,'DD.MM.YYYY')) 

3. Defined a variable vQ-1 based on the current date selection, calculated one quarter back (minus 92 days) and used the function to get: =ceil(month(date(max(Date)-92,'DD.MM.YYYY'))/3)

4. Used Set Analysis in the chart to get the "Previous Quarter" from the current selection =Sum({1<Year={$(vYQ-1)},_Qtr={$(vQ-1)} >} Amount)

nevets22
Contributor III
Contributor III

Thanks for sharing! This helped me tremendously!