Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
adamgaox
Creator
Creator

Hierarchy With Node Empty

Hi All,

I've come across a problem during creating Hierarchy Tree with a table like below

LEVEL 1LEVEL 2LEVEL 3LEVEL 4LEVEL 5
AA01A01-X1A01-X1-Y1A1234
AA02A02-X1A02-X1-Y1A1235
AA02-X2A02-X2-Y1A1236
BB01B01-X1B01-X1-Y1B1234
BB02B02-X2B02-X2-Y1B1235
BB02-X3B02-X3-Y1B1236
CC01C01-X1C01-X1-Y1C1234
CC01-X2C01-X2-Y1C1235


as we can see A1236 belongs to A,B1236 belongs to B,C1235 belongs to C

after hierarchy we'll get A1236,B1236,C1235 belongs to A,B,C

for futher if every mid level (Level2,Level3,Level4) with value empty,much more Level5 Code will point to the Level1 does not match the table.

Is there a way to solve this problem?Thanks in advance.

5 Replies
sujeetsingh
Master III
Master III

Need to handle the null()s

adamgaox
Creator
Creator
Author

Hi SU,

I'm puzzled.I think it's not a specific situation.When developing QVWs for clients,their data won't be perfect all the time.Once we facing it how to overcome it?

sujeetsingh
Master III
Master III

Why do not you use exist function to either remove them or to represent them as "Unknown"

martinpohl
Partner - Master
Partner - Master

expand your script by the replace-command.

This will replace empty hierarchy levels with the level above

example:

FROM

your data.xlsx

(ooxml, embedded labels, table is Tabelle1, filters(Replace(2, left, StrCnd(null)),Replace(3, left, StrCnd(null)),Replace(4, left, StrCnd(null))

));

Regards

adamgaox
Creator
Creator
Author

Use Exists will reduce data collection,I think it's not the prefect method,

Use Unknown we'll still see unknown belongs to different Level1 Level2 and etc.