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: 
Not applicable

How to create Product Hiearchy

Dear All,

I am having 2 tables which contains the product deatils

In first Table i am using left(ProdCode,3) as Products to extract products with first 3 charcters

and from Table 2

i am using left(Prodcode,3) as P1

left(Prodcode,4) as P2

left(Prodcode,5) As P3

Now i want to join Table 1 and Table 2 on condition where Left(Prodcode,3) from table 1 matches P1,P2,P3 so that a product hiearchy is formed.

I am stuck

can anyone help me.

Thanks in advance

1 Reply
Not applicable
Author

Hi,

Try out this below code.

Table1:

Load

left(ProdCode,3) as Products

From..... ;

Table2_Old:

Load

left(Prodcode,3) as P1,

left(Prodcode,4) as P2,

left(Prodcode,5) As P3,

from ..... ;

Noconcatenate

Load P1,

P2,

P3

Resident Table2_Old where exists(Products,P1);


drop table Table2_Old;

- Sridhar