Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
hildacgg
Creator
Creator

Dimension with conditional

I have 2 tables, parts and products. but they are not linked, part-nbr is same notation as product-nbr. I have a chart with fields from parts and I want to bring one of the attributes of the product table. but when I do this it creates a lot extra rows with all the products not included in the part table, how can I just populate the attribute for the current parts in the table? How is the statement for a conditional? or is there any other way I can do this.

Parts-Nbr       Desc

1120               11awg

2280               22awg

3020               30awg

4578               45awg

4560               45awg

4512               45awg

7854               78awg


Products-Nbr     Width

1120                    .12

5879                    .36

3548                    .21

2280                    .35

3020                    .58

8542                    .65

4578                    .87

3698                    .65

4560                    .45

4512                    .12

7854                    .85


I want my output to be:

Parts-Nbr       Desc      Width

1120               11awg     .12    

2280               22awg     .35

3020               30awg      .58                                           

4578               45awg     .87

4560               45awg     .45

4512               45awg     .12

7854               78awg     .85


This is just an example there are so many other fields and tables. I can not rename the fields.

Thank you.



1 Solution

Accepted Solutions
hildacgg
Creator
Creator
Author

Thank you, I figured it out already. I added a column for part-number in the Product table.

Thanks a lot!

View solution in original post

2 Replies
maniram23
Creator II
Creator II

Hi,

please try this on. it is help full for you.

T1:

load * Inline   [

Parts-Nbr,Desc

1120 ,11awg

2280 ,22awg

3020 ,30awg

4578 ,45awg

4560 ,45awg

4512 ,45awg

7854 ,78awg

];

T2:

mapping load * Inline [

Products-Nbr,Width

1120,.12

5879,.36

3548,.21

2280,.35

3020,.58

8542,.65

4578,.87

3698,.65

4560,.45

4512,.12

7854,.85

];

T3:

load

[Parts-Nbr],

ApplyMap('T2',[Parts-Nbr]) as width,

Desc

Resident T1;

DROP Table T1;

hildacgg
Creator
Creator
Author

Thank you, I figured it out already. I added a column for part-number in the Product table.

Thanks a lot!