Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Experession Help

Hi All

I have a the below expression the calculate the sales for branches with a condition to except WEB sales for 7 branches

the values are coming correctly but the totals are not correct i have to use a Pivot table

if(Match(BRANCH,'0001','0021','0031','0041','0051','0061','0071'),

SUM(AGGR((Sum({<MONTH={'$(v1MonthYear)'},WEB-={1}>} SALE)/Sum({<MONTH={'$(v1MonthYear)'}>} WORKINGDAYS)),

BRANCH)),

SUM(AGGR(

(Sum({<MONTH={'$(v1MonthYear)'}>} SALE)/Sum({<MONTH={'$(v1MonthYear)'}>} WORKINGDAYS))

,AREA,BRANCH))

)

Please Suggest

1 Solution

Accepted Solutions
sunny_talwar

Try another Aggr()

Sum(Aggr(If(Match(BRANCH,'0001','0021','0031','0041','0051','0061','0071'),

SUM(AGGR((Sum({<MONTH={'$(v1MonthYear)'},WEB-={1}>} SALE)/Sum({<MONTH={'$(v1MonthYear)'}>} WORKINGDAYS)),

BRANCH)),

SUM(AGGR(

(Sum({<MONTH={'$(v1MonthYear)'}>} SALE)/Sum({<MONTH={'$(v1MonthYear)'}>} WORKINGDAYS))

,AREA,BRANCH))

), YourChartDimensions))

Also if this is in the straight table, make use of Total Mode rather than Aggr() function.

View solution in original post

3 Replies
sunny_talwar

Try another Aggr()

Sum(Aggr(If(Match(BRANCH,'0001','0021','0031','0041','0051','0061','0071'),

SUM(AGGR((Sum({<MONTH={'$(v1MonthYear)'},WEB-={1}>} SALE)/Sum({<MONTH={'$(v1MonthYear)'}>} WORKINGDAYS)),

BRANCH)),

SUM(AGGR(

(Sum({<MONTH={'$(v1MonthYear)'}>} SALE)/Sum({<MONTH={'$(v1MonthYear)'}>} WORKINGDAYS))

,AREA,BRANCH))

), YourChartDimensions))

Also if this is in the straight table, make use of Total Mode rather than Aggr() function.

Not applicable
Author

HI Sunny

Thanks it worked

Not applicable
Author

I believe, Partial sums simply sum the rows.