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: 
wunderch
Creator
Creator

Data Overwrite

Hi,

I have the following problem:

I have two tables:

Table1:

Date        Amount
01.10.20111
02.10.20112
03.10.20113

Table2:

Date        Amount
02.10.20115

Now I want to load the two tables, so that I get one table (Table1) with the following result:

Table1:

DatumWert
01.10.20111
02.10.20115
03.10.20113

Can anyone help me!

Thanks

1 Solution

Accepted Solutions
its_anandrjs

Hi,

See the solution sheet by the use of LastValue( ) you can achieve it.

Load a data some thing like

Table1:

load * inline

[

Date,                  Amount

01.10.2011,          1

02.10.2011,          2

03.10.2011,          3

];

Join

load * inline

[

Date,                  Amount

02.10.2011,          5

];

load

LastValue(Amount) as LastVal,

Date

Resident Table1

group by Date;

drop table Table1;

If you not require Table1 so drop it or if you want to keep it so do not delete it.

Rgds

Anand

View solution in original post

4 Replies
its_anandrjs

Hi,

Just simpley load this two tables.

Rgds

Anand

wunderch
Creator
Creator
Author

Hi,

when I'm only load the two tables, I get the following result:

Table1:

DateAmount
01.10.20111
02.10.20112
02.10.20115
03.10.20113

But the Amount 2 on 02.10.2011 must be overwritten by Amount 5 on 02.10.2011 from table2.

its_anandrjs

Hi,

See the solution sheet by the use of LastValue( ) you can achieve it.

Load a data some thing like

Table1:

load * inline

[

Date,                  Amount

01.10.2011,          1

02.10.2011,          2

03.10.2011,          3

];

Join

load * inline

[

Date,                  Amount

02.10.2011,          5

];

load

LastValue(Amount) as LastVal,

Date

Resident Table1

group by Date;

drop table Table1;

If you not require Table1 so drop it or if you want to keep it so do not delete it.

Rgds

Anand

wunderch
Creator
Creator
Author

Hi Anand,

thank you very much for the example and the quick answer!!

That's the solution.

Chris