Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

Calculated expression based on condition

Hi all, one question for you:

I can structure a cloud like this:
Index, Type (i=real data, c=to be calculated), Quantity
A, i, 100
A, i, 100
A, i, 100
B, i, 200
C, i, 300
ZZ, c, null
YY, c, null

Then I've a table with a structure like this:
Index, ComponentIndex, Sign
ZZ, A, +
ZZ, B, +
YY, A, +
YY, B, -
YY, C, -

Now I want to create a pivot table with:
DIMENSION = Index
EXPRESSION = $(VARIABLE_QTY) calculated in this way
- Sum of the Quantity when Type=i
- Sum or Minus of the ComponentIndex Quantity when Type=c

Do you know how can I create the VARIABLE_QTY to be used in the pivot table that would show this result?
A 300
B 200
C 300
YY 500
YY -200