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

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

Tags (1)
6 Replies
celambarasan
Not applicable

Re: Keep with concatenate

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

Re: Keep with concatenate

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

Re: Keep with concatenate

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
Not applicable

Re: Keep with concatenate

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

Re: Keep with concatenate

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

celambarasan
Not applicable

Re: Keep with concatenate

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.