Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Totals problem in expression. Expression total versus sum of rows

Hi,

I'm calculation values in a expression column. In another column the result is alted by an IF function.

On total level this IF function does not work correctly. It should use the total headers of the expressions, not the line values.

I tried the option 'sum of rows' and expression totals, the results are different but not correct.

HOW IT SHOULD BE:

CustomerProductMaintenance 2009Maintenance 2010Retented SalesRetention rate
AX100000%
AY200270200100%
AZ100808080%
TOTAL A.40035028070%
BX2010020100%
BY20012012060%
TOTAL B.22022014064%

How Qlikview does it

CustomerProductMaintenance 2009Maintenance 2010Retented SalesRetention rate
AX100000%
AY200270200100%
AZ100808080%
TOTAL A.400350280180%USING SUM OF ROWS
BX2010020100%
BY20012012060%
TOTAL B.220220140100%USING EXPRESSION TOTAL

Retented sales: Sales which have occurred in 2010 as a follow up on 2009. No new sales

Please check enclosed excel file for the formulas of the example

Hope you can help me.

Kind regards,

Johan Vermeulen

K3 Business Solutions.

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

I think this is what you're looking for in the "Retented sales" column:

sum(aggr(rangemin(sum(Sales09),sum(Sales10)),Customer,Product))

View solution in original post

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Please upload the qvw file.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Did you see the Excel enclosure?

If you want I can upload it into QV, but probably not today.

Kind regards,

Johan.

brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi,

you have to use the function dimensionality() resp. secondarydimensionality(). Enter dimensionality() as a new dimension, than you can see, which value the partial sum has (0,1,2,...) And then you can enter an if-Statement like:

If(Dimensionality()=1, '1 partial sum',...)

SecondaryDimensionality() is for columns.

Greetings from Munich.

Not applicable
Author

Thanks for the hint.

I tried it, but without success.

Please check the uploaded qvw file.

Kind regards,

Johan.

johnw
Champion III
Champion III

I think this is what you're looking for in the "Retented sales" column:

sum(aggr(rangemin(sum(Sales09),sum(Sales10)),Customer,Product))

Not applicable
Author

Thanks John, you helped me out here.

Enjoy your weekend,

Johan.