Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
I have a multiple field
eg. order
suborder
material
submaterial,
product,
Amount,
level
and my level is define this way
00
01
01.01
01.01.01
01.01.01.02
01.01.01.03
01.02
01.02.01
01.02.02
01.03
01.03.01
02
02.01
02.01.01
02.02
03
03.01
03.01.01
03.02
then how to generate a hirarchy using this field "level"
I'd use Dual() function to get the level and then sort.
dual(
if(level='01',' A', // you can change A to whatever name you want to give'
if(level>'01.01' ,'B',
)),
if(level='01',1, // this is to give you a sort #so that you can sort later on if the level are not numeric.
if(level>'01.01' ,2,
))
)
Thanks for reply alexpanjhc
But i want my level in tree structure
eg.
01 + 01.01
01.02
01.03
00 + 02 + 02.01
02.02
02.03
03 + 03.01
03.02
03.03
First, I do not see the reason you have a root leave since everyone is under it and you have no value for the root level,
but for others you can do the same thing. create more levels(fields) for your structure.
left(level,2) as top_level, //create a new level for the top level,