Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
vanderson009
Creator III
Creator III

Quarter Issue

I have data from Sep 2015 to Apr 2016, I created quarter field, I want previous quarter to display but it wont work.

Thanks,

Villyee

5 Replies
sunny_talwar

What is your expression you are using? I am afraid you are providing too little information to be able to offer any help you. Can you elaborate and may be provide a sample?

avinashelite

could you please elaborate your requirement and share some sample data and outputs so that it will be helpful for us to understand 

vanderson009
Creator III
Creator III
Author

Hi Sunny,

Because of some limitations I am not able to upload actual data, however I have created dummy data as below

I have created date field which is having date from Apr 2016 to Sep 2015, now I want current vs previous quarter value but if I select Q1 of 2016 then previous quarter should be Q4 from 2015.

   

ProductSalesDate
AAA2094/14/2016
BBB1094/12/2016
CCC3923/2/2016
DDD2313/23/2016
EEE1233/12/2016
AAA3643/25/2016
BBB6342/14/2016
CCC2452/12/2016
DDD5631/2/2016
EEE2311/23/2016
AAA1231/12/2016
BBB36412/25/2015
CCC36412/14/2015
DDD63412/12/2015
EEE24511/2/2015
AAA56311/23/2015
BBB12311/12/2015
CCC36410/25/2015
DDD36410/14/2015
EEE6349/12/2015
AAA2459/2/2015
BBB5639/23/2015
CCC3649/12/2015
DDD6349/25/2015
EEE245

2/14/2016

sunny_talwar

Check out the attached approach

Table:

LOAD Product,

     Sales,

     Date,

     Dual('Q' & Ceil(Month(Date)/3) & Year(Date), QuarterStart(Date)) as Quarter

FROM

[https://community.qlik.com/thread/214569]

(html, codepage is 1252, embedded labels, table is @1);

Link:

LOAD DISTINCT Quarter as ReportQuarter,

  Quarter,

  'CQ' as Flag

Resident Table;

Concatenate (Link)

LOAD DISTINCT Quarter as ReportQuarter,

  AddMonths(Quarter, -3) as Quarter,

  'PQ' as Flag

Resident Table;

Capture.PNG

avinashelite