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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Which method should I use...?

Hi


I have two tables;

     The first is an Order Header file and

     The second contains the Order Lines. 


The only piece of information I am interested in from the Order Header table is the  order status. 

What I want to do is only import data from the Order Lines table WHERE the Order Header order status = 5 or 6.


Table One

Order number
Order status
...
123455...
234563...
456786...


Table Two

ItemQtyOrder no....
Plum10012345...
Orange20012345...
Apple30012345...
Apple40023456...
Grapes50023456...
Peach60023456...
Fig70045678...
Peach80045678...
Apple90045678...


Desired Result

ItemQtyOrder no....
Plum10012345...
Orange20012345...
Apple30012345...
Fig70045678...
Peach80045678...
Apple90045678...


Because I have a one to many relationship and I don't want any info in the model from Table Two, I have no idea which method I should be using.


Thank you for your help.


Oli


1 Solution

Accepted Solutions
Not applicable
Author

Hi,

I would do:

LOAD the first table in a temp table with the condition you want

LOAD the second table with the exists function : where exists([Order Number], [order No])

Drop the temp table

Fabrice

View solution in original post

6 Replies
Not applicable
Author

Hi,

I would do:

LOAD the first table in a temp table with the condition you want

LOAD the second table with the exists function : where exists([Order Number], [order No])

Drop the temp table

Fabrice

sujeetsingh
Master III
Master III

Load distinct and filter the data with conditions.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Load all the data and add a listbox for Order status. Then simply select the order status values you're interested in.


talk is cheap, supply exceeds demand
Not applicable
Author

As I am still very new to this I have a question from a best practice point of view.

If load time is not a factor (due to over night schedule) should I go down the route of Aunez's method to avoid too much data in the model but at the expense of the load time?

Thank you all for you guidance.

Oli

Not applicable
Author

it depends on what the users want to see:

- everything (all Order status) : ListBox

- some part (because the other order status are meaningless): filter during the script

Fabrice

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Unless users shouldn't be allowed to see certain data at all or the amount of data causes performance problems, I'd say load all the data.


talk is cheap, supply exceeds demand