Qlik Community

QlikView Publisher

Discussion Board for collaboration on QlikView Publisher.

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.
paputzback
New Contributor II

How do you handle reloads that return no results

We have an app that once in a blue moon one of the scripts doesn't return data. If we re run the app it loads fine. Now I know there is more research to be done on finding out why that is happening. But for right now, I am being told to come up with a solution to notify someone if a table comes back with zero records. FYI, I am the server admin, not the developer. But in my limited knowledge of the application, I would think there would be a way to fail the reload if a script returns zero rows or less than a certain parameter, or have the script email the admins if it returns zero rows. And maybe it could even reschedule itself to run 10 minutes later.

Thanks,

Phil

1 Solution

Accepted Solutions
MVP
MVP

Re: How do you handle reloads that return no results

To also have a wait and retry:

Retries = 0;

DO

    Retries = Retries + 1;

    Customers:

    LOAD

      .....;

    WHEN NoOfRows('Customers') = 0 AND Retries < 5 SLEEP 600000;    // Wait 10 minutes before next retry

LOOP UNTIL Retries = 5 OR NoOfRows('Customers') > 0

EXIT SCRIPT WHEN NoOfRows('Customers') = 0;

6 Replies
MVP
MVP

Re: How do you handle reloads that return no results

You can use the function NoOfRows ('tablename')

and check for 0.

Re: How do you handle reloads that return no results

Perhaps this video from QlikCentral helps:


talk is cheap, supply exceeds demand
MVP
MVP

Re: How do you handle reloads that return no results

For example like this:

Customers:

LOAD

     *;

SQL

     SELECT

          *

     FROM

          Customers;

Exit Script When NoOfRows('Customers') = 0;

paputzback
New Contributor II

Re: How do you handle reloads that return no results

So a force exit of the script throws an error?

MVP
MVP

Re: How do you handle reloads that return no results

To also have a wait and retry:

Retries = 0;

DO

    Retries = Retries + 1;

    Customers:

    LOAD

      .....;

    WHEN NoOfRows('Customers') = 0 AND Retries < 5 SLEEP 600000;    // Wait 10 minutes before next retry

LOOP UNTIL Retries = 5 OR NoOfRows('Customers') > 0

EXIT SCRIPT WHEN NoOfRows('Customers') = 0;

MVP
MVP

Re: How do you handle reloads that return no results

No it doesn't ... there is no statement to throw an error really... maybe simulating it by doing something that throws an error - a bit ugly but it works...

Community Browser