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

sum distinct aggregation

hi all

i have a case here

New Picture (2).bmp

as shown on the picture, i have a pivot table that show the totalDebt of companies's shareHolders of a group,

i use (sum([totalDebt])) to sum the debt of each shareHolder's debt, so the result is 51200 (with debt of holder2 & holder4 are totalled 2 times), no matter the holders are in a company or many (holder2 and holder4), but the desired result is 32100 (distinct per shareholder),

i've been trying to use this function as (Sum(Aggr(DISTINCT [PH],shareholder))), but the result seems wrong.

could anyone help me ?

thanks

1 Solution

Accepted Solutions
swuehl
MVP

Not 100% sure if this is what you need, are you looking for

=Sum(Aggr(DISTINCT ([OSPH Pemegang Saham]),Debitur, norek,nopin ))

?

View solution in original post

4 Replies
swuehl
MVP

Hi,

your problem seems very similar to that one I answered just recently:

http://community.qlik.com/message/225437

The idea is to use dimensionality() to check for calculation in total or details line and then use aggr() function with DISTINCT resp. NODISTINCT qualifier.

Hope this helps,

Stefan

Not applicable
Author

hi stefan,

thank you for your reference,

but still i can't figure out to use the dimensionality() function in this case,

i already attached the qlikview file and data sample ,

would u like to check the file?

thanks

swuehl
MVP

Not 100% sure if this is what you need, are you looking for

=Sum(Aggr(DISTINCT ([OSPH Pemegang Saham]),Debitur, norek,nopin ))

?

Not applicable
Author

thanks stefan,

yeah that's what i'm looking for