Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading data by replacing one column with other table value

Good Friday afternoon Expert,

My mind is not working now. I want do do following load (It looks so easy, but I can't figure out an easy way to do it in QlikView)

Load Table 1:

    Mat1, X100

    Mat1, Z100

    Mat2, X110

    Mat3, X101

By replacing value from table 2:

    Mat1, X100

    Mat2, Y100

    Mat3, Y111

End result look like this

Mat1 X100

Mat1 X100

Mat2 Y100

Mat3 Y111

How can I achieve the data loading?

Any suggestion will be greatly appreciated!

Weidong

1 Solution

Accepted Solutions
swuehl
MVP
MVP

MAP:

MAPPING LOAD Field1, Field2 FROM Table2;

LOAD

     Field1,

     ApplyMap('MAP', Field1) as Field2

FROM Table1;

View solution in original post

5 Replies
swuehl
MVP
MVP

MAP:

MAPPING LOAD Field1, Field2 FROM Table2;

LOAD

     Field1,

     ApplyMap('MAP', Field1) as Field2

FROM Table1;

Not applicable
Author

Thanks for such a fast reply!

I didn't explain the question correctly. There are more rows and some rows are not in the table 2 and need keep those row and only replace with one in table 2.

Weidong

Not applicable
Author

I figured out with APPLYMAP.

Thanks!

swuehl
MVP
MVP

Not sure if I understand. If the mapping key is not found in MAP, applymap will return the search value. But you can use a third parameter to change it to Field2 from Table1:

LOAD

     Field1,

     ApplyMap('MAP', Field1, Field2) as Field2

FROM Table1;

Not applicable
Author

Yes, you are right! I used the 3rd parameter.

Thanks!