Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggr to sum over rows

Hi,

I'm trying to use aggr to sum rows over two dimensions, however it's returning the expression total and not the sum of the rows. I cannot change the 'total mode' to 'sum of rows' as it won't work for my application, I need to do this with an aggr function, but am unable to do so.

Screen shot below illustrates issue:

Screen Shot 2014-07-30 at 11.52.19.png

I need to return 103.87 for each record in dim1 and dim2. When I try this with an aggr, it returns the quotient evaluated over the sum of the records in the aggr, 38.006, whereas I need the sum 103.87. The expression for sumrpc is:

sum(aggr(NODISTINCT
sum(rev)/sum(visits)
,
dim1,dim2))

I've attached a sample, any help is welcome.

Thanks,

Matt

1 Solution

Accepted Solutions
maxgro
MVP
MVP

not sure to understand, try

sum(total <dim1,dim2> aggr(sum(rev)/sum(visits),dim1,dim2,dim3))

View solution in original post

2 Replies
maxgro
MVP
MVP

not sure to understand, try

sum(total <dim1,dim2> aggr(sum(rev)/sum(visits),dim1,dim2,dim3))

Not applicable
Author

Great work!!!