Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate % Change on Pivot Table

I've got a flat-file structured set of data that shows a bunch of orders, the year the order was placed, and the product type. I've provided an example below. Simplified for sake of discussion.

Order IDYearType
342162008Red
984322010Brown
102932009Brown
123452010Red
678902009Yellow
543212010Brown

Here is the table I want QlikView to produce. I've been able to accomplish this with a Pivot table except for the % change. How would I go about calculating the % change? I'm looking for solutions that either include an expression or hopefully without the pivot table altogether. Using something other than the flatfile with one single year column is not an option. Thank you in advance for your thoughts!

Type200820092010% Change
Red1010%
Brown012200%
Yellow0100%
3 Replies
hdonald
Creator
Creator

Hi,

An expression comparing min and max years for % change would be possible but simpler if rows were added for those years without any orders (see attached).

The idea of using the ColumnNo() to change the expression in the total of a pivot table would also be handy - as shown in this thread http://community.qlik.com/thread/11316. by Daniel Rozental.

If your Change % represents a kind of fact, like Revenue Change %, that you'd want to see if you only selected a single year, you could get the script to work out the change by using Peek() in the load, maybe to a summary table (see second attached for the basic idea).

A cumulative script using Peek() is shown here http://community.qlik.com/thread/31436 by swuehl.

Regards,

HD

SunilChauhan
Champion II
Champion II

see the attached file

hope this help

Sunil Chauhan
Not applicable
Author

Hi,

As u have 3 years(2008,09,10),with respect to which year u want the % change

opt1 2008 vs 2010

opt2   2009 vs 2010

opt3   2008 vs 2009

Thanks

vivek