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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
tresB
Champion III
Champion III

Load Exit - Conditional

Hello,

I want my load script to stop once a certain value is reached for a field. Something like :

Load   A,

          B

From .... exit/stop load(should not exit script) when found B='XX'(line number is not fixed, so can't use recno());

Thanks in advance. 

Labels (1)
11 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I don't think so. I'm afraid you'll need something like this:

T1:

load B, if(B='XX',recno()) as flag

from ...somewhere...;

T2:

load min(flag) as firstmatch

resident T1;

Let vFirst = peek('firstmatch');

drop table T1, T2;

T3:

first $(vFirst)

load * from ...somewhere...;


talk is cheap, supply exceeds demand
tresB
Champion III
Champion III
Author

Yes Gysbert, as i mentioned earlier - "using multiple stages (storing to qvd and then using flag or variable), may be i can achieve the same" - seems that, this is the way(like you suggested) i have to follow. Probably there is no direct way/function/command to break out from the LOAD process.

Anyway thank you all.