+ Reply to Thread
Results 1 to 6 of 6

Pivot table - filtering a field in source table isn't giving expected results in pivot tbl

  1. #1
    Registered User
    Join Date
    03-06-2019
    Location
    Australia
    MS-Off Ver
    macosx
    Posts
    8

    Pivot table - filtering a field in source table isn't giving expected results in pivot tbl

    I have created a table and pivot table - see attached file. I'm using windows, excel 2016.

    When I have the entire table selected (unfiltered), the pivot table provides what I expect, i.e. a breakdown of the table by 'Type', counting the number of each 'Type'. However, when I filter the table by "helper patient number" (column 1) by those starting with PC or PN, I want the pivot table to summarise the filtered information, i.e. for patient numbers beginning with PN, I want to see:

    row
    label Count
    2 1
    3 2
    6 1
    16 1

    Instead I get quite different results as you'll see. I've obviously misinterpreted how pivot tables work. How do I create the pivot table to provide me what I want please? Or, is there a better solution? Thank you.
    Attached Files Attached Files
    Last edited by sharbie; 06-30-2019 at 06:23 AM. Reason: update comp/version details

  2. #2
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Pivot table - filtering a field in source table isn't giving expected results in pivot

    You need to filter in the pivottable and not in the datatable.
    Filters on data table are not carried over to the pivot

  3. #3
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483
    See attchment with my reply..
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-06-2019
    Location
    Australia
    MS-Off Ver
    macosx
    Posts
    8

    Re: Pivot table - filtering a field in source table isn't giving expected results in pivot

    Thanks Roel, actually I can't see any changes in the table you sent back to me. But thanks to your explanation, I added a second "row" field to the first column in the pivot table, namely "helper patient number', set below the 'type' row and if I sort by 'helper patient number' (PC patients only) in the first column of the pivot table it works perfectly. Thanks heaps!

  5. #5
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Pivot table - filtering a field in source table isn't giving expected results in pivot

    Great that it worked. I see I re-uploaded your original file instead of my version with changes..

    so better late then never the right version..
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    03-06-2019
    Location
    Australia
    MS-Off Ver
    macosx
    Posts
    8

    Re: Pivot table - filtering a field in source table isn't giving expected results in pivot

    Gotcha. Thanks - I'm glad you sent your solution through. Learnt something new!

+ 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. Pivot Table - Duplicated Values Giving Inaccurate Results
    By Peaceofcake in forum Excel General
    Replies: 2
    Last Post: 01-30-2017, 12:36 PM
  2. Pivot table giving wrong results?
    By domgilberto in forum Excel General
    Replies: 1
    Last Post: 10-22-2014, 11:08 AM
  3. [SOLVED] Pivot Table formula giving incorrect results
    By some_evil in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-20-2014, 06:30 PM
  4. Replies: 0
    Last Post: 02-18-2013, 03:50 PM
  5. Pivot Table VBA - Data Field - Original (source) field name
    By hbgpausa0 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-22-2008, 10:25 AM
  6. [SOLVED] Field Source Error for Pivot Table
    By JM in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  7. Pivot Table - Filtering Page Field
    By R. G. Ingersoll in forum Excel General
    Replies: 1
    Last Post: 01-29-2005, 04:06 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