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: 
kkkumar82
Specialist III
Specialist III

How can we write this SQL query in edit script

All,

How can we write this query in edit script. Attached is a pic.query.png

Kiran Kumar

1 Solution

Accepted Solutions
kkkumar82
Specialist III
Specialist III
Author

All,

I got the thing what I want, thanks petter I changed the query by including the database names before the tables .

Thanks

Kiran Kumar

View solution in original post

8 Replies
Digvijay_Singh

Not sure may be like this, tried to create pseudo script backward -

T1:

Load distinct mpn

from Manufacture

T2:

Load distinct lpn,mpn

from part_matching

Where exists (mpn);

T3:

Load *

From part_matching

Where exists(lpn)

Drop table T1,T2

juleshartley
Specialist
Specialist

Or using joins:

Table1:

Load distinct mpn from Manufacturer;

inner join(Table1)

Load distinct mpn, lpn from xx_Part_Matching;

inner join (Table1)

Load lpn, field 1, field 2 etc.

from yy_Part_Matching;


Anonymous
Not applicable

Why do you want to write this query in edit script? I would create a SQL View with this query and in Qlikview only select * from View.

kkkumar82
Specialist III
Specialist III
Author

Thanks all,

I don't have a chance to create a view here, but I will try to create it. Just curious will the above two suggestions one with resident loads and another one with joins give the same result.

Thanks

Kiran Kumar

petter
Partner - Champion III
Partner - Champion III

You don't need to create a view. You can use exactly the same SQL in the SQL part of the load script:

LOAD * ;

SQL

select * from xxxx_part_matching where lpn in (

     select distinct lpn from yyyy_part_matching where mpn in (

        select distinct mpn from manufacturer_part_number

        )

     );

This might be the fastest and most efficient solution for you. Since you will filter out unnecessary data at the earliest possible stage ...

kkkumar82
Specialist III
Specialist III
Author

Hi Petter,

I observed that the both tables are from different databases , so, it is possible to do the same using the above query by putting the database names before the tables.

Hope you got my point.

Thanks

Kiran Kumar

kkkumar82
Specialist III
Specialist III
Author

All,

I got the thing what I want, thanks petter I changed the query by including the database names before the tables .

Thanks

Kiran Kumar