Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Keep with concatenate

Hi everybody.

Is it possible to concatenate tables, which were loaded with keep prefix? My script is

For i  = 1 to 4

Tab:

Left(keep)

Load

     field1

From

     file$(i).txt

next i

Problem is that QlikView creates 4 different tables Tab-1 Tab-2 Tab-3 Tab-4 and i need only 1. What is the better way to solve it?

Thanx

6 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Why you are using Left(Keep) here?

Qlikview automatically concatenates(appends) if the tables has same number of fields with same fieldnames.

Can you explain how the table structure looks like once it gets loaded?

Not applicable
Author

example--

Tab1:

load *,

id as idnew

from Tab1;

join

Tab2:

load *,

id as idnew

from Tab2;

join

Tab3:

load * ,

id as idnew

from Tab3;

join

Tab4:

load * ,

id as idnew

from Tab4;

Not applicable
Author

Sorry misprint in code.

For i  = 1 to 4

Tab:

Left keep (cities)

Load

     @1 as city,

     @2 as population

From

     file$(i).txt

next i

Use keep here to load only that cities that were previously loaded in tab "cities".  At the end I want to get one table with 2 columns - city and population.

Thanx

calvindk
Creator III
Creator III

For i  = 1 to 4

Tab:

Load

     field1

From

     file$(i).txt

where exists(cities)

next i

should auto concatenate them, and limit it to the ones already existing.

Not applicable
Author

Thank you, it works. I wanted to use keep because its more flexible.

CELAMBARASAN
Partner - Champion
Partner - Champion

May be like this

Asummin that you have table with the name cities like below

cities:

Load

     City

FROM Source;

For i  = 1 to 4

Tab:

Left keep (cities)

Load

     @1 as city,

     @2 as population

From

     file$(i).txt

next i

Drop table cities;

Now Tab table has the data you need.