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

Comparing and expression in another dimension.

I am new to Qlikview and I'm trying to creat a comparison between two years for units and revenue.  I'm sure it's pretty easy, but I'm still trying to learn the ins and outs of the software.  I have 3 dimensions in a pivot table with two of them on the left (Category,Type) and one at the top (Year) with units and revenue for my expressions.  I want to compare my units to the previous year as a number and as a percentage as well as comparing the revenue.  Below is roughly how I want the pivot table to look.  How would I create the comparison that I desire?



20122013Change from 20122013 Change from 2012
CategoryTypeUnitsRevenueUnitsUnitsRevenueRevenue
LowerMini5103-26-4
UpperSingle10301554515
CompSeason10010075-2575-25
MidGroup150300100-50200-100
1 Solution

Accepted Solutions
swuehl
MVP
MVP

QlikView will evaluate your expression for each dimension value, so if you have a year dimension with values 2012 and 2013, QV will use the same expression columns for both years. But to give you a start, try

=sum(Units)

[or count(Units), depending on how your data is defined, how you modelled Units]

=sum(Revenue)

=sum(Units)-before(sum(Units))

=sum(Revenue)-before(sum(Revenue))

before() is a chart inter record function (check the Help for more), that retrieves the expression value as evaluated in the dimension context to the left from the current dimension value.

View solution in original post

2 Replies
swuehl
MVP
MVP

QlikView will evaluate your expression for each dimension value, so if you have a year dimension with values 2012 and 2013, QV will use the same expression columns for both years. But to give you a start, try

=sum(Units)

[or count(Units), depending on how your data is defined, how you modelled Units]

=sum(Revenue)

=sum(Units)-before(sum(Units))

=sum(Revenue)-before(sum(Revenue))

before() is a chart inter record function (check the Help for more), that retrieves the expression value as evaluated in the dimension context to the left from the current dimension value.

Not applicable
Author

That worked... Easy enough.  I thought it had something to do with the "before" function, but couldn't figure it out.

Next step... Is there a way to hide or get rid of one of the columns that don't have anything before it and therefore it will show 0s all the way down? 

Also, is there way that I can get the units and revenue next to each other?  This is similar to putting the values above a column header in an excel pivot table?