Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to replace a value from one table into another table

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

Labels (1)
1 Solution

Accepted Solutions
maxgro
MVP
MVP

With a mapping table

1.png

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

];

View solution in original post

3 Replies
maxgro
MVP
MVP

With a mapping table

1.png

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

];

Clever_Anjos
Support
Support

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

];

Clever_Anjos
Support
Support

Ops, haven´t seen that maxgro already answered