Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sub Totals in Pivot Table

Hi All

I have a requirement where I am using expressions for amount and sale as:

Amount:

Num(sum(aggr(avg(MRC11),[Account Number],[Description])) ,'$#,##0.00'),

Sale:

Num(Aggr(SUM(Net),[Account Number],[Description]) ,'€#,##0.00'),

If I am applying above expressions with aggr I am getting null values.Please help me with this.

ExpectedAmountActualAmountExpectedSaleActualSale
22221212
34341212
343422
Total=56Total=-Total=26Total=-
19 Replies
Anil_Babu_Samineni

May be use DISTINCT Keyword for this

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Can you please explain where can I use it in my expression

Num(Aggr(SUM(Net),[Account Number],[Description]) ,'€#,##0.00'),

vinieme12
Champion III
Champion III

Like this?? vanivadlamudi

aggr(avg.PNG

<<Modifications>>

SALES

=num(if(rowno()=0,Sum(aggr(avg(Sale),AccountNumber,Region)),sum(aggr(avg(Sale),AccountNumber,Desc))),'€ #,##0.00')

AMOUNT

=num(if(rowno()=0,Sum(aggr(avg(Amount),AccountNumber,Region)),sum(aggr(avg(Amount),AccountNumber,Desc))),'€ #,##0.00')

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

try this


Num(Aggr(distinct SUM(Net),[Account Number],[Description]) ,'€#,##0.00'),

Anonymous
Not applicable
Author

It was also not working

Anil_Babu_Samineni

Try simple Sum(DISTINCT Net)

And then check partial sum from presentation and then show me the image

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sasikanth
Master
Master

HI,

Try below Expression,

Num(Sum(AGGR(DISTINCT Sum(Net),[Account Number],Region,Country,City)),'€#,##0.00')

Anonymous
Not applicable
Author

Thank you Anil. It worked

but I used it like

Num(Sum(DISTINCT Aggr(SUM(Net),[Account Number],[Service Description]),'€#,##0.00')


qliki.PNG

sasikanth
Master
Master

I don`t think simple distinct SUM will work if you have same net value for another combination. ( Region, Country , City, Account Number ), do check once .

Region='SOUTH' county='India', city='Delhi', AccNo=1011 , Net =100

Region='SOUTH' county='Aus',  city='Sidny', AccNo=222 , Net =100


in this case SUM( distinct Net ) =100 instead of 200  ( as per my understanding)


Anonymous
Not applicable
Author

Ya Sasi

thats why I used AGGR function and I have mentioned it in my post