Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

Calculated Rows in a Pivot Table

Hello QV Community;

Need some help, appreciate your feedback.

In attached sample table(just a sample table, in actual there are millions of records)I have a pivot table that looks likes this:
Current Table

currenttable.gif

but would like to have a modified table as below (by adding Gross Margin & Operating Margin rows):

modifiedtable.gif


1 Solution

Accepted Solutions
MVP
MVP

Re: Calculated Rows in a Pivot Table

Here is a rather crude way of solving it for your specific purpose:

2015-09-20 #3.png

7 Replies

Re: Calculated Rows in a Pivot Table

I suggest you creates those rows additionally within the script (you could simple add this rows per concatenate to the original table from a small inline-table) and adds another field which containes 1 for positive values and -1 for negative values and then you could use something like this:

if(Class = 'Gross Margin', sum({ < Class = {'Sales', 'Cos'}>} Value * PosNegFlag), sum(Value))

- Marcus

Not applicable

Re: Calculated Rows in a Pivot Table

Hello Marcus:

Thanks for your response and for your time much appreciated, I applied your suggestion to the model and

was not able to get it to work, would it be possible for you to look at it and kindly let me know where I am wrong

thanks once again,

(I have attached the model with the suggested modification for your review)

MVP
MVP

Re: Calculated Rows in a Pivot Table

Here is a rather crude way of solving it for your specific purpose:

2015-09-20 #3.png

Not applicable

Re: Calculated Rows in a Pivot Table

Modify your expression:

Margins.PNG

Re: Calculated Rows in a Pivot Table

Have a look on the solution from petter-s - I like it.

- Marcus

Not applicable

Re: Calculated Rows in a Pivot Table

Thanks Peter, appreciate for the solution

Not applicable

Re: Calculated Rows in a Pivot Table

Thanks Changuk Bak.

Community Browser