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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create Linktable with concatenate or join?

I have a table looking like this

PROJECT

   

idprojectproduct
1;prod1;prod2;
2;prod2;
3;prod2;
4

;prod1;prod3;

5;prod3;

I have now want to make a table looking like this

idprojectproduct
1;prod1;
1;prod2;
2;prod2;
3;prod1;
4;prod1;
4prod3;
5prod3;

This table will then be a linktable between project and a table looking like this:

productProduktName
;prod1;Window
;prod2;Locker
;prod3;Stone

I have tried to create the linktable by concatenating tables from PROJCET like this:

LinkProduct:

Load idproject,

     product as ProductKey

Resident product like '*;Prod1;*'

Concatenate (LinkProduct)

Load idproject,

     product as ProductKey

Resident product like '*;Prod2;*'

Concatenate (LinkProduct)

Load idproject,

     product as ProductKey

Resident product like '*;Prod3;*'

But this will not create one uniqe row for each product.

Someone that could help

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

Hi Samir,

The code will work fine for all products you have.

Please have a look again.

Best Regards.

View solution in original post

6 Replies
Not applicable
Author

Use JOIN, if Product Already exists, then It will do a JOIN and If Dosenot it will Add a New Entry in the link Table.

Not applicable
Author

If i do a join it will not work. A join will give me a linktable looking like the old table:

Not applicable
Author

Anyone pleas help with me with this problem.

It should not be so complex.

I need to create a table where I can choose from one of the products and if this product is presented in a project that project should be included.

For example pressing Window (prod1) in the table above should select the project with id 1 and 4 since these projects have the product Window.

Not applicable
Author

Hi Samir,

Take a look at my example.

I hope is what you want.

Best regards.

Not applicable
Author

This look very good.

But as I look into the code it looks like you only can handle 3 product, or am I wrong? I have total 10 procucts.

Maybe if you look at this pic you vill understand how I think.

2011-07-22_085921.png

Not applicable
Author

Hi Samir,

The code will work fine for all products you have.

Please have a look again.

Best Regards.