Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
wunderch
New Contributor III

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

Re: Data Overwrite

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

4 Replies

Data Overwrite

Hi,

Just simpley load this two tables.

Rgds

Anand

wunderch
New Contributor III

Data Overwrite

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.

Re: Data Overwrite

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
New Contributor III

Data Overwrite

Hi Anand,

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

That's the solution.

Chris

Community Browser