Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
Showing results for 
Search instead for 
Did you mean: 

Show Previous Quarter (sales) as a Calculated Field based on the current quarter that is selected

Hi Folks.

What I would like to do is add another column called [Previous QTR Sales] and then when:

     The user selects:

  • Q1 the [Sales] column will show sales for Q1 and [Previous QTR Sales] shows Q4 previous year Sales. *there is no data for this so i cannot check but just want to mention it because this will be a problem for me in 2020 Q1.
  • Q2 the [Sales] column will show sales for Q2 and [Previous QTR Sales] Shows Q1 sales
  • Q3 the [Sales] column will show sales for Q2 and [Previous QTR Sales] Shows Q2 sales
  • Q4 the [Sales] column will show sales for Q2 and [Previous QTR Sales] Shows Q3 sales

I thought this would be easy but nothing I have read or found so far works and keeps me from having to up date a parameter every Quarter / Year.

Thank you in advance for your help!

Rupali E


Labels (1)
2 Replies

Are you creating a master calendar table? Are you setting any variables like the following?

Let vCurr_Yr = Year(Today());  Let vCurr_Mo = Month(Today()); Let vCurr_Qtr = Ceil(Month(Today())/3);

Establishing a master calendar would be best in my opinion, but if you are using variables you can say:

Let vPrev_Qtr = If(vCurr_Qtr = 1, 4, vCurr_Qtr-1)


Let vPrev_Yr = If(vCurr_Qtr = 1, 4, vCurr_Yr-1)

Then use those variables in your expressions with Set Analysis:

Sum({<Year={$(vPrev_Yr)},Quarter={$(vPrev_Qtr)}>} Sales)


Design Blog post regarding how to create a Master Calendar that may be helpful:


To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.