Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Straight Table -> Total Mode -> Subtract ?

Hi guys,

In straight table, in Total Mode option -> For Addition there is SUM option but For Subtract what i need to select ?

Please help.

Thanks.

4 Replies
Gysbert_Wassenaar

Subtract is not an aggregation function. So it's not an option that can be used for the Total Mode. You'll have to find some other way to calculate what you want. Perhaps you can add a factor field ( with 1 and -1 values) to your fact table in the script. That way you can multiply the value with the factor and then sum the results.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Hi Girish,

You can use Dimensionality function to calculate your own formula on totals.

Dimensionality = 0 is the total value on straight table.

If(Dimensionality()=0, -Sum(1),Sum(1))

Regards!!

Not applicable
Author

Thanks for your reply.

Can you please explain how to use this function ?

Anonymous
Not applicable
Author

Hi Girish,

Total mode must be Expression Total, and your expressión must be like this:

     IF(Dimensionality() = 0, YourExpressionForTotalSusbtract, YourExpressionForSumOnEachDimensionValue)

Dimensionality function returns the number of dimension columns that have non-aggregation content. i.e. do not contain partial sums or collapsed aggregates.

A typical use is in attribute expressions, when you want to apply different cell formatting depending on aggregation level of data.

This function is only available in charts. For all chart types except pivot table it will return the number of dimensions in all rows except the total, which will be 0.

Regards!!