Qlik Community

QlikView Extensions

Discussion Board for collaboration on QlikView Extensions.

Highlighted
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

Tags (2)
1 Solution

Accepted Solutions

Re: How to update a columm with new values?

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

Re: How to update a columm with new values?

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

MVP & Luminary
MVP & Luminary

Re: How to update a columm with new values?

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

Re: How to update a columm with new values?

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?

Re: How to update a columm with new values?

Hi,

Use Apply map instead of join.

Yes, use 4 different applymaps.

Regards

ASHFAQ