Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Populate missing data on Table1 from Table2

Hello there,

I have a Table1 with a list of basic values that belongs to a specific ClassID. And I have a Table 2 with a complete list of Items that belongs to every ClassID.

I need to add to Table1 the missing items that are listed on Table2, considering also the typeID.

The final result most be something like:

TypeIDClassIDItemIDItemNameAmount
110100A1000
110200B1000
110300C1000
110400D2000
110500E3000
1201100FF100
1201200GG200
1201300HH

300

210400D2000
210100A1000
210200B1000
210300C1000
210500E3000

I attach the Qlikview file.

Thanks for any advice.

Best regards,

4 Replies
Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Hello Gysbert,

This is really nice. But I forgot to mention the importance of the field “TypeID”.

In your method the missing fields are added without considerer the “TypeID” that belongs to. If I added a register with TypeID =2 on the Table1:

TypeIDClassIDItemIDItemNameAmount
210400D2000

It means, that the final table must have in addition the missing fields for TypeID = 1 and TypeID = 2. Something like:

TypeIDClassIDItemIDItemNameAmount
1

10

100A1000
110200B1000
110300C1000
110400D2000
110500E3000
1201100FF100
1201200GG200
1201300HH300
210400D2000
210100A1000
210200B1000
210300C1000
210500E3000

Thanks in advance for any help.

Gysbert_Wassenaar

Table 2 doesn't have a TypeID field. So how is the TypeID determined?


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

That is the point. Unfortunately I just have TypeID field on Table1 and not on the Table2.

I was thinking that maybe an analysis via GROUP BY TypeID from the Table1 and then look for the missing fields of ItemID could be the way to do it. But it is more complicated than expected.

I will appreciate any light on this matter.