+ Reply to Thread
Results 1 to 6 of 6

PIVOTTABLE: Calculated item causes incorrect row label.

Hybrid View

  1. #1
    Registered User
    Join Date
    08-24-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    13

    PIVOTTABLE: Calculated item causes incorrect row label.

    Hey!

    SOURCE DATA: I basically have agent names and their respective regions in columns as source data. For each agent there are records of value he has received or given throughout time. An agent can give or receive value. The amount of value is recorded in the "Value" column and next to it there is an "Event" column with only two possible states ('To' or 'From'). If an agent has received, the event is 'To', if an agent has given value, the event is 'From'.

    I am using a PivotTable to represent the data this way:

    ROW LABELS: Regions and the agents that belong to them are Row Labels (Regions on top of Agents)
    COLUMN LABELS: The event (To or From) is used as Column Label; value received is in Column1, value given is in Column2
    VALUES: Values received and given are summed under their respective columns against the names of their respective agents

    This way the table looks great, and everything is sorted perfectly.

    The problem comes when I create a Calculated item to subtract the "From" column from the "To" column to calculate the balance for each agent. Since the the two are items that belong to a single field, a new "To-From" item must be created. When the new item is added however, it causes all agent names to be displayed under all regions.

    In other words, the calculated item adds unnecessary and incorrect rows of data which do not correspond to source data.

    Please look at the attached workbook to see for yourself.

    CalcItemRowError.xlsx

    Am I doing something wrong or is this a bug?!
    Last edited by albatr0n; 08-29-2012 at 02:16 PM.

  2. #2
    Registered User
    Join Date
    08-24-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: PIVOTTABLE: Calculated item causes incorrect row label.

    Please, guys, can you at least confirm the error by testing a calculated item yourself?

    Thanks!

  3. #3
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: PIVOTTABLE: Calculated item causes incorrect row label.

    Hi,

    I'm a pivot table user on Excel 2000 and I'd suggest to avoid the use of calculated fields: my opinion.

    As far as I know it's not an error from you.

    I would calculate the difference out of the pivot table or add an helper column to your data and make it read to pivot table itself.


    Hope that helps
    Last edited by canapone; 08-30-2012 at 04:29 AM.
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: PIVOTTABLE: Calculated item causes incorrect row label.

    it's not a bug as such-just an annoying feature. add a new column to the table that makes your From values negative then simply add row totals-see attached file
    Attached Files Attached Files
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Registered User
    Join Date
    08-24-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: PIVOTTABLE: Calculated item causes incorrect row label.

    CANAPONE,

    I know I can do that in a separate column, but every time new data is added or the layout of the PivotTable changes, I will have to adjust the column accordingly. Unfortunately, that's not very practical, but thanks for your suggestion. It looks like Calculated Items are a pain in the *ss.

    Quote Originally Posted by JosephP View Post
    it's not a bug as such-just an annoying feature. add a new column to the table that makes your From values negative then simply add row totals-see attached file
    From what i can see in your example, adding a column with negative numbers will help avoid using Calculated items. This works, but I thought a PivotTable would handle this just fine without having to change the source data. I guess I was wrong.

    JP, are you aware of why Calculated Items present the data the way they do? Is there a particular reason they work differently from standard PivotTable items?

    Thanks.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: PIVOTTABLE: Calculated item causes incorrect row label.

    I don't know but would imagine it has to do with how the information is added to/stored in the pivotcache.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1