Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Been away from QlikView for a while and I forgot how to do this. Need to replace values, where the key exists, from one table into another table. For example, if I inline load two table:
BaseTable:
LOAD * INLINE [
KEY, FRUIT
1001, Apple
1002, Pear
1003, Grape
1004, Banana
];
SubTable:
LOAD * INLINE [
KEY, FRUIT_NAME
1001, Honeycrisp
1004, Yellow Banana
];
How can I create a resulting table of:
1001, Honeycrisp
1002, Pear
1003, Grape
1004, Yellow Banana
With a mapping table
SubTable:
Mapping
LOAD * INLINE [
KEY, FRUIT_NAME
1001, Honeycrisp
1004, Yellow Banana
];
BaseTable:
LOAD KEY,
ApplyMap('SubTable', KEY, FRUIT) as FRUIT
INLINE [
KEY, FRUIT
1001, Apple
1002, Pear
1003, Grape
1004, Banana
];
With a mapping table
SubTable:
Mapping
LOAD * INLINE [
KEY, FRUIT_NAME
1001, Honeycrisp
1004, Yellow Banana
];
BaseTable:
LOAD KEY,
ApplyMap('SubTable', KEY, FRUIT) as FRUIT
INLINE [
KEY, FRUIT
1001, Apple
1002, Pear
1003, Grape
1004, Banana
];
One posible approach
SubTable:
mapping LOAD * INLINE [
KEY, FRUIT_NAME
1001, Honeycrisp
1004, Yellow Banana
];
BaseTable:
LOAD KEY,ApplyMap('SubTable',KEY,FRUIT) as FRUIT INLINE [
KEY, FRUIT
1001, Apple
1002, Pear
1003, Grape
1004, Banana
];
Ops, haven´t seen that maxgro already answered