Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Restricting QVD Load by dimensions already loaded

Hi all,

Currently we have an Application selecting Data from QVD files (one per Table).

Please look at the following:

Orders:
LOAD * FROM orders.qvd (qvd);

Positions:
LOAD * FROM positions.qvd (qvd);

Currently this also selects positions that have no correlating orders, what I'd like to do is restrict the positions load to only those with an order_id located in the id-column of the Orders table.

The first thing coming to my mind is concatenating all entries in the Orders.Id Column to a large string and in the next step filtering by this string using where order_id in. But then again, there should be a more native way of doing this in QV, shouldn't there?

Any hints highly appreciated!

Thanks

2 Replies
brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi,

you can use the funtion exists(), something like this:

Orders:
LOAD ID,

     ...

FROM orders.qvd (qvd);

Positions:
LOAD ID,

     ...

FROM positions.qvd (qvd)

Where Exists(ID);

QlikView now load only IDs from Positions, when it was already loaded by Orders.

flipside
Partner - Specialist II
Partner - Specialist II

Another way would be to use joins ...

Load * from orders.qvd (qvd);

INNER JOIN

Load * from postions.qvd (qvd);

This would return only data where Order ID exists in both tables.

If you need to still return rows from Orders which do not exist in Positions then use a LEFT JOIN statement.