+ Reply to Thread
Results 1 to 4 of 4

Access Pivot Table Hierarchy In Report Filter

Hybrid View

  1. #1
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,876

    Access Pivot Table Hierarchy In Report Filter

    Hi,

    Does anyone have any reading material on How to Access Pivot Table Hierarchy In Report Filter?

    This describes my problem pretty much.

    http://www.mrexcel.com/forum/excel-q...hierarchy.html

    Here is the one I posted earlier..

    http://www.excelforum.com/excel-char...ml#post4178022

    Can't seem to find any documentation on this problem at all what so ever..

    The Macro Recorder generates a code like this -

     ActiveSheet.PivotTables("PivotTable12").PivotFields( _
            "[TIME VIEW].[Date Hierarchy].[YEAR]").VisibleItemsList = Array("")
        ActiveSheet.PivotTables("PivotTable12").PivotFields( _
            "[TIME VIEW].[Date Hierarchy].[QUARTER]").VisibleItemsList = Array("")
        ActiveSheet.PivotTables("PivotTable12").PivotFields( _
            "[TIME VIEW].[Date Hierarchy].[MONTH]").VisibleItemsList = Array("")
        ActiveSheet.PivotTables("PivotTable12").PivotFields( _
            "[TIME VIEW].[Date Hierarchy].[WEEK]").VisibleItemsList = Array( _
            "[TIME VIEW].[Date Hierarchy].[WEEK].&[2013]&[1]&[1]", _
            "[TIME VIEW].[Date Hierarchy].[WEEK].&[2013]&[1]&[2]")
        ActiveSheet.PivotTables("PivotTable12").PivotFields( _
            "[TIME VIEW].[Date Hierarchy].[DAY]").VisibleItemsList = Array("")
    Last edited by NeedForExcel; 09-06-2015 at 09:25 AM.
    Cheers!
    Deep Dave

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Access Pivot Table Hierarchy In Report Filter

    It will makes it a lot easier if you show us, manualy typed the result in the file you posted in your earlier threat.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,876

    Re: Access Pivot Table Hierarchy In Report Filter

    Hi oeldere!

    Thank you for the reply.

    Can you tell me what exactly you want me to type in the Excel? I will do it..

    Also, see the file attached for the scenario. What I am trying to do is select a date from the Drop Down on Cell A2, and get all the Pivots to select the Date on the report filter.

    This code works perfectly..

    Sub UpdatePivot()
    
        Dim I, WS As Worksheet, PT As PivotTable
        
        For Each WS In ThisWorkbook.Worksheets
            For Each PT In WS.PivotTables
                With PT
                    For I = 1 To .PivotFields.Count
                        If .PivotFields(I).Orientation = 3 And .PivotFields(I).Caption = "InvoiceDate" Then
                            .PivotFields("InvoiceDate").ClearAllFilters
                            .PivotFields("InvoiceDate").CurrentPage = Sheets("Sheet1").Range("A2").Text
                        End If
                    Next
                End With
            Next PT
        Next WS
        
    End Sub
    However, my issue is, the Data is coming from a Cube, and the Report Filters show dates as a hirearchy, and which is where my code fails..

    So I though of using the Macro Recorder to see what it generates when I select only 2 entries (Week Numbers) from the Report Filter, and it generated this code -

    ActiveSheet.PivotTables("PivotTable12").PivotFields( _
            "[TIME VIEW].[Date Hierarchy].[YEAR]").VisibleItemsList = Array("")
        ActiveSheet.PivotTables("PivotTable12").PivotFields( _
            "[TIME VIEW].[Date Hierarchy].[QUARTER]").VisibleItemsList = Array("")
        ActiveSheet.PivotTables("PivotTable12").PivotFields( _
            "[TIME VIEW].[Date Hierarchy].[MONTH]").VisibleItemsList = Array("")
        ActiveSheet.PivotTables("PivotTable12").PivotFields( _
            "[TIME VIEW].[Date Hierarchy].[WEEK]").VisibleItemsList = Array( _
            "[TIME VIEW].[Date Hierarchy].[WEEK].&[2013]&[1]&[1]", _
            "[TIME VIEW].[Date Hierarchy].[WEEK].&[2013]&[1]&[2]")
        ActiveSheet.PivotTables("PivotTable12").PivotFields( _
            "[TIME VIEW].[Date Hierarchy].[DAY]").VisibleItemsList = Array("")
    Attached Files Attached Files

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,876

    Re: Access Pivot Table Hierarchy In Report Filter

    Any Help please?

+ 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. Filter in Pivot Table's Report Filter
    By mxlew in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-10-2015, 12:46 AM
  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 Report Filter being Conditional?
    By bcn1988 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-31-2013, 03:20 PM
  4. [SOLVED] Pivot Table report filter
    By dabrows in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-06-2012, 12:48 PM
  5. Replies: 0
    Last Post: 11-18-2011, 07:31 AM
  6. Pivot Table report filter
    By nazimscr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2011, 07:37 AM
  7. Place a number filter on a report filter in a pivot table
    By reuben.doetsch in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-01-2010, 12:41 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