Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot Table: Sum in Rows but fabs (absolut values) in the columns all

Hallo,

I do have a pivot Table in QlikView like this (i just faked it in Excel for data privacy & for an easier understanding):

pivot Table - Figur 1.png

     => This should be the final result!

With one Fact (Expression) “CurrencyValue” and the Dimensions (Date, Name, Currency and Timeline (0-3m, 3-6M and 6-12m))

Now here is what I would like to have:

In the Red rectangle section:

            The sum() of all Elements from the timeline regarding the Currency.

In the green rectangle section:

            Just nulls. No Sum at all.

In the orange rectangle section:

            Here it comes. The added absolute values (sum(fabs()))  from all grey Elements in column D except the Currency ‘ZZZ’.

The last one is kind of tricky because I would like to have the sum() of the values of D.

Here is what I got so far:

(in the Expression Tab of the Pivot Table under Definition for the fact “CurrencyValue”)

if(Dimensionality() = 3, Sum(CurrencyValue),
if(SecondaryDimensionality() = 1, null(), sum(fabs(CurrencyValue) - if(Currency = 'ZZZ', fabs(CurrencyValue), 0)))
)

The problem is that I get following table:

pivot Table - Figur 2.png

     => I got so far.

The problem lies in the orange rectangle section. I just get sum(fabs()) from all values not just the values from the blue box.

Does anybody know how to solve this issue to get the a pivot table like the first above?

Any help is appreciated,

Markus

0 Replies