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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
carolin01
Partner - Creator II
Partner - Creator II

Hierachy with Tree

Hi, I would like to create a hierachy load and use the tree function in a list box. Therefore I´ve created the following load statement:

HIERARCHY (NodeCountryID, ParentCountryID, NodeCountry, Tree, '/')
Load*;



LOAD NodeCountryID,
    
ParentCountryID,
    
NodeCountry,
    
NodeCountryDesc
FROM

(
ooxml, embedded labels, table is Sheet2);

Qlik View creates two fields: Tree and Path. Path is empty and Tree just shows the 1st level - see below:

Screenshot2.png

What is wrong here? Any suggestions?

Many thanks in advance.

Best regards

Carlin

4 Replies
tresesco
MVP
MVP

Try like:

HIERARCHY (NodeCountryID, ParentCountryID, NodeCountry,NodeCountryDesc, Tree, '/')

PrashantSangle

Hi,

Check this example.

This might help you.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
carolin01
Partner - Creator II
Partner - Creator II
Author

OK, that was closed. I adjusted now to:

HIERARCHY (NodeCountryID, ParentCountryID, NodeCountry,, NodeCountryDesc, Tree, '/')
Load*;

LOAD NodeCountryID,
    
ParentCountryID,
    
NodeCountry,
    
NodeCountryDesc
FROM

(
ooxml, embedded labels, table is Sheet2);

and got the following result:

Screenshot2.png

But I would like to have:

EMEA --> Bulgaria etc.

CNTW --> China etc.

I know only see the third level but not the naming of the 2nd and 1st level... Any ideas what I´m still doing wrong?

gilbertomedeiro
Contributor III
Contributor III

Hi Carolin,

Sorry, maybe is too late to reply about that, but at least to me, every question or doubt needs response! For this reason, I reproduced a small and simple code that can be helpful.

Regards

//Hierarchy (NodeID, ParentID, NodeName, [ParentName], [PathSource], [PathName], [PathDelimiter], [Depth])(loadstatement | selectstatement)

Hierarchy:

Hierarchy(NodeID,ParentID, NodeName, ParentName,Tree,Path)

Load*;

LOAD * inline [NodeID, ParentID, NodeName ,Tree

1,1,'EMEA ','EMEA '

2,1,'EMEA','Bulgaria'

3,3,'CNTW ', 'CNTW '

4,3,'CNTW', 'China'

5,1,'EMEA', 'Dinamarca'

];