Discussion Board for collaboration on QlikView Scripting.
I need some help!!!!
I have two tables. The first one contains all products, the second one contains just some of them with other information.
Both have the same ID Product.
I want to select just the products that ARE NOT in the second table, but every selection I tried, or I had all lines, or I had the match points.
How do I do this?
It will nice if I get to create a Field as "Not in the second" or "In the second".
Go to Solution.
Create a dummy field in a script.
Load * from Firsttable;
Left join (FirstTemp)
Load productID,'Second' as flag from secondtable;
Load If(IsNull(flag), 'Not in the Second', 'In the Second') As flag1 , * resident FirstTemp;
Drop table FirstTemp;
Could you just select all the data from the second table and then look and see which product ID's in the first table are greyed out?
Tks for reply, I'm a little bit weak in Script.
I'll crate this TempTable after the charge of the originals or Before?
My first Table is Faturamento and the Second, Contratos.
The key field is Chassi.
How can I build this script?
Try like this
//Join the first and second table by using Chassi and create the dummy field as flag
Load * from Faturamento ;
Left join (TempTable)
Load Chassi,'Second' as flag from Contratos;
//Create flag for the selection purpose after join both tables
Load If(IsNull(flag), 'Not in the Second', 'In the Second') As flag1 , * resident TempTable;
// Drop the temporary Table
Drop table TempTable;
//Load the second Table
Load * from Contratos;
Hope it helps
Tks a lot. It's working very well.
I needed load each field, 'cause I changed some field names in the place of load *, but in general worked very well.
At the first I was trying to load twice the same database, but now I understood the logical.
Can you please close the post, if you get the answer.