Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading hierarchy excel file

Hi All,

I have here an example of table I need to load in my application. Please see attached file.

Any advice you can give? Thank you.

Note: This excel file is loaded monthly and changes value for IDs assigned per level.

3 Replies
Henric_Cronström

If you can create this file in a different way, it would be a lot easier. In the attachment, you can find two ways of defining hierarchies that you can use in QlikView.

The Expanded Nodes you can load as it is. The Adjacent Nodes you can load using the Hierarchy prefix.

HIC

Not applicable
Author

^bump! need help on how to format it that way... without doing it manually...either by macro or scripting..

Henric_Cronström

OK. Try this with your data:

ExpandedNodes:

LOAD ID, LVL1, LVL2,

  If(Len(Trim(LVL3))>0, LVL3, If(LVL2=Peek(LVL2), Peek(LVL3))) as LVL3,

  LVL4;

LOAD ID, LVL1,

  If(Len(Trim(LVL2))>0, LVL2, If(LVL1=Peek(LVL1), Peek(LVL2))) as LVL2,

  LVL3, LVL4;

LOAD

  RecNo() as ID,

  If(Len(Trim(LVL1))=0, Peek(LVL1), LVL1) as LVL1,

  LVL2, LVL3, LVL4

FROM [Testhier.xlsx] (ooxml, embedded labels, table is Sheet1);

HIC