Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

difference on expression in a pivot table

Hi all,

i have a pivot table with one dimension (two value) and several expression calculated on it.

now i want to calculate the difference between the two expression on a third column...

dimension value 1dimension value 2-
expression135-2
expression2806713

do you think it's possible?

thanks in advance, Loris

1 Solution

Accepted Solutions
Not applicable
Author

I achieved the result in this way:

= if(IsNull(year),before($(pf_immo1),2)-Before($(pf_immo1),1),$(pf_immo1))

i also have to check "show all value" in the options of year dimension

so when it is null it shows the difference between the two value

maybe not so clear but it works!!

View solution in original post

4 Replies
Not applicable
Author

Create a new expression:

Dimension value 1 - dimension value 2

boorgura
Specialist
Specialist

I believe it should be a new expression "expression1 - expression2", expression1 and expression2 should be the label names!

PradeepReddy
Specialist II
Specialist II

I am not clear about the labels i.e dimensions and expressions that you mentioned.

We can achieve this using Before()  function.

Before(Sum(Field_A),1)-Before(Sum(Field_B),2)

Not applicable
Author

I achieved the result in this way:

= if(IsNull(year),before($(pf_immo1),2)-Before($(pf_immo1),1),$(pf_immo1))

i also have to check "show all value" in the options of year dimension

so when it is null it shows the difference between the two value

maybe not so clear but it works!!