Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
surajap123
Creator II
Creator II

current vs previous quarter sales

Hi Experts,

I am trying to compare sales by current quarter vs previous quarter using set analysis.

When a user click in the quarter list box, the straight table should show max quarter and its previous quarter sales. However whenever i do selections in quarter list box both current and previous quarter columns are giving same values.

I think the varaiable vMaxQuarter and vPriorQuarter has got issue.

Please help !!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

vPriorQuarter needs to be calculate differently and you need to calculate the year of the previous quarter too. See attached qvw.


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
sudeepkm
Specialist III
Specialist III

you are using

=Ceil(num(month(max(QUARTER_DATE)-1))/3) as prior quarter

max(QUARTER_DATE)-1 will give you a date just one day older than the max date so the date is having the same quarter.

you may try this for your vPriorQuarter variable expression

=Ceil(num(month(max(QUARTER_DATE)))/3)-1

EDIT: one more thing I found is that the Year is not considered while comparing quarters. is that intentional.

right now your chart will compare the total value of Q1 from all possible year to Q2.

Gysbert_Wassenaar

vPriorQuarter needs to be calculate differently and you need to calculate the year of the previous quarter too. See attached qvw.


talk is cheap, supply exceeds demand
surajap123
Creator II
Creator II
Author

Thanks you so much for the help !!