Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

drop a hierarchy level

Hi

I have an urgent request and dont know how to solve this.

I have an existing hierarchy (not able to be changed because it is source for several databases).

I created this hierarchy with tree and so on and everything works.

Now I Need to skip the lines with TreeDepth below three in the script.

Does someone of you have an idea?

I will attach sample datafile. The aim is to get rid of Total Assets (TreeDepths =1) and Total LT Assets (TreeDepths=2)

Thanks in advance.

Chris

5 Replies
migueldelval
Specialist
Specialist

Hi Christian,

I think that you can try:

Load [...]

SQL Select [...]

From [...] where "TreeDepth"  >= 3;

Regards

Miguel del Valle

Digvijay_Singh

What if you use calculated dimension in your chart as if(TreeDepth<>1 and TreeDepth<>2, TreeDepth) to meet the immediate need of the chart.

Not applicable
Author

Hi Digvijay,

in this Diagram I do it like that. But in this model the Level 1+2 are always incorrect because we are just looking at a part of the whole pic.

And I want to avoid that collegues do it wrong when they work with the structure.

Chris

Digvijay_Singh

You mean you would like to delete them in the script after hierarchy data creation?

You may create new temp file with last two records smthing like

Temp:

Load TreeDepth as TempTreeDepth

Resident Mainfile

Where (Match(TreeDepth,'1','2'))

You then reduce mainfile as

Final:

Load *

Resident Mainfile

Where not exist(TempTreeDepth,TreeDepth )

You can delete old main file and rename final to main file.

Not applicable
Author

Hi Digvijay,

the first part works. Thank you.

Can you have a look at the second part. This is not working.