Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

mr_novice
Contributor II

Pivot table with set analysis?

Hello all!

I have a problem that I cant solve and hope you can give me a suggestion how to solve this

I have a pivot table with dimensions Category and YearMonth. Categories are displayed as rows and YearMonth as columns so for each category there are one expression per YearMonth.

Now, the expression is just a sum of TransactionAmount. This works fine. But now I want add one expression that calculates the delta between month's.

My first expression is Sum([Month Result]) and to create a delta between ie 201202 and 201201 I do this but it doesn't work:

sum([Month Result])

-

sum({$<[YearMonthCounter]={"=$(=[YearMonthCounter]-1)"}>}[Month Result])

I use "Yearmonthcounter" to avoid problems when its the first month of the year.

This is what I want to achieve:

Category    201201                201202                 201203       

                 Amount    Delta    Amount    Delta    Amount    Delta   

1               1000         0         500          -500      200         -300

2               200           0        1000         800       100         -900

Any suggestions?

Br

cristian

1 Solution

Accepted Solutions

Re: Pivot table with set analysis?

I'm sorry I meant BEFORE, so if Month is a dimension (on the x axis) you have

sum(Month Result) - Before(sum(Month Result))

4 Replies

Re: Pivot table with set analysis?

use keyword "PREVIOUS"

mr_novice
Contributor II

Re: Pivot table with set analysis?

Hmm you mean like this?

sum({$<[YearMonthCounter]={"=$(=previous([YearMonthCounter]))"}>}[Month Result])

alexandros17 wrote:

use keyword "PREVIOUS"

Re: Pivot table with set analysis?

I'm sorry I meant BEFORE, so if Month is a dimension (on the x axis) you have

sum(Month Result) - Before(sum(Month Result))

Highlighted
mr_novice
Contributor II

Re: Pivot table with set analysis?

Great. Thank you!

What about if I want to compare this new expression with the grand total of 'before sum(MonthResult))' like this:

sum(monthResult)-before(sum(monthResult)) / before(sum(TOTAL monthResult))...This does not work...

Br

cristian

Community Browser