Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Re: Select "no Match Data"

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;

6 Replies
jpapador
Valued Contributor

Re: Select "no Match Data"

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?

Re: Select "no Match Data"

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;

Not applicable

Re: Select "no Match Data"

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!

Re: Select "no Match Data"

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

Not applicable

Re: Select "no Match Data"

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.

Re: Select "no Match Data"

Hi

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

Community Browser