Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anku
Creator
Creator

Extract only Open records

Hi all,

I am working with QVD file consists Orders data. Please refer below:

Anku_0-1633327659350.png

I am trying to create a table having Open orders only. For example, in above scenario only, 45632.

I can't use Where clause as it will only exclude the one record for closed orders only. Kindly suggest.

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

The following could perhaps be a solution:

TempTable:
Load Order_ID as ClosedOrders From SourceFile.qvd (qvd) Where Status='Closed';

Data:
Load * From SourceFile.qvd (qvd) Where not Exists(ClosedOrders,Order_ID);

Drop Table TempTable;

View solution in original post

3 Replies
hic
Former Employee
Former Employee

The following could perhaps be a solution:

TempTable:
Load Order_ID as ClosedOrders From SourceFile.qvd (qvd) Where Status='Closed';

Data:
Load * From SourceFile.qvd (qvd) Where not Exists(ClosedOrders,Order_ID);

Drop Table TempTable;

Anku
Creator
Creator
Author

Thanks Henric,

2 queries, just to enhance my understanding:

>For table data, can we use resident load ( which one is more preferable?)

>Condition we have used : where not exists, can we use the fields in this clause even they belongs to another table?

 

Thanks:)

hic
Former Employee
Former Employee

Yes, you can use resident load. But if you work with qvd files, loading from a file is probably just as fast, so there is no real advantage using resident load.

Yes, the first parameter of the Exists() can point to a field from a previously loaded table. The second parameter must however be from the current table.