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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditioning Script-loading

Hi Everyone!

What I need is to condition the load of a table if one of its fields exists in another preloaded table.

Eg: I've a PRODUCT table and another one with STOCKS. So, I want to load just the rows of STOCK where the PRODUCT exists in the main table (product). SOmething like:


/******************* PRODUCTO ********************//
PRODUCT:
Load CO_PRODUCT,
NA_PRODUCT,
FROM QvD\PRODUCT.QVD (qvd);


//******************* VSTOCK ART ********************//
VSTOCK_ART:
Load co_enterprise,
co_art,
co_art AS CO_PRODUCT,
FROM QvD\VSTOCK_ART.QVD (qvd)
WHERE co_art EXISTS PRODUCT; ??????????????????????????????????????????????


I bet it's a pretty easy thing to do... riight? [:^)]

Thxs in advance!

5 Replies
justinasp
Creator
Creator


WHERE EXISTS(CO_PRODUCT,co_art)


Take care,

Justinas

Not applicable
Author

Hi Justinas! thxs for your answer..

I've implemented and i've an inquire about it.

I have the same name field (CO_PRODUCT) in other tables, it's a key one, so.. how do I delimitated the EXISTS clause to only the master table (in this case, the PRODUCT table)? ? ?

Ideas?

Thxs in advance..

johnw
Champion III
Champion III

A couple ideas. I'm sure there are a lot of other ways.

  • Load your master product table first, then do your where exists load before loading any other tables with product.
  • Load a MASTER_CO_PRODUCT in your master product table, and use that in the where exists load, then drop the field.
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP


leonor.ferrebuz wrote:
I have the same name field (CO_PRODUCT) in other tables, it's a key one, so.. how do I delimitated the EXISTS clause to only the master table (in this case, the PRODUCT table)? ? ?


Load the PRODUCT table first. On every subsequent load, specify WHERE EXISTS(CO_PRODUCT). You will never load another value of CO_PRODUCT that didn't exist in PRODUCTS.

-Rob

Not applicable
Author

Ook! thxs...

At the end what I did was:

WHERE EXISTS (CO_PRODUCT,co_art); Because in this table the cod of the product doesnt have the same name than the one in the main table (co_art). I'm still verifying that the filter is working as it should.

To be "sure" of wich CO_PRODUCT it's taking, I created an auxiliar field, and because of the table is qualify I do:

WHERE EXISTS (PRODUCT.CO_PROD_AUX,co_art);

Thxs for your answer!