Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select "no Match Data"

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".

1 Solution

Accepted Solutions
MayilVahanan

HI

Create a dummy field in a script.

Like

FirstTemp:

Load *  from Firsttable;

Left join (FirstTemp)

Load productID,'Second' as flag from secondtable;

First:

Load If(IsNull(flag), 'Not in the Second', 'In the Second') As flag1 , * resident FirstTemp;

Drop table FirstTemp;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

6 Replies
jpapador
Partner - Specialist
Partner - Specialist

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?

MayilVahanan

HI

Create a dummy field in a script.

Like

FirstTemp:

Load *  from Firsttable;

Left join (FirstTemp)

Load productID,'Second' as flag from secondtable;

First:

Load If(IsNull(flag), 'Not in the Second', 'In the Second') As flag1 , * resident FirstTemp;

Drop table FirstTemp;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

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?

Tks again!

MayilVahanan

HI

Try like this

Script begins:

//Join the first and second table by using Chassi and create the dummy field as flag

TempTable:

Load *  from Faturamento ;

Left join (TempTable)

Load Chassi,'Second' as flag from Contratos;

//Create flag for the selection purpose after join both tables

First:

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

Second:

Load * from Contratos;

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

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.

MayilVahanan

Hi

Can you please close the post, if you get the answer.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.