Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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

Re: Advanced DataSources Merge

Ecco qui'

3 Replies

Re: Advanced DataSources Merge

Ecco qui'

sujeetsingh
Honored Contributor III

Re: Advanced DataSources Merge

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

Re: Advanced DataSources Merge

Thanks a lot for all responses.

It was what I needed.