Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join “Do More With Qlik” with Mike Tarallo to get a first-hand look at the New Authoring Experience, June 29th: REGISTER HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
jdmarlin
Contributor III
Contributor III

Sum Aggr & Total

Hi everyone,

I'm trying to compare relative sales, but total sales doesn't seem to ignore any selections.

Sum(Aggr(Sales, Product, Country))

/

Sum({1} TOTAL Aggr(Sales, Product, Country))

3 Replies
johnw
Champion III
Champion III

Working from the inside out in the bottom "total" expression, you start with aggr(Sales, Product, Country). Sales here is interpreted as only(Sales), which is an aggregation expression, one to which you've applied no set analysis at all, and so the selections affect it. So at a minimum, change that part to aggr(only({1} Sales), Product, Country), though you may want to instead aggr(sum({1} Sales), Product, Country).

johnw
Champion III
Champion III

Assuming this is a chart with Product and Country as dimensions, though, perhaps simplify to something like this. I'm not sure why you're doing an aggr(). Pivot table, maybe?

sum(Sales)/sum({1} total Sales)

navaskhan
Contributor III
Contributor III

Try

Sum( Total <Sales, Product, Country> Sales  )