Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Specialist III
Specialist III

Re: How can we write this SQL query in edit script

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
Highlighted
Champion III
Champion III

Re: How can we write this SQL query in edit script

Highlighted
Master III
Master III

Re: How can we write this SQL query in edit script

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

Highlighted
Specialist
Specialist

Re: How can we write this SQL query in edit script

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;


Highlighted
Creator
Creator

Re: How can we write this SQL query in edit script

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.

Highlighted
Specialist III
Specialist III

Re: How can we write this SQL query in edit script

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

Highlighted
MVP
MVP

Re: How can we write this SQL query in edit script

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

Highlighted
Specialist III
Specialist III

Re: How can we write this SQL query in edit script

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

Highlighted
Specialist III
Specialist III

Re: How can we write this SQL query in edit script

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