Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

surajap123
Contributor 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
MVP & Luminary
MVP & Luminary

Re: current vs previous quarter sales

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
Valued Contributor III

Re: current vs previous quarter sales

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.

MVP & Luminary
MVP & Luminary

Re: current vs previous quarter sales

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

surajap123
Contributor II

Re: current vs previous quarter sales

Thanks you so much for the help !!