How to Run a Task Only after Previous QlikView Document Reload on Current Day

    This tutorial explains how to run an NPrinting task only if the QlikView document has been reloaded. Control is based on a variable in the QlikView document. The variable contains the date and time of the last reload. The NPrinting report task contains a condition that checks the variable and reports will be generated only if the QlikView document has been reload that same day. Create a frequently executed schedule that runs the conditioned task. The process is very fast if the condition is not satisfied.

       
       
           
             

    Create New QlikView Variable

                       
                Create-New-QlikView-Variable.png                   
             

    Use QlikView to open SalesDemo.qvw found in the C:\NPrintingTraining\QlikViewDocuments\ folder

    1. Click on Settings
    2. Click on Variable Overview
           
           
           
             

    Start New Variable Creation Process

                       
                Start-New-Variable-Creation-Process.png                   
             

    Click on the Add button.

           
           
           
             

    Name New Variable

                       
                Name-New-Variable.png                   
             
    1. Enter IsQVReloaded as the Variable Name
    2. Click on the OK button
           
           
           
             

    Configure Variable

                       
                Configure-Variable.png                   
             
    1. Make sure IsQVReloaded is selected in the Variables field
    2. Enter the formula =(TEXT(DATE(ReloadTime(), 'YYYYMMDD')) = TEXT(DATE(Today(), 'YYYYMMDD'))) in the Definition field box
    3. Click on the OK button
           
           
           
             

    Begin Condition Creation

                       
                Begin-Condition-Creation.png                   
             
    1. Select Conditions
    2. Conditions is pre-selected
    3. Click on Condition in the New group
           
           
           
             

    Configure Condition

                       
                Configure-Condition.png                   
             
    1. Enter IsQVReloaded as the condition Name
    2. Enter a Description optionally
    3. Clicking on the browse button to the right of the Variable field
    4. Select the IsQVReloaded variable from the selection list
    5. Make sure the relationship is set to is equal to
    6. Set Value to -1
    7. Click on the Save and Close icon in the Actions group
           
           
           
             

    Begin Excel Report Creation

                       
                Begin-Excel-Report-Creation.png                   
             
    1. Select Reports
    2. Select Excel reports
    3. Click on Excel Report in the New group
           
           
           
             

    Identify Report

                       
                Identify-Report.png                   
             
    1. Enter ExcelReport - IsQVReloaded as the report Name
    2. Enter a Description optionally
           
           
           
             

    Add Condition to Report

                       
                Add-Condition-to-Report.png                   
             
    1. Select the Conditions icon in the Show group
    2. Click on the Add icon in the Conditions group
    3. Select the IsQVReloaded condition
    4. Click on the OK button
           
           
           
             

    Open New Template in Template Editor

                       
                Open-New-Template-in-Template-Editor.png                   
             

    Click on the New icon in the Template group

           
           
           
             

    Add and Embed Table

                       
                Add-and-Embed-Table.png                   
             
    1. Add CH212 - Over Time object as a table and then drag and drop it into the template, see: How to Create Excel Reports
    2. Click on the Save and Close icon in the Actions group to save the template and close the Template Editor
           
           
           
             

    Save and Close Report

                       
                Save-and-Close-Report.png                   
             

    Click on the Save and Close icon in the Actions group of the tool bar to save the report and close the configuration window.

           
           
           
             

    Open New Report Task

                       
                Open-New-Report-Task.png                   
             
    1. Select Tasks
    2. Select Report Tasks
    3. Click on Report Task in the New group
           
           
           
             

    Configure Report Task

                       
                Configure-Report-Task.png                   
             
    1. Enter IsQVReloaded as the task Name
    2. Enter a Description optionally
    3. Task output folder.

    Add recipients and an e-mail message if you desire.

           
           
           
             

    Add Report to Report Task

                       
                Add-Report-to-Report-Task.png                   
             
    1. Select the Reports icon in the Show group
    2. Click on the Add icon in the Reports group
    3. Begin entering a key word of the report title in the Search field
    4. Select ExcelReport - IsQVReloaded if there is more than one candidate report
    5. Click on the OK button or, if there is only one candidate, hit the Enter key on your keyboard
           
           
           
             

    Run IsQVReloaded Task

                       
                Run-IsQVReloaded-Task.png                   
             

    After Saving and Closing the Task:

    1. Make sure it is selected in the task list
    2. Click on the Run icon in the Task group
           
           
           
             

    Note Warning

                       
                Note-Warning.png                   
             

    The Warning: The condition “IsQVReloaded” for the report “IsQVReloaded” was not met tells us IsQVReloaded condition has not been satisfied and so ExcelReport - IsQVReloaded generation is terminated and nothing is distributed.

           
           
           
             

    Create New Job

                       
                Create-New-Job.png                   
             
    1. Select Schedules
    2. Select Jobs
    3. Click on Job in the New group
           
           
           
             

    Configure IsQVReloaded Job

                       
                Configure-IsQVReloaded-Job.png                   
             
    1. Create a job named IsQVReloaded, see: How to Create Jobs
    2. Open the Select Tasks window
           
           
           
             

    Add Tasks to Job

                       
                Add-Tasks-to-Job.png                   
             
    1. Add the Reload QlikView Docment and IsQVReloaded tasks to the job in sequence
    2. Save and Close the job
           
           
           
             

    Run "IsQVReloaded" Job

                       
               Run--IsQVReloaded--Job.png                    
             
    1. Make sure the IsQVReloaded job is selected
    2. Click on the Run icon in the Job group

    The reload will be executed and the report generated and distributed as long as the condition is met.

    If you reload a QlikView docment stored on a QlikView server, you can create a job containing only a task that sends the report and schedules it. NP sends the report only if the QlikView docment has been updated.

           
           
           
             

    Successful Report Generation and Distribution

                       
                Successful-Report-Generation-and-Distribution.png                   
             

    Note that The condition “IsQVReloaded” for the report “IsQVReloaded” was met.

           
           
           
             

    Inspect Report

                       
                Inspect-Report.png                   
             

    Open the Excel - IsQVreloaded.xlsx file in C:\NPrintingTraining\Output to inspect it.