Cost Centers Hierarchies

Here’s a tuff one:
I have this table :

Capture50
and i would like to establish 3 or 4 levels of each cost center#, but, for each company and each year, as long as the TipoConta is like “M”, like this pic


I believe there’s a better way than merge queries 3 or 4 times on the same one…kinda messy i think.
In those pics you can’t see a column for the length of Cost Center#, but it’s there, just in case you need it.
Do you guys have a better idea?
Thanks and best regards to all of you
Pedro

Hi @pedroccamara,

First I created a Duplicate Cost Center query and only kept a Distinct list.
Disabled it’s load.
image

1 Added a Custom Column with this logic
2 and chose Extracted Values

All that’s left is to split by delimiter

With this result.

Here’s my sample file. eDNA - CostCenters.pbix (34.3 KB)
I hope this is helpful

1 Like

i just have one word to say…AMAZING!!!
Thank you so much Melissa. You’re the best