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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Optimized Load

Hi,

I'm loading a customer table and some customers are active and others are not.  There is an active customer field that is flagged with a Y for active and N for nonactive.  How can I load the table, filter to only active customer and have an optimized load?

the table has the following fields:

Customer_ID

Customer_Name

Customer_ActiveFlag

Kathleen

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Do an Inline Load to a temporary table with just one field [Customer_ActiveFlag] and just one row of value 'Yes'

Then do your load from qvd with a Where Exists clause on your [Customer_ActiveFlag] - this will be optimized.

Finally drop your temporary table

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Do an Inline Load to a temporary table with just one field [Customer_ActiveFlag] and just one row of value 'Yes'

Then do your load from qvd with a Where Exists clause on your [Customer_ActiveFlag] - this will be optimized.

Finally drop your temporary table

Anonymous
Not applicable
Author

Not sure where your Customers table comes from DB, Excel....?

Customers:

LOAD Customer_ID,

     Customer_Name

SQL SELECT *

FROM Customers

WHERE Customer_ActiveFlag='Y';

Anonymous
Not applicable
Author

Thanks Bill - this worked well.  I appreciate your insight.

Kathleen

Anonymous
Not applicable
Author

The Customer data is in a qvd which is generated from our TMS system.

johnw
Champion III
Champion III

I tend to use autogenerate (often with subfield to easily generate all combinations of multiple values in multiple fields, not relevant here), then inner join. Pretty much functionally identical. Just a slightly different way of doing the same thing.

[Customer]:
LOAD 'Y' as [Customer_ActiveFlag]
AUTOGENERATE 1
;
INNER JOIN ([Customer])
LOAD
[Customer_ID]
,[Customer_Name]
,[Customer_ActiveFlag]
FROM Customer.qvd (QVD)
WHERE exists([Customer_ActiveFlag])
;

Vs.

[Temp]:
LOAD * INLINE [
Customer_ActiveFlag
Y
];
[Customer]:
LOAD
[Customer_ID]
,[Customer_Name]
,[Customer_ActiveFlag]
FROM Customer.qvd (QVD)
WHERE exists([Customer_ActiveFlag])
;
DROP TABLE [Temp];

Anonymous
Not applicable
Author

Thanks John - this works too. 

Kathleen