Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show only last 4 quarters in pivot table

Hi All...

I have a pivot table which shows 8 quarters of data... i  need to show only last 4 quarters of data... i.e  from 2011Q4 to 2012Q3

Capture2.JPG

Please click on image to enlarge..

Thanks

2 Replies
Not applicable
Author

Hi,

Depending on your data model, you need to select your last 4 quarters.

You can do this in the following ways:

1. Use a flag in your data load to mark if your date is in the last 4 quarters.

      if(salesdate > addmonths(today(),-12) and salesdate < today(),1,0) AS SalesFlag

     you can then use Set analysis or the slower if to select your Quarters:

     SUM({<SalesFlag={1}>} Sales)

     SUM(SalesFlag * Sales)

     SUM(if(SalesFlag=1,Sales,0))

2. Use Set Analysis

http://www.qlikblog.at/1384/set-analysis-wizard-qlikview/

http://community.qlik.com/qlikviews/1062

3. Use Qlikview Components

http://code.google.com/p/qlikview-components/

Kind Regards,

Dion

Message was edited by: Dion Verbeke

jagan
Partner - Champion III
Partner - Champion III

Hi Ganesh,

Try this expression

2011Q4 - 2012Q3  = Sum({<BilledDate={'>=$(=QuarterStart(Max(BilledDate), -4))<=$(=QuarterEnd(Max(BilledDate), -1))}>} Sales)

Hope this helps you.

Regards,

Jagan.