# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor II

## 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
Valued Contributor II

## 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
Partner

## 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?

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

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

Valued Contributor II

## 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)

Contributor II

## Re: Aggr function

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

Valued Contributor II

Hi