Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasmahajan

aggr calculation

Dear all

Please refer attachment of  jpg file showing sales with Region count in dimension now

I want to calculate sales but not using rmcount dimension ,

Using  AGGR how to calculate sales

RMRmcountsale
Total 49.60
BANGALORE - 1 ABM46.60
BANGALORE - 1 ABM11.58
BANGALORE - 2 ABM58.25
BANGALORE - 2 ABM13.97
BANGALORE - 3 ABM46.60
BANGALORE - 3 ABM13.31
BANGALORE - 4 ABM58.25
MYSORE ABM16.20
MYSORE ABM24.84

My formula is  

if( Rmcount > 1,

((SUM(INV_INVVAL)-SUM(SRN_INVVAL))/100000)*Rmcount,

(SUM({$<FinancialYear=,FiscalYear={$(=max(FiscalYear))},

[Posting Date]={">=$(=YearStart(max({$<FiscalYear={$(=max(FiscalYear))}>}[Posting Date]),0,4))<=$(=max({$<FiscalYear={$(=max(FiscalYear))}>}[Posting Date]))"}>}[Gross Sales Amount])

-

SUM({$<FinancialYear=,FiscalYear={$(=max(FiscalYear))},

[Posting Date]={">=$(=YearStart(max({$<FiscalYear={$(=max(FiscalYear))}>}[Posting Date]),0,4))<=$(=max({$<FiscalYear={$(=max(FiscalYear))}>}[Posting Date]))"}>}[Sales Return Amount])

)/100000

)

THANKS

VIKAS

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
1 Reply
vikasmahajan
Author

Resolved by using

Sum(aggr( sum(sales),dimensions))


// sum(aggr(if(expressoin2>1,sum(Venta * REBATE_NORMAL),0),dim1,dim2))

Thanks

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.