Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
tizianacaem
Partner - Contributor
Partner - Contributor

Problem with Hierarchy

hi all,
I have a problem with the linearization of the bills of material.
I have a table which has on the same line the parent code and child code, with the use's factor for son.

The sono code can become a father in another row, with the relative use's factor.
eg.

FATHERSONFACTOR-USE
AB2
AC3
BD1
CE2
CF2
DF1

G

H1
HE2

I want the linearization of the bill, so that I can bind the parent code and how many children are need to make the father.

eg. father A needs 2B, 3C, 2D, 6E, 8F  Father G needs 1H, 2E etc.

I did experiment with the function Hierarchy, but I can't able to define the use's factor.

Any ideas please?

thanks

Tiziana

1 Reply
adnan_rafiq
Partner - Creator II
Partner - Creator II

I am not really sure about your exact requirment

but i guess here is the logic that might be helpful

load Hiearchy repeatedly see below script to get an idea.

It will create link with one hierarchy table to other you will see like

A is linked to C and B and also E , F through C and B and so on

Hierarchy (SON, FATHER,A)

LOAD FATHER,

     SON,

    'Dum' as A

FROM

[Hiearchy test.xlsx]

(ooxml, embedded labels, table is Sheet1);

Hierarchy ( SON_1,SON, B)

LOAD FATHER as SON,

     SON as SON_1 ,

'Dum' as B

FROM

[Hiearchy test.xlsx]

(ooxml, embedded labels, table is Sheet1);

Hierarchy ( SON_2,SON_1, C)

LOAD FATHER as SON_1,

     SON as SON_2 ,

'Dum' as C

FROM

[Hiearchy test.xlsx]

(ooxml, embedded labels, table is Sheet1);

Regards