Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
MAP:
MAPPING LOAD Field1, Field2 FROM Table2;
LOAD
Field1,
ApplyMap('MAP', Field1) as Field2
FROM Table1;
MAP:
MAPPING LOAD Field1, Field2 FROM Table2;
LOAD
Field1,
ApplyMap('MAP', Field1) as Field2
FROM Table1;
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
I figured out with APPLYMAP.
Thanks!
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;
Yes, you are right! I used the 3rd parameter.
Thanks!