Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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?
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;
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
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.
Thank you, it works. I wanted to use keep because its more flexible.
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.