+ Reply to Thread
Results 1 to 4 of 4

How to capture the "group" value in a Pivot Table?

  1. #1
    Registered User
    Join Date
    07-21-2023
    Location
    Charlotte, NC
    MS-Off Ver
    Office 365
    Posts
    2

    How to capture the "group" value in a Pivot Table?

    I've been searching around but can't find a way to do this. Probably simple, but one of those that get me stuck...

    I have a simple pivot with three columns. RoomID, IP-Address, Count of IP Address (indicates how many times that IP was used during a given date range)

    On another tab, I have a list of people and the IP addresses that they have used during that same data range. I then use a xlookup to list by whom the IP was used, and Filter (with Transpose) to list all dates a given individual used an IP address. Because the same IP might appear in different rooms Filter is returning more than it should, as it is capturing the info from all rooms.

    Note: using Excel 365, Classic PivotTable layout. Values below are just samples, not my real data.

    Pivot (in orange below) is based on "Table 1"
    "Who used the IP" uses the IP in a XLOOKUP (simple refence, e.g. "B2") to look on "Table 2"
    If someone used the IP, that same IP (again simple reference to that same cell, "B2"), is used with Transpose/Filter to "look" back in "Table 1" and list when the IP was used (When Used column).

    The problem is for Mary / IP 1.1.1.1 Transpose/ Filter is listing four dates, as it is capturing info from rooms 00001 & 00002. Two instance from room 00001 and two instances from room 00002.

    NOTE: I understand that the dates listed are not the dates Mary used the IP. That info is not present on the users table (Table 2). Those are just the dates the IP was used. But I still need to filter for just the dates the IP was used in that room.

    What I (think I) need is to identify which RoomID is associated with that IP (Mary's example, 00001 or 00002) and use that info as a primary Filter. I thought it should be simple to refence the RoomID column / group based on the current row, but I'm failing miserably. GETPIVOTDATA ain't my friend.

    There might be a million other ways to do this (and thousands of them better), but my real question is:

    Is it possible to make a refence to the Group RoomID (or any other "non-calculated" fields) in a pivot table?

    Any pointers are greatly appreciated.

    Room ID IP No of Times IP Used Who Used the IP (XLookup) When Used (Transp/Filter)
    00001 1.1.1.1 2 Mary 03/10/2021 04/08/2021 07/15/2021 03/02/2022
    2.2.2.2 2 Mike 01/30/2020 04/20/2020
    3.3.3.3 5 No N/A
    00002 1.1.1.1 2 Mary 03/10/2021 04/08/2021 07/15/2021 03/02/2022
    4.4.4.4 2 Paul 05/23/2019 06/25/2019
    6.6.6.6 3 No N/A
    00003 2.2.2.2 1 Mike 01/30/2020 04/20/2020
    7.7.7.7 3 Steve 03/22/2020 04/06/2020 10/11/2021

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: How to capture the "group" value in a Pivot Table?

    Not to imply that I can solve this, however someone may have a better chance of offering a solution if we could see an Excel workbook with the source data and pivot table.
    Information regarding the attachment of a workbook to your next post is given in the "HOW TO ATTACH YOUR SAMPLE WORKBOOK" banner at the top of the page.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,938

    Re: How to capture the "group" value in a Pivot Table?

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important: https://excelguru.ca/a-message-to-forum-cross-posters/

    (Note: this requirement is not optional. As you are new, I am doing it for you this ONCE: https://forums.excelguru.ca/threads/...t-table.11756/)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    07-21-2023
    Location
    Charlotte, NC
    MS-Off Ver
    Office 365
    Posts
    2

    Re: How to capture the "group" value in a Pivot Table?

    I tried to post the link (as the question was posed on the other forum first) but I was not allowed.

    "The following errors occurred with your submission
    You are not allowed to post any kinds of links, images or videos until you post a few times."

+ 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. Group rows in a pivot table dynamically under "other"
    By AHatherell in forum Excel General
    Replies: 4
    Last Post: 07-14-2017, 02:32 PM
  2. Getting Error "cannot group that selection pivot table"
    By sughasini in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2017, 04:59 AM
  3. Getting error trying to "group" by Day, Month and Year on a pivot table
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-03-2015, 05:14 PM
  4. "Cannot group that selection" error in pivot table work-around
    By kfryar in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-07-2014, 02:46 AM
  5. [SOLVED] Pivot table "Group and Show Details" vs. "SubTotals"
    By pgchop in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-01-2006, 03:35 AM
  6. [SOLVED] "Cannot Group That Selection" in a Pivot Table.
    By les8 in forum Excel General
    Replies: 1
    Last Post: 11-09-2005, 11:20 AM

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