Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Fail a scheduled reload if no records returned.

Hi,

I would like to know if there is anything we can do to fail a reload in case of zero records in the table(Project_Labor) that was reloaded.

Here is what I have in my script:

If Alt(NoOfRows('Project_Labor'), 0) > 0 Then 

 

STORE Project_Labor into \\nwd2qvdev1\e$\Qlikview\Source Documents\Sample Folder\Project_Labor.qvd;

//ABC is non-existent column in table. I am using this to intentionally fail my reload in case of no records in my table 

ELSE Load ABC from Project_Labor;

End if;

The problem with the above code is that the reload doesn't work even when the condition is true i.e. there are greater than "0" records returned.

Any help would be appreciated!

Thanks in advance.

Archie

1 Solution

Accepted Solutions

Re: Fail a scheduled reload if no records returned.

Archie

How about something like this ?

If NoOfRows('Project_Labor') > 0 Then

trace OK;

else

trace Bad;

store rubbish into rubbish;

end if

;

Best Regards,     Bill,    

2 Replies

Re: Fail a scheduled reload if no records returned.

Archie

How about something like this ?

If NoOfRows('Project_Labor') > 0 Then

trace OK;

else

trace Bad;

store rubbish into rubbish;

end if

;

Best Regards,     Bill,    

Not applicable

Re: Fail a scheduled reload if no records returned.

Great, thanks for the quick response.

That actually did the trick

Community Browser