+ Reply to Thread
Results 1 to 11 of 11

Pivot - Slow calculated items

  1. #1
    Registered User
    Join Date
    10-12-2012
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2010
    Posts
    5

    Pivot - Slow calculated items

    Hi,

    I have a very big database (around 100k entries) that shows on a pivot table.
    I wish to add very simple calculated items to that pivot, sum items in different categories (collumns in the db) to create new categories. But when those calculated items are added, doing anything with the pivot gets very very slow or hangs excel (say, adding a filter or removing a field).
    The calculations themselves are not complicated, because if I just do them by hand, outside the pivot, it does not get slowed down at all. But, of course, I lose all the flexibility the pivot table gives me.
    Do you have any pointers on how to make it run faster or on different ways of doing it?

    Thanks

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Pivot - Slow calculated items

    would it be possible to do those calcs inside your db? and then just use the answers in te PT?

    edit: i know you said you have a large DB, but when you set up the PT, did you use entire columms, ie A:G, for the range, or did you specify the range, ie A50000:G50000?

    using entire columns will definitely slow things down
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    10-12-2012
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Pivot - Slow calculated items

    Using less data would help, but I have to use the entire db as all data there is important

    My DB is shaped like this:

    Category Value Other Cols
    A 1
    B 2
    B 4
    A 7

    And what I want to do is create a third category (C), that would be A+3*B.
    There are several other cols involved that add complexity to the problem (hence using a PT to analyse it).

    that's why I don't think I can do the calc inside the DB, because I'd have to set up a VBA code for that which would add even more entries to the bank. Or maybe I can and just don't know how?

    Thanks

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Pivot - Slow calculated items

    you could maybe add a helper column inside your DB that would do that calc for you, and then just pull that into the PT where you need it?

  5. #5
    Registered User
    Join Date
    10-12-2012
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Pivot - Slow calculated items

    How would that be done in the DB format example I posted? The values I want to work with are in several different rows.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Pivot - Slow calculated items

    based on your example (which is a little confusing to me lol) what would your expected outcome be?

    could you upload a sample workbook please, showing what data you have, what your expect, and how you arrived at your answer?

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.

  7. #7
    Registered User
    Join Date
    10-12-2012
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Pivot - Slow calculated items

    I have attached an example to clarify what I'm saying.
    The data tab represents what I have in my DB (input), the pivot is what I would like to see (outcome), and the formulas there show the calculations that would be done.

    For this small dataset there are no problems at all adding stuff like a filter by the "year" field or anything. But with more data, that would be highly impractical because of the calculated fields.

    MWE_slow_pivot.xlsx

    Thanks!

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Pivot - Slow calculated items

    i have put together 2 alternative tables for you, not using PT. take a look at them and let me know if this is something that will work for you?

    I see the pickle you have with including the calc into your data table. i will play around with that some more while you look at the attached
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-12-2012
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Pivot - Slow calculated items

    You are kind of doing a pivot table by hand there hehe
    I don't think that would work tho, since others tend to poke around with the shape of the pivot, not just with the filters. Like, adding other cols for side-by-side comparisons and stuff.
    Thanks for the help though I really appreciate it.
    If you have any other ideas let me know :D

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Pivot - Slow calculated items

    i have been trying to figure out how to apply your factors to your data sheet. i created the range shown below, called "adjustment" and used this to find the values - =C2*VLOOKUP(D2,ADJUSTMENT,2,FALSE)

    A 10%
    B 80%
    C 90% 5%
    D 90%

    try playing around with that and see of you can come up with something?

  11. #11
    Registered User
    Join Date
    05-30-2014
    Posts
    1

    Re: Pivot - Slow calculated items

    Krones/Anyone else, did you ever find a solution to speed up the calculated items? I am currently having a similar issue with them

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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