Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Advanced DataSources Merge

Hi All,

I have a little difficult with import and merging data from two different datasources.

In the 1th datasource I have a table like this

IDKeyValue
1a1
2b1
3c3
4d4
5e4

In a 2nd datasource I have another table like this

IDValue
22
55

Finally, I want to update the value column in the first table using the corresponding int the 2nd one like this

IDKeyValue
1a1
2b2
3c3
4d4
5e5

I wrote this script but it does not work properly.

Fixed:

LOAD

    ID

    , Value

From

    Qvd\Fixed.qvd

    (qvd);

Concatenate (Fixed)

LOAD

    *

From

    Qvd\Source.qvd

    (qvd)

Where Not Exists(ID);

Can someone please help me?

Thanks a lot.

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Ecco qui'

sujeetsingh
Master III
Master III

See this Sample script:

Tab1:

LOAD * INLINE [

    ID, Key, Value

    1, a, 1

    2, b, 1

    3, c, 3

    4, d, 4

    5, e, 4

];

Tab2:

LOAD * INLINE [

    ID, Value

    2,2

    5,5

   

];

Data:

LOAD

ID, Key as KEY, Value

Resident Tab1;

DROP Table Tab1;

Join(Data)

LOAD

ID, Value as Val2

Resident Tab2;

DROP Table Tab2;

FinalData:

LOAD

ID,KEY

,if(IsNull(Val2)=0,Val2,Value) as Value

Resident Data;

DROP Table Data;

Not applicable
Author

Thanks a lot for all responses.

It was what I needed.