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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load syntax

Hi,

I am loading one table: productsA and want to load the other tables only when the Product_ID exists in the first table because the other tables have many posts that has nothing to do with productsA. How is the load syntax for that?

//Liivi

1 Solution

Accepted Solutions
Not applicable
Author

No it looks at all the already loaded ProductID's. If you only want to check against the ProductID's from the firstly loaded table but not other loaded ProductID's (if you load data between the two) you can load it with an alias, I.e:

Products:
Load
ProductID
ProductID as MyProductID,
ProductNM;
SQL SELECT ProductID, ProductNM
FROM MyTable;


ProductSpecification:
Load
ProductID,
ProductWeight
WHERE EXISTS(ProductID, MyProductID);
SQL SELECT ProductID, ProductWeight
FROM MyOtherTable;

View solution in original post

6 Replies
Not applicable
Author

Writing syntax from memory but something like this should work.

Products:
Load
ProductID,
ProductNM;
SQL SELECT ProductID, ProductNM
FROM MyTable;


ProductSpecification:
Load
ProductID,
ProductWeight
WHERE EXISTS(ProductID);
SQL SELECT ProductID, ProductWeight
FROM MyOtherTable;

/Michael

Not applicable
Author

But in this syntax you don't specify that the product_ID that I load from other table must exixt in the first table

Not applicable
Author

Yes I do. I explicitly state that ProductId must exist in the already loaded data. Hence the bold part.

Not applicable
Author

As it seems it worked,

but what happens if I want to load more tables with this sytnax, does it always look on the product_ID in the first table?

Not applicable
Author

No it looks at all the already loaded ProductID's. If you only want to check against the ProductID's from the firstly loaded table but not other loaded ProductID's (if you load data between the two) you can load it with an alias, I.e:

Products:
Load
ProductID
ProductID as MyProductID,
ProductNM;
SQL SELECT ProductID, ProductNM
FROM MyTable;


ProductSpecification:
Load
ProductID,
ProductWeight
WHERE EXISTS(ProductID, MyProductID);
SQL SELECT ProductID, ProductWeight
FROM MyOtherTable;

Not applicable
Author

Thanx a lot!!!