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

Filtering data in script

Hi All,


I am using the script below to pull data from a table. I only want to pull data where TranDateTime > 2008 or if the AccountNumber exists in the Account table. I have a QVD called Accounts.qvd that has AccountNumber but am not sure how to use an OR clause in the script. Any idea how to do this?


Thanks in advance for your help!


Transactions :

LOAD 

AccountNumber,

TranDateTime,

Amount

FROM (qvd)

WHERE YEAR(TranDateTime) > 2008 OR AccountNumber IN(LOAD AccountNumber FROM )

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

As per my knowledge, using Exists() is the best way, also I think it is the only way. Exists is a faster way, since you need subquery like feature, but in qlikview scripting there is no such concept.

Regards,

Jagan.

View solution in original post

4 Replies
Not applicable
Author

You can use the 'Exists' to check whether the account number exists in the QVD.

Regards,

Raj.

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try script below

Accounts:

LOAD

     *

FROM (qvd)

Transactions :

LOAD 

AccountNumber,

TranDateTime,

Amount

FROM (qvd)

WHERE YEAR(TranDateTime) > 2008 OR EXISTS(AccountNumber);

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Thanks Jagan, is there any other method? I am relucatat to use EXISTS as it checks record by record and so is slow. Thanks for your help!

jagan
Partner - Champion III
Partner - Champion III

Hi,

As per my knowledge, using Exists() is the best way, also I think it is the only way. Exists is a faster way, since you need subquery like feature, but in qlikview scripting there is no such concept.

Regards,

Jagan.