pivot table lists

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
2,008
Office Version
  1. 365
Platform
  1. Windows
hi all, i have a page full of Parent/Class/commodity names. 3 columns where commodity is the basic level of detail. each commodity wraps up to a Class and then each Class belongs to a Parent. there are 121 Classes. In a pivot table, I can add the Class and Commodity fields to the Rows and display the available Commodities grouped by Class.
Class NameCommodity Name*
Computer Hardware (L2)Copy Print Fax Scan Equipment (L3)
Security Computer Hardware Equipment (L3)
Servers / Storage (L3)
Computer Software (L2)Custom software (L3)
IT Software Programs (L3)
IT Software Programs Electronic Delivery (L3)
Platform (L3)
Platform Electronic Delivery (L3)
Construction Materials (L2)Binders, Stone and Backfill Materials (L3)
Concrete Materials (L3)
Construction Materials - Other (L3)
Contractor Supplied Materials (L3)

No worries....except, I want to generate the Classes as Columns with the available Commodities listed beneath.

Computer Hardware (L2)Computer Software (L2)Construction Materials (L2)
Copy Print Fax Scan Equipment (L3)Custom software (L3)Binders, Stone and Backfill Materials (L3)
Security Computer Hardware Equipment (L3)IT Software Programs (L3)Concrete Materials (L3)
Servers / Storage (L3)IT Software Programs Electronic Delivery (L3)Construction Materials - Other (L3)
Platform (L3)Contractor Supplied Materials (L3)
Platform Electronic Delivery (L3)Fencing and Gates (L3)

Any help would be appreciated.

I am using Microsoft® Excel® for Microsoft 365 MSO (Version 2205 Build 16.0.15225.20348) 64-bit
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Pivot your data with Power Query

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Filled Down" = Table.FillDown(Source,{"Class Name"}),
    #"Grouped Rows" = Table.Group(#"Filled Down", {"Class Name"}, {{"Data", each _, type table [Class Name=text, #"Commodity Name*"=text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn([Data], "Index",1,1)),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Data"}),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Commodity Name*", "Index"}, {"Custom.Commodity Name*", "Custom.Index"}),
    #"Pivoted Column" = Table.Pivot(#"Expanded Custom", List.Distinct(#"Expanded Custom"[#"Class Name"]), "Class Name", "Custom.Commodity Name*"),
    #"Removed Columns1" = Table.RemoveColumns(#"Pivoted Column",{"Custom.Index"})
in
    #"Removed Columns1"

Book5
ABCDEF
1Class NameCommodity Name*Computer Hardware (L2)Computer Software (L2)Construction Materials (L2)
2Computer Hardware (L2)Copy Print Fax Scan Equipment (L3)Copy Print Fax Scan Equipment (L3)Custom software (L3)Binders, Stone and Backfill Materials (L3)
3Security Computer Hardware Equipment (L3)Security Computer Hardware Equipment (L3)IT Software Programs (L3)Concrete Materials (L3)
4Servers / Storage (L3)Servers / Storage (L3)IT Software Programs Electronic Delivery (L3)Construction Materials - Other (L3)
5Computer Software (L2)Custom software (L3)Platform (L3)Contractor Supplied Materials (L3)
6IT Software Programs (L3)Platform Electronic Delivery (L3)
7IT Software Programs Electronic Delivery (L3)
8Platform (L3)
9Platform Electronic Delivery (L3)
10Construction Materials (L2)Binders, Stone and Backfill Materials (L3)
11Concrete Materials (L3)
12Construction Materials - Other (L3)
13Contractor Supplied Materials (L3)
Sheet1
 
Upvote 0
Solution

Forum statistics

Threads
1,215,334
Messages
6,124,323
Members
449,154
Latest member
pollardxlsm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top