Hello lovely people at the Excelguru,
I am dealing with a problem of turning tree hierarchical structure that I get from my datawarehouse into tabular format to do analysis of my data and I really need some help.
Let me try to explain. I am also attachingView attachment txt data tree structure.txt the sample file. The data is exported from SAP in .txt format (separated by tabs). And the structure (as it is actually really a tree structure in SAP, familiar to table of contents for example in Word). What I am trying to do, si match this data with another table I have (doing VLOOKUP or better merging queries) and it should be connected by final IDs (in the example file I am calling them just that, final 999...). Final IDs have some parent IDs, which in tabular format should be written with every final ID. But the problem which comes up, is that not all final IDs are on the same level. Some of them have only one (main) parent ID, and some of them have several (max. 4) (I like to think about this as a Normal text in Word "belonging" to the Heading 1, 2, 3 or 4).
I did some transformation, filled the columns but I end up with the problem that the final IDs are mixed with parent ones in some columns. I do have and idea though, that I don't know how to implement. Is it possible (I'm sure it is, but I simply don't know how) to replace values that contain a certain text string with something else (replacing cells that contain word final with nothing)? I did that in Excel after import, but obviously it would be cool to make the magic happen in Power Query.
I am also attaching the Excel file to show my progress.
Thank you for all the help already in advance, either anwsering the last question or giving the idea on how to "attack" the tree structure from the begining.
Regards, Marko
I am dealing with a problem of turning tree hierarchical structure that I get from my datawarehouse into tabular format to do analysis of my data and I really need some help.
Let me try to explain. I am also attachingView attachment txt data tree structure.txt the sample file. The data is exported from SAP in .txt format (separated by tabs). And the structure (as it is actually really a tree structure in SAP, familiar to table of contents for example in Word). What I am trying to do, si match this data with another table I have (doing VLOOKUP or better merging queries) and it should be connected by final IDs (in the example file I am calling them just that, final 999...). Final IDs have some parent IDs, which in tabular format should be written with every final ID. But the problem which comes up, is that not all final IDs are on the same level. Some of them have only one (main) parent ID, and some of them have several (max. 4) (I like to think about this as a Normal text in Word "belonging" to the Heading 1, 2, 3 or 4).
I did some transformation, filled the columns but I end up with the problem that the final IDs are mixed with parent ones in some columns. I do have and idea though, that I don't know how to implement. Is it possible (I'm sure it is, but I simply don't know how) to replace values that contain a certain text string with something else (replacing cells that contain word final with nothing)? I did that in Excel after import, but obviously it would be cool to make the magic happen in Power Query.
I am also attaching the Excel file to show my progress.
Thank you for all the help already in advance, either anwsering the last question or giving the idea on how to "attack" the tree structure from the begining.
Regards, Marko