+ Reply to Thread
Results 1 to 10 of 10

Pivot table filter required

  1. #1
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Pivot table filter required

    Hi,

    I am having problems populating a series of pivot reports and I want to know if I need to rearrange my data – and how.

    What I need is a pivot report which has:

    Filters: Division/SOS Managed/Business Unit and DATE. The date is the one I can not currently get. What I would like is a drop down box that would allow me to select an individual week, a number of weeks, a month etc.

    The data it would then need to bring in is the range on the data sheet H3:CG12

    Can anyone help?

    I then need a separate table with the top 10 and bottom 10. Would this be two separated tables linked with a slicer?
    Attached Files Attached Files

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Pivot table filter required

    Before I look at this properly, can you just confirm which version of Excel you are using? Your file is saved in 2003 format, your profile says 2007, but you talk about using slicers (which are only in 2010 onwards)...
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Pivot table filter required

    Hi,

    I am on 2010 - I will update my info now...

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Pivot table filter required

    Okay.

    To use date as a pivot filter, you need to restructure your source data, so that Date is a single column. If you also want to filter on Week numbers, you'll have to add that as a separate column.

    So your source data would look like:
    A
    B
    C
    D
    E
    F
    G
    H
    I
    1
    Profit Centre Division SOS Managed Profit Centre Name User Group Business Unit Date Week Value
    2
    1010001
    CG No Profit Centre 1 80837-DEF BU 5
    01/07/2013
    27
    4
    3
    1010001
    CG No Profit Centre 1 80837-DEF BU 5
    08/07/2013
    28
    9
    4
    1010001
    CG No Profit Centre 1 80837-DEF BU 5
    15/07/2013
    29
    7

    etc

    Then you can add Date as a filter field in your pivot table (You could group by Year / Month / Day), and Week as another filter field.

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Pivot table filter required

    I've transformed your data, and built an example pivot table. See attachment.
    Attached Files Attached Files

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Pivot table filter required

    Just rereading your original requirement - yes, for top 10 and bottom 10, two pivot tables with slicers linked to both for the filter fields would be a good option. Shout out if you need help putting that together

  7. #7
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Pivot table filter required

    Many thanks Olly for the help on this.

    Can I ask is there a quick way to rearrange the data, pill paste special transpose or something similar work?

    The reason I ask is because my real data has over 200 profit centres (the example has 10)

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Pivot table filter required

    You're welcome.

    Sort of. I blogged about this a little while ago - see: http://excel.solutions/2014/03/unpivot-excel-data/

    In your case, you have multiple dimension columns associated with each row. So to 'unpivot' your data, I inserted a column, and added an index number for each data row. I unpivoted, using the technique in my link above. Then reinserted your extra columns, and retrieved the initial values based on the index number. Took about 5 minutes to transform the data, another couple to build the sample pivot.

    It's getting late on Friday evening now - but if you want a step by step guide to how to do this, let me know, and I'll put a guide together over the weekend Alternatively, if this is a one off exercise, feel free to ping me your actual dataset, and I'll transform it for you.

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Pivot table filter required

    Maybe this will help you. I have re-arranged your data and produced a Pivot Table. The data in yellow is redundant and maybe not necessary in your main data.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  10. #10
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Pivot table filter required

    Just to close the loop on this thread, here's a quick video tutorial on unpivotting crosstab data with multiple row fields.

    https://www.youtube.com/watch?v=CqzvKifTdyI

+ 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. Replies: 6
    Last Post: 07-31-2014, 12:56 PM
  2. [SOLVED] How to set a 'Date Filter' on a field in the 'Report Filter' section of a Pivot Table?
    By Rhino_dance in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 03-28-2013, 11:01 AM
  3. Pivot table, assigning a cell wo be change the Pivot table filter
    By jwongsf in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2012, 05:00 PM
  4. Pivot Report Filter help required
    By bonny24tycoon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-18-2012, 09:42 AM
  5. Change Pivot table Filter Based on Cell Value *Multiple Filter items* Possible?
    By Flydd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2012, 06:57 AM

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