Group:  Microsoft Excel ยป microsoft.public.excel
Thread: Subtotal a calculated field in a pivot table

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Subtotal a calculated field in a pivot table
nekendrick[ at ]gmail.com 25.08.2006 20:48:02
I'm creating a pivot table listing Accounts Receivable transactions by
customer. It includes both payments and invoices in the results.
Unfortunately both payments and invoices are listed as positive
numbers, so I can't just subtotal the "amount" column.

I've created a formula field in the pivot called "calcamt" that
contains an if statement. The if statement examines the transaction
type code and if it indicates a payment, multiplies the amount column
by -1. Otherwise it just returns the amount column as a positive
number.

When I drag the calcamt field into my pivot, I see the results as I
would expect to, payments as negative amounts and invoices as
positives. However, when I now subtotal this by customer, the subtotal
doesn't reflect the payments as negatives. So my detail shows:
Invoice1: $100
Invoice2: $150
Pmt1: -$100
Total: $350

Any ideas?

Re: Subtotal a calculated field in a pivot table
roy.patrice[ at ]uqam.ca 27.08.2006 12:21:02
I've got a crazy idea. Why not add a calculated field that's Pmt * -1
and add that to the pivot table instead. I think it would work. There's
a good example of what you can do on pivot tables and calculated fields
on http://youlearnexcel.com/pivot.htm#exltcdchampc

Hope this helps.

Pat

nekendrick[ at ]gmail.com wrote:
[Quoted Text]
> I'm creating a pivot table listing Accounts Receivable transactions by
> customer. It includes both payments and invoices in the results.
> Unfortunately both payments and invoices are listed as positive
> numbers, so I can't just subtotal the "amount" column.
>
> I've created a formula field in the pivot called "calcamt" that
> contains an if statement. The if statement examines the transaction
> type code and if it indicates a payment, multiplies the amount column
> by -1. Otherwise it just returns the amount column as a positive
> number.
>
> When I drag the calcamt field into my pivot, I see the results as I
> would expect to, payments as negative amounts and invoices as
> positives. However, when I now subtotal this by customer, the subtotal
> doesn't reflect the payments as negatives. So my detail shows:
> Invoice1: $100
> Invoice2: $150
> Pmt1: -$100
> Total: $350
>
> Any ideas?

Re: Subtotal a calculated field in a pivot table
nekendrick[ at ]gmail.com 28.08.2006 18:59:03
Thanks for the reply. I believe what you are suggesting is what I have
already done. I added a calculated field, with the formula:

=IF(RMDTYPAL=9,CURTRXAM*-1,CURTRXAM)

RMDTYPAL is the "type" field, where 1=invoice and 9=payment.
CURTRXAM is the amount of the transaction.

It calculates the calculated field correctly, I see positives and
negatives in the column, but when it totals that calculated field, it
treats all the results as if they were positive.


roy.patrice[ at ]uqam.ca wrote:
[Quoted Text]
> I've got a crazy idea. Why not add a calculated field that's Pmt * -1
> and add that to the pivot table instead. I think it would work. There's
> a good example of what you can do on pivot tables and calculated fields
> on http://youlearnexcel.com/pivot.htm#exltcdchampc
>
> Hope this helps.
>
> Pat

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net