Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
vipin_mishra479
Creator II
Creator II

hierachy issue

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"


3 Replies
alexpanjhc
Specialist
Specialist

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,

))


)                                    

vipin_mishra479
Creator II
Creator II
Author

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

alexpanjhc
Specialist
Specialist

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,