Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

sofiavaz
Contributor

Aggr function

Hi all,

I'm trying to calculate de % of transfers by status per market and mill.

In order to do that, i've drawn a pivot table and, so far, i've only been able to aggregate my function per market... Can you help doing it also by mill? (The sum per mill and market has to be 100%)

My current expression is this one:

=count(AllocTransfAllocTransfId) /aggr(NODISTINCT count(AllocTransfAllocTransfId),AllocTransfOrigMktDescrip)

Thanks!

1 Solution

Accepted Solutions
brunobertels
Valued Contributor

Re: Aggr function

Hi

Try to add Mill as second dimension to group by in your agrr function


=count(AllocTransfAllocTransfId) /aggr(NODISTINCT count(AllocTransfAllocTransfId),AllocTransfOrigMktDescrip,mill)

4 Replies
OmarBenSalem
Esteemed Contributor

Re: Aggr function

u wanto to have % of APPROV CANCED AND REJECT based on ATF for example?

I mean ATF represents 100% in this case?

Capture.PNG

Try; sum(YourMeasure) / sum( total <YourDimension> YourMeasure)

while YourDimension is the one that contains ATF, FIG, SET etc

brunobertels
Valued Contributor

Re: Aggr function

Hi

Try to add Mill as second dimension to group by in your agrr function


=count(AllocTransfAllocTransfId) /aggr(NODISTINCT count(AllocTransfAllocTransfId),AllocTransfOrigMktDescrip,mill)

sofiavaz
Contributor

Re: Aggr function

Thank you Bruno Bertels. It's working! I thought I could only use aggr function for 2 fields/dimensions.

brunobertels
Valued Contributor

Re: Aggr function

Hi

i'am glad it works

remember that in your pivot table, if you add dimension then your aggr function should be updated with this new dimension

Bruno

Community Browser