Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a calculated field on a pivot table 1

Status
Not open for further replies.

DJWheezyWeez

Technical User
Jun 5, 2008
265
US
I'm trying to use an if statement to create a calculated field to use in a pivot table. The pivot table is grouped by a salesperson, customer, month, and product type then I have a sales and a year field to create a calculated field. I'm attempting to create a calculated field using =if(Year=2011, Sales, 0) to show sales if the year is 2011 (previous year sales) and do the same for 2012 to find the current year sales. When I drag the newly created field to the pivot table, it doesn't work as I thought it would. It looks like it's only looking at data on the first line when you drill down and look at the detail. I'm not sure if this is the right way to go about this or if it's even possible but I'm trying to avoid creating new columns in the details and including that in the pivot table.

Any suggestions? Thanks in advance!

-DJWW
 


hi,

Rather than creating calculated fields for each year, can you GROUP the dates by YEAR.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
No. I need the sales for both years to be on the same line since I have another calculated field (previously working) that finds the difference between the two. The more I look into this, the more I don't think what I want is possible without creating new columns in the details. I'm still hoping for a way around that :)
 
I need the sales for both years to be on the same line
So put the date in the COLUMN area of the PT.

I am not referring to "creating new columns in the details". This is PT stuff.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
That was surprisingly simple. Thanks. I must've just overlooked that part.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top