Discussion Board for collaboration on QlikView Scripting.
I want to work with 2 Sources in Qlikview, well thats the strenght of QV I think, but I dont know, how to manage that:
I have 2 sources like this:
SQL SELECT * FROM XDB;
Adresse // (-> = Adressname+Nr)
SQL SELECT * FROM YDB;
I have following data:
in S1(XDB) are old data from 2010- June2014
in S2(YDB) are newer data with active people from 2010 - today..
I want to split this in 2 types/table: Person and Adress
How can I realize that in Script ?
Go to Solution.
Assuming that KeyNr can be used to check if data exists, you can use something like:
KeyNr as NrKey,
Resident S1 where not exists('NrKey', KeyNr);
DROP Table S1;
Edit: note that I change the order tables were read from SQL, so we load all records from S2 and only those not previously loaded from S1
hi.. it would be helpful if you let us know, u want to concat and show all details or is it on demand data share of old and new data..
You can concatenate both tables withalias so the fields will be the same:
Addressname & AddressNr as Adresse
NrKey as KeyNr,
Then you can divide data in 2 tables leaving Adresse or the field you want as link in both tables.
DROP Table TempData;
But is it possible, to say that I, just want the data of S2(YDB) if it exist, if not- so from S1 ? Like Address,..
Now it shows me 2 same lines (1 from S1 with A& B as Adress, 2. from S2)
Well, after SQL.. FROM DB I cant use where not exists..
Check my previous post:
Dont you mean drop table Temp?
That code was to be inserted before loading Person and Address tables, after loading these tables you can drop Temp table.
S1 Table has to be dropped too, this can be done after concatenate S2 Table on Temp table or when Temp table is dropped.
Full code will be:
So all in all it looks like this:
SQL SELECT * FROM YDB
S2: //Basic data
SQL SELECT * FROM XDB
Load NrKey as Keynr...
Resident Temp_S1 Where not exist('KeyNr', NrKey);
Load Keynr, Name,...
Load Keynr, ...
after all -> drop table Temp_S1 & S2
Am I right?