Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Not applicable

Data-driven NPrinting distribution

I want to set up a distribution from NPrinting that sends exactly once when a variable in my qvw is set to 1 (which happens when a certain data condition is met in the document). I don't care what time the distribution goes out, just as soon as the variable equals 1. Is there a way to set this up?

Essentially, I want the NPrinting task to refresh the qlikview document every 15 minutes, check that variable, and if it's 1, send the distribution and stop refreshing after that.

1 Solution

Accepted Solutions
mikecrengland
Contributor III

Re: Data-driven NPrinting distribution

We found an answer to this.

We set up a new task/report that saves off an Excel sheet with a single value (null if complete, 1 if not.) We added that Excel sheet into the script as a one cell data island.

The Job now has three tasks

1 - Reload

2 - Run the report with a condition set that if this new field has values, send the report

3 - Run the new report that updates the Excel sheet

This way the report sends up to and including one time where everything is refreshed.

Mike

7 Replies

Re: Data-driven NPrinting distribution

Using the QMC/QlikView Publisher, you can set up tasks like the following:

  • Create a task to run the QlikView dashboard every 15 minutes
  • Create a second task to run the NPrinting task on successful completion of the previous task
    • The NPrinting task should have a condition on it that checks if the variable is set to 1

In this setup, the NPrinting task will run each time the document runs, but the condition will keep it from actually sending the report out.

Not applicable

Re: Data-driven NPrinting distribution

I don't understand, how does a QMC control an NPrinting task? And how would this setup stop after one successful distribution?

Employee
Employee

Re: Data-driven NPrinting distribution

Hi Nicole,

Won't the second task continue to run every 15 minutes after the variable is set to 1?

It will be useful to know how often the task should run. If it's maximum once a day I suggest adding a second control, say a variable vDateRun which holds the value of the date when the original variable vRun is set to 1

Pseudo code something like:

IF vRun = 1 AND vDateRun = Today() THEN

   vRun = 0 // NPrinting will not send out the reports because that's already been done today

END IF   

IF vRun = 1 and  vDateRun <> Today() THEN

  vDateRun = Today() // NPrinting will send out the reports this iteration

  // Next iteration the previous IF will be satisfied as long at the vDateRun is still today

END IF

HTH - Daniel.

Employee
Employee

Re: Data-driven NPrinting distribution

Hi Bradley,

Nicole is probably referring to this: How to Distribute Reports after Successful .qvw Reload on a QlikView Server with Publisher

HTH - Daniel.

Re: Data-driven NPrinting distribution

Won't the second task continue to run every 15 minutes after the variable is set to 1?

Good catch, Daniel.

@ Bradley - You can either have one variable that has your check + Daniel's and use that as a condition.  Or have two variables (yours and Daniel's) and have two conditions.

Re: Data-driven NPrinting distribution

This is what I was referring to.  I wasn't aware that there was documentation about it, so thanks for sharing!

mikecrengland
Contributor III

Re: Data-driven NPrinting distribution

We found an answer to this.

We set up a new task/report that saves off an Excel sheet with a single value (null if complete, 1 if not.) We added that Excel sheet into the script as a one cell data island.

The Job now has three tasks

1 - Reload

2 - Run the report with a condition set that if this new field has values, send the report

3 - Run the new report that updates the Excel sheet

This way the report sends up to and including one time where everything is refreshed.

Mike

Community Browser