Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Posb1
Contributor
Contributor

Using variable to define load conditions

Hi,

I am writing a load script and want to use the same condition when loading tables on multiple occasions. The condition is simple: I want to load only where a reference field is bigger than a certain number. But, I want to be able to change this later without having to go back and change it in all these places. I hoped making a variable (SET vMinRef = '1000';) and then using this in the  where clause (WHERE ref  >= vMinRef;) would do the trick. But this won't work, saying it can't find the field. 

Is it possible to do this in the load script? How should I go about this?

1 Solution

Accepted Solutions
chrismarlow
Specialist II
Specialist II

Hi,

I think in your load you need to wrap the variable in $(), so ref>=$(vMinRef).

Cheers,

Chris.

View solution in original post

2 Replies
chrismarlow
Specialist II
Specialist II

Hi,

I think in your load you need to wrap the variable in $(), so ref>=$(vMinRef).

Cheers,

Chris.

Posb1
Contributor
Contributor
Author

Thanks Chris,

This worked great. I must have overlooked this in the documentation. Thanks!