Solved Parent Child Heirachy help required

Maviso

New member
Joined
Nov 24, 2022
Messages
5
Reaction score
0
Points
1
Excel Version(s)
MS Office 365 64 bit
We receive a list of product of some 250 categories in the form below & attached.

The MergeSequence is the order in which the category should appear within the parent category.

Categories go some 4 - 5 levels deep. We need to index this list from 1 (or 10?) from "kshop" right down to the last.

Power query I feel holds the answer but this is currently beyond my Power Query knowledge. I have seen other threads but sadly cant relate those answers to my problem / level of expertise.

Please help if possible - Malcolm in the UK.

CategoryParentCategoryCategoryTreeMergeSequence
kshopkshop
20​
king2-menu-chocolate-productsKSHOPKSHOP>king2-menu-chocolate-products
10​
king2-cocoa-powder-cocoa-butter-cocoa-massKSHOPKSHOP>king2-cocoa-powder-cocoa-butter-cocoa-mass
20​
king2-menu-ingredientsKSHOPKSHOP>king2-menu-ingredients
40​
king2-menu-inclusions-and-decorKSHOPKSHOP>king2-menu-inclusions-and-decor
50​
king2-menu-gelatoKSHOPKSHOP>king2-menu-gelato
60​
kpac2-menu-packaging-1KSHOPKSHOP>kpac2-menu-packaging-1
70​
keqp2-menu-equipmentKSHOPKSHOP>keqp2-menu-equipment
80​
king2-menu-callebaut-productsking2-menu-chocolate-productsKSHOP>king2-menu-chocolate-products>king2-menu-callebaut-products
80​
king2-menu-valrhona-productsking2-menu-chocolate-productsKSHOP>king2-menu-chocolate-products>king2-menu-valrhona-products
90​
king2-dark-chocolateking2-menu-chocolate-productsKSHOP>king2-menu-chocolate-products>king2-dark-chocolate
130​
king2-milk-chocolateking2-menu-chocolate-productsKSHOP>king2-menu-chocolate-products>king2-milk-chocolate
140​
 

Attachments

  • Parent Child Heirachy.xlsx
    9.6 KB · Views: 2
Not quite sure what you're after; is it creating the MergeSequence column? Something else? If something else, could you include some sample expected results for the index you're looking to create?
 
I should have been clearer. I am just looking for the Original Category column with the added Heirachy Column.
(I have left the ParentCategory and MergeSequence columns in to explain)

Malcolm

CategoryHeirachyParentCategoryMergeSequence
kshop
10​
20
king2-menu-chocolate-products
20​
KSHOP10
king2-menu-callebaut-products
30​
king2-menu-chocolate-products80
king2-menu-valrhona-products
40​
king2-menu-chocolate-products90
king2-dark-chocolate
50​
king2-menu-chocolate-products130
king2-milk-chocolate
60​
king2-menu-chocolate-products140
king2-cocoa-powder-cocoa-butter-cocoa-mass
70​
KSHOP20
king2-menu-ingredients
80​
KSHOP40
king2-menu-inclusions-and-decor
90​
KSHOP50
king2-menu-gelato
100​
KSHOP60
kpac2-menu-packaging-1
110​
KSHOP70
keqp2-menu-equipment
120​
KSHOP80
 
Back
Top