+ Reply to Thread
Results 1 to 13 of 13

Create Where-Used Report Hierarchially

Hybrid View

  1. #1
    Registered User
    Join Date
    11-11-2024
    Location
    Bengaluru
    MS-Off Ver
    Office 365
    Posts
    9

    Post Create Where-Used Report Hierarchially

    Need help with a macro or suggestions on how to get the hierarchical BoM using which I can generate the lowest level part mapped with their sub-assemblies and till the top assembly level

    Level 1 - Top Level Assemblies (Column A) with their parts containing Sub-Assemblies
    Level 2 - Sub Assemblies from Level 1 and their parts containing Sub-Assemblies
    Level 3 - Sub Assemblies from Level 2 and their parts - No sub-assemblies

    Levels (Sheets) could have more level if the sub assemblies are found till the lowest level parts are extracted without further sub-assemblies.

    Looking for a 2 report
    1. Lowest level parts in Level 3 mapped with hierarchy till Level 1

    Ex: 70072267 > 70073609 > 70073959 > 109582202

    2. Build a hierarchical BoM using the level 1 BoM, find the sub-assemblies in level 2 and have it child parts and so on till only lowest level parts

    Last Level is the lowest level parts of the last Sub-Assemblies

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,840

    Re: Create Where-Used Report Hierarchially

    Here is a formula-based solution that involves a lot of different formulas.
    1. Columns C:W are populated using: =INDEX('Level 2'!$B$2:$B$88,AGGREGATE(15,6,(ROW('Level 2'!$A$2:$A$88)-ROW('Level 2'!$A$1))/('Level 2'!$A$2:$A$88=$B2),COLUMNS($C2:C2)))
    2. Column X is populated using: =MAX(1,COUNT(C2:W2))
    3. Column Y is populated using: =SUM(X$2:X2)
    4. Columns AA:AB are populated using: =INDEX(A$2:A$637,AGGREGATE(15,6,(ROW(A$2:A$637)-ROW(A$1))/(ROWS(AA$2:AA2)<=$Y$2:$Y$637),1))
    5. Column AC is populated using: =IFERROR(INDEX(C$2:V$637,MATCH(AB2,B$2:B$637,0),COUNTIFS(AB$2:AB2,AB2)),"")
    6. Columns AD:AR are populated using formulas similar to columns X:AC
    7. Column AS displays the hierarchy using: =TEXTJOIN(" > ",,AR2,AQ2,AP2,AO2)
    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
    Registered User
    Join Date
    11-11-2024
    Location
    Bengaluru
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Create Where-Used Report Hierarchially

    Dear JeteMc,
    Thank you for the help.

    Looks like it is not capturing the unique values.

    Ex:
    70087670 (Output - Part) reports its parents 70098247, 70098245, 70098241, 70098211
    - Each of the parents reports to its parents
    - 70098247 -> 70073958 -> 109582202,109582302,109582402,120001431,120001432,120001433,120007559,120007561,120007562,120007569,120007570,120007571
    - 70098245 -> 70073958 -> 109582202,109582302,109582402,120001431,120001432,120001433,120007559,120007561,120007562,120007569,120007570,120007571
    - 70098241 -> 70073958 -> 109582202,109582302,109582402,120001431,120001432,120001433,120007559,120007561,120007562,120007569,120007570,120007571
    - 70098211 -> 70073958 -> 109582202,109582302,109582402,120001431,120001432,120001433,120007559,120007561,120007562,120007569,120007570,120007571

    So, the hierarchy will be 70087670 -> 70098247, 70098245, 70098241, 70098211 -> 70073958 -> 109582202,109582302,109582402,120001431,120001432,120001433,120007559,120007561,120007562,120007569,120007570,120007571 (Should be unique of all their parents)

    Ex: 2
    3 X 3.5 SHIPPER LABEL reports 109582202,109582302,109582402,109582802,109582902,109583002,120001431,120001432,120001433,120001434,120001435,120001436,120007559,120007561,120007562,120007563,120007564,120007565,120007566,120007567,120007568,120007569,120007570,120007571

    Output - Hierarchy - is the BOM explosion with all the levels in 1 sheet
    Output - Part - is the where-used mapping to the Level 1 parts (Top Assemblies)


    Output should be populated in the 2 sheets (Output - Part & Output - Hierarchy)

    ** Will this approach (Formula based) be feasible if the number of child parts for the parent is >100 parts.

    Macro would help is my thought, if other use pls advise and request help
    Last edited by svijikumar; 03-10-2025 at 01:18 PM.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,840

    Re: Create Where-Used Report Hierarchially

    A pivot table based on columns AO:AR on the Level 1 sheet comes close to what is shown on the Output - Hierarchy sheet.
    I feel that the best way to know if a formula/pivot table based approach will be feasible is to test it on the actual data.
    I don't know enough about VBA to say whether or not a macro would help with replicating the Output - Part sheet.
    I had seen that this was a VBA question, but decided to reply to the thread when I saw it had gone two days without one.

  5. #5
    Registered User
    Join Date
    11-11-2024
    Location
    Bengaluru
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Create Where-Used Report Hierarchially

    Thank you JeteMc.
    Hierarchy is fine.. The data I shared are the actual data.
    Also, in the Output - Parts are the lowest level parts for which I need to populate the Top level assemblies that the part is reporting to.
    Can you pls help on Output - Part sheet. It should show all its unique assemblies that it is reporting to.

    Ex:
    Parts Where Used
    70071078 -> 109494602,109494702,109494802,109494902,109495002,109495102,120007555,120007557,120007558
    70071823 -> 109494602,109494702,109494802
    70071827 -> 109494602,109494702,109494802,109494902,109495002,109495102
    70072535 -> 109494602,109494902
    60002313 -> 109494602,109494702,109494802
    60002080 -> 109494602,109494702,109494802
    70070671 -> 109494602,109494702,109494802,109494902,109495002,109495102,120007555,120007557,120007558
    70211123 -> 109494602,109494702,109494802,109494902,109495002,109495102,109582202,109582302,109582402,109582802,109582902,109583002,120001431,120001432,120001433,120001434,120001435,120001436

    and so on

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,840

    Re: Create Where-Used Report Hierarchially

    I don't feel that this is what you want, however perhaps it will be of some help.
    Columns H:I display level 2 parts that are used in level 1.
    Column H is populated using: =UNIQUE('Level 1'!B2:B637)
    Column I is populated using: =TEXTJOIN(",",,UNIQUE(FILTER('Level 1'!A2:A637,('Level 1'!B2:B637=H2))))
    Similarly columns K:L display level 3 parts that are used in level 2 and columns N:O display level 4 parts that are used in level 3.

  7. #7
    Registered User
    Join Date
    11-11-2024
    Location
    Bengaluru
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Create Where-Used Report Hierarchially

    Hi JeteMC
    Thank you, this works

  8. #8
    Registered User
    Join Date
    01-25-2025
    Location
    Presov, Slovakia
    MS-Off Ver
    365
    Posts
    116

    Re: Create Where-Used Report Hierarchially

    Hi svijikumar,
    version with vba. Procedures are triggered by buttons.
    m.s.

  9. #9
    Registered User
    Join Date
    11-11-2024
    Location
    Bengaluru
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Create Where-Used Report Hierarchially

    HI MS,
    Thank you, This works.
    Can you pls help in adding the unique component Numbers and map only the Top level assemblies column wise
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    01-25-2025
    Location
    Presov, Slovakia
    MS-Off Ver
    365
    Posts
    116

    Re: Create Where-Used Report Hierarchially

    Hi,
    could it be like this?

  11. #11
    Registered User
    Join Date
    11-11-2024
    Location
    Bengaluru
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Create Where-Used Report Hierarchially

    Hi MS,
    I cleared the hierarchy column (Output->Parts) sheet and rerun the generate part macro, the output files are not coming as expected. It has duplicate Finished goods for the parts, which should not be the case.
    Also if I have to re-run with new set of date in the levels, should i delete in all the other sheets and rerun. If i have to do it manually, can a clear option be given.
    If I have to add more levels (Level 4, 5, 6, etc), how can that be incorporated?
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    01-25-2025
    Location
    Presov, Slovakia
    MS-Off Ver
    365
    Posts
    116

    Re: Create Where-Used Report Hierarchially

    Hi,
    "Output - Part"
    After pressing the "generate part" button, the code tests cell "E2":
    - if it is not empty, the code ends (there is a report in the sheet),
    - if it is empty, the code continues,
    After testing "E2", the code makes a copy of the source data from the sheet "Output - Part" to the sheet "Old_1".
    And here I see:
    - you deleted column "E" in the sheet "Output - Part", thereby fooling my test on "E2".
    - you ran the macro on the old report, where for example the first number is listed 9 times. The macro then makes the same report 9 times.

    To clarify: the code I wrote was mainly to verify its functionality.
    It does not solve anything else.
    It does not solve, for example, the situation described above = the code simply assumes that there are source numbers in column "A" that it should process.
    If you write your suggestions on how it should work, I can add it.
    For example. source data will be in one sheet, report in another - macro can be run repeatedly without limitation.

    (Level 4, 5, 6, etc)
    ,
    The code cannot be easily adapted to more, or an indefinite number of levels.
    It is certainly possible, but the code will be more complicated.
    It's a shame you didn't mention it at the beginning.
    m.s.

  13. #13
    Registered User
    Join Date
    11-11-2024
    Location
    Bengaluru
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Create Where-Used Report Hierarchially

    Hi MS,
    Thanks you..
    I couldn't mention on the levels in the beginning because I did not encounter any BoM > 3 levels, but found couple of BoMs recently. Hence asked.

    Thank you for all the help/support.

+ 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. How to create automatically new sheets and the in each one of them create a report
    By ricardoz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-25-2018, 04:17 PM
  2. [SOLVED] Vba to create report
    By phbryan in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 04-17-2018, 10:08 AM
  3. Create a running total - create a "pretty" report
    By excelnewbie1234567 in forum Excel General
    Replies: 1
    Last Post: 03-08-2017, 11:41 AM
  4. [SOLVED] How to create this report
    By sarahqputra in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-17-2014, 02:12 AM
  5. Replies: 2
    Last Post: 06-29-2011, 04:35 PM
  6. Create a Report
    By bhallam in forum Access Tables & Databases
    Replies: 5
    Last Post: 03-18-2011, 03:21 PM
  7. trying to create a report
    By BudS in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-02-2006, 09:30 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