+ Reply to Thread
Results 1 to 27 of 27

Pivot Tables using multiple tables as a source

  1. #1
    Registered User
    Join Date
    07-30-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    26

    Pivot Tables using multiple tables as a source

    I'd really appreciate if someone could help me with this, I have spent quite a bit of time looking on other forums, but haven't manage to find the answer.

    Basically I want to use the basic pivot table function in Excel 2010, but rather than select the data form one table, I would like it to select it from multiple tables that all have the same headings.

    I have four tables with the following headings, and basically I want the pivot table to regard the information in them as one long "table" of information.

    Date Ref Account Description Gross VAT Net

    I have tried populating a separate work sheet with all of the information from the other four tables, however, this is quite a clumsy way of doing. It means that if and of the information in the four tables is moved about, the new worksheet gets muddled up. It also means that I have to limit the length of the other four tables.

    I have also tried using Excel's consolidate function, but I haven't managed to get this to work how I would like it to.

    Once I have the Pivot table referencing all the data; I intend to filter the pivot table by the "Account" column; set the row labels as "Ref", followed by "Description"; and set the "sum of values" to the sum of the "net" column.

    Thanks in advance to anyone who can help.

    Regards

    Chris

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Pivot Tables using multiple tables as a source

    Hi,

    I'm not quite sure why, in Excel 2007 and later, the Pivot Table Wizard feature has to be custom-added to the ribbon, but anyway, if you haven't done so already I suggest you do so and use the Multiple Consolidation Ranges option.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    07-30-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Pivot Tables using multiple tables as a source

    Hi XOR LX,

    Thanks for your help.

    I have tried this before as well, however the Pivot table doesn't retain the data fields of: -
    Date Ref Account Description Gross VAT Net

    Instead it uncomprehendingly (to me) creates four new fields: -
    Row Column Value Page1

    Row has the "Accounts" information in
    Column has a mix of data in
    Page1 has Item1, Item2, Item3 and Item4 in - no idea what they are
    Value has all information except "Accounts"

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Pivot Tables using multiple tables as a source

    Hi,

    In that case I'd need to see an actual workbook to investigate.

    Obviously replace any confidential/sensitive information with dummy data if necessary.

    Regards

  5. #5
    Registered User
    Join Date
    07-30-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Pivot Tables using multiple tables as a source

    That would be great. I have uploaded the file to http://www.megafileupload.com/en/fil...bles-xlsx.html

    The four tables the data will be entered on in Journals, bank receipts, bank payments and sales. The Data test sheet is where I have tried manually consolidating the four tables, however this is quite clumsy. The Multiple Consolidated Ranges sheet is where I have tried your first suggestions. The rest of the sheets I am hoping will be generated using Pivot Tables.

    Thanks again

    Chris

  6. #6
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Pivot Tables using multiple tables as a source

    Pivot tables from consolidation are not same as regular pivot tables and do not allow same options. I think it will be better to use one sheet or code to create recordset for pivot table.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  7. #7
    Registered User
    Join Date
    07-30-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Pivot Tables using multiple tables as a source

    Thanks Izandol.

    The problem is I only want certain data to be entered on certain sheets. I don't have any knowledge on how to code a record set, will want I am trying to do be possible? It doesn't seem as though I am expecting that much out ok Excel!

    Chris

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Pivot Tables using multiple tables as a source

    Thanks.

    Two things:

    Firstly, you did not include the header row when you defined each of the consolidated ranges (how do you expect Excel to know which fields to combine with which?)

    Secondly, it looks as if you chose the Create a single page field for me option in Step 2a, which is incorrect in your case.

    Try amending these two things - or perhaps delete the existing Pivot and start from scratch - and let me know how you get on.

    Regards

  9. #9
    Registered User
    Join Date
    07-30-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Pivot Tables using multiple tables as a source

    Thanks. I have played about with the wizard quite a bit, trying with and without the header row, and using and not using the Create a single page field for me option, without any success.

    I have just tried without using the Create a single page field for me option, and with the header row, and I am still not getting what I am looking for . When not using the Create a single page field for me option the wizard does mention selecting the number of fields I would like, but there is only a maximum of 4 allowed, and I don't seem to be able to select any data for these fields.

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Pivot Tables using multiple tables as a source

    Hi,

    See the attached.

    I don't know if that's what you were after, but in any case I'm not quite sure what you are trying to achieve here.

    For example, I'm not certain what you would expect the result of "consolidated" Date fields to be, nor "consolidated" Descriptions. Numericals of course are fine, and this is the precise point of this feature.

    Or perhaps you did not intend to consolidate at all, but rather hoped to "stack" the data on top of each other into a single table?

    Regards
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    07-30-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Pivot Tables using multiple tables as a source

    Thanks for this. What I'm after I think is only shown on the "Sales 60.10" tab. The pivot table is only showing data with for the items with "Sales" in the accounts column. The rows of the table are first grouped by the "Ref" column, and then by the "Description" Column. The only column in addition to the row's description is the "Sum of Net" column, which shows the sum of all items with the same "Ref" and "Description.

    I am hoping to "stack" the data on top of each other into a single table. Is this possible?

    Thanks for all you help

    Chris

  12. #12
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Pivot Tables using multiple tables as a source

    I'm sorry but I can't understand what you require.

    Perhaps you could re-attach your workbook with a table, manually created by hand, which you would like to see automated, together with explanations as to where each field is to be drawn from and expected totals manually entered?

    Regards

  13. #13
    Registered User
    Join Date
    07-30-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Pivot Tables using multiple tables as a source

    Hi XOR LX

    Sorry I haven't replied sooner. Here is a more stripped down version of what I would like:

    TEST HA WP V2.xlsx

    I want to enter the data in the "tables" on sheets "Journals", "Bank Receipts", "Bank Payments" and "Sales Day Book", and I want to generate a standard Pivot table from this data. All of the "tables" on the separate sheets have the same column headers. I want the fields of the Pivot table to be the headers of the columns of the "tables". I can get this to work if I just set the pivot table to generate from one table, however, I don't seem to be able to get this to work for all of the data in all 4 tables.

    In the "Data Test" sheet I have manually "stacked" all of the data from the 4 separate tables, and then on the "Sales" sheet I have generated the pivot table I ultimately want to produce. This is quite a clumsy way of doing. It means that if and of the information in the four tables is moved about, the data on the "Data Test" sheet would get muddled up. It also means that I have to limit the length of the other four tables.

    Thanks again for your help

    Regards

    Chris

  14. #14
    Registered User
    Join Date
    07-30-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Pivot Tables using multiple tables as a source

    Would anyone be able to help me with this?

    Thanks

    Chris

  15. #15
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Pivot Tables using multiple tables as a source

    Hi Chris,

    Apologies, but I'm really struggling to think of a way to help you with your desired output, principally as I find your initial data layout to be quite problematic to say the least.

    Why, for example, are you unable to have all this data in one tab initially? Since the headers for each are identical, you could simply add an extra column to indicate whether the row related to a payment, receipt, etc.

    if you still wished to output data to separate tabs for e.g. reporting purposes then that could be achieved quite easily. But the point is that analysis would become much easier if you were to arrange it this way.

    Apologies, but in my experience I'm always slightly puzzled by set-ups which consist of multiple tabs, if it can be avoided. (A prime example that I often see on this forum is the one-tab-to-each-day-of-the-month approach.) If you're not able (or unwilling) to change your current layout, then I'm afraid I'm not sure I'll be able to help you further, though I trust that someone else will pick up on this thread who may be able to.

    Regards

  16. #16
    Registered User
    Join Date
    09-24-2013
    Location
    Twin Cities, MN
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Pivot Tables using multiple tables as a source

    Is there a reason you are not using the free PowerPivot add-in? It is purpose made to do what you want.

  17. #17
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Pivot Tables using multiple tables as a source

    Please explain this comment - it appears to make no sense. PowerPivot is not related to consolidation ranges in any way.

  18. #18
    Registered User
    Join Date
    09-24-2013
    Location
    Twin Cities, MN
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Pivot Tables using multiple tables as a source

    I don't have the time to do this, but you can create linked tables in PowerPivot from your data, create a lookup table to allow relationship to be formed and then create a single pivot table with data from all of the tables combined.

  19. #19
    Registered User
    Join Date
    07-30-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Pivot Tables using multiple tables as a source

    Hi XOR,

    Thanks for getting back to me, and sorry I have taken so long to respond. The tables need to be on separate sheets as there will be additional columns on the separate sheet, with the extra columns on the different sheets all being different. Each of the separate sheets will also be printed off and used in their own right.

    Thank you for the recommendation minnesotaart, I'll look into it!

  20. #20
    Registered User
    Join Date
    07-30-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Pivot Tables using multiple tables as a source

    I have had a play around with PowerPivot, and I haven't been able to see how I can get it stack/consolidate the 4 tables.

    Any help on getting Excel to stack/consolidate the 4 tables would be really appreciated.

    Thanks

    Chris

  21. #21
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Pivot Tables using multiple tables as a source

    PowerPivot has nothing to do with consolidating data like this - that's more what Power Query does. You could use code to create a record set and assign it to the pivot table. Not ideal, but nor is the data so it may be the best option.
    Remember what the dormouse said
    Feed your head

  22. #22
    Registered User
    Join Date
    02-12-2014
    Location
    Queensland
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Pivot Tables using multiple tables as a source

    Powerpivot wont really help with what you are trying to achieve. The only thing I can think of is to have a macro that consolidates the data into a separate table and use that as the pivot table data source. If you would like to retain the pivot table (and not recreate it each time you want to update it), perhaps you could write the macro as an ad hoc data refresher.

  23. #23
    Registered User
    Join Date
    07-30-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Pivot Tables using multiple tables as a source

    Thanks Matlennon

    Would this be as relatively basic macro to write, and is there anywhere you would recommend to go to learn how to write basic macros?

    Thanks

    Chris

  24. #24
    Registered User
    Join Date
    07-30-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Pivot Tables using multiple tables as a source

    Can anyone help with this?

    Thanks

    Chris

  25. #25
    Registered User
    Join Date
    07-30-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Pivot Tables using multiple tables as a source

    Can anyone help with this?

    Thanks

    Chris

  26. #26
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Pivot Tables using multiple tables as a source


  27. #27
    Registered User
    Join Date
    07-30-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Pivot Tables using multiple tables as a source

    Thanks for the link

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Change Pivot Source Data in multiple pivot tables
    By jacol in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 05-20-2014, 06:18 AM
  2. Multiple Pivot Tables, Same Data Source
    By joshbd in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-10-2014, 12:00 AM
  3. Changing Source Data of Multiple Pivot Tables
    By mlegge04 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-20-2012, 04:26 PM
  4. Replies: 3
    Last Post: 02-27-2012, 08:03 PM
  5. Change multiple pivot tables data source..
    By benclayes in forum Excel General
    Replies: 3
    Last Post: 11-06-2010, 12:46 PM

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