Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to update a columm with new values?

Hi guys,

I'm also new and have following questions to my Problem:

I have a database or excel doc, which need to be updated, because some lines are wrong.

Table1 (excel):

ID, Age

1,20

2,21

3,20

Table2 (excel): // with updated lines/values

ID, Age

2,22

I want to update Table1 by integrate with Table2.

With the funktion Inline, I can only add the "Age"-value. But in this case, I want to replace:

How could this be solved with Qlikview? Via script or funktion/ formel ?

Best regards

the.user

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Hi,

use apply map instead as shown below.

Map:

Mapping load * Inline

[

ID, Age

2,22

];

load *, ApplyMap('Map',ID,Age) as New_age;

load * inline

[

ID, Age

1,20

2,21

3,20

];

Regards

ASHFAQ

View solution in original post

4 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

use apply map instead as shown below.

Map:

Mapping load * Inline

[

ID, Age

2,22

];

load *, ApplyMap('Map',ID,Age) as New_age;

load * inline

[

ID, Age

1,20

2,21

3,20

];

Regards

ASHFAQ

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Temp:

load * inline

[

ID, Age

1,20

2,21

3,20

];

LEFT JOIN(Temp)

load * Inline

[

ID, NewAge

2,22

];

Data:

LOAD

ID,

If(IsNull(NewAge), Age, NewAge) AS Age

RESIDENT Temp;

DROP TABLE Temp;

Regards,

jagan.

Not applicable
Author

What about if I have more fields then 5 im my source, and I want just Replace 1 of them, if it needs:

Tabel1:

ID, Age, Mood, Color

1,21,Friendly, Green

2,20,Angry, Blue

3,23,Friendly, Black

4,24,Angry, Orange

UpdateTable:

ID, Age, Mood, Color

2,20,Friendly, Blue

3,23,Friendly,Black

4,24,Friendly, Orange

Here I only want to update the 2x'Mood'  and 1 'Color' of 2 IDs.

My solve-thinking would be: that I have to  separate in 4 tables to join or mapping them?

Am I thinking right?

ashfaq_haseeb
Champion III
Champion III

Hi,

Use Apply map instead of join.

Yes, use 4 different applymaps.

Regards

ASHFAQ