3 Replies Latest reply: Apr 18, 2017 4:13 PM by Morris Paschall RSS

    EDX Triggers via Files or Other

    Jeremy Schmitt

      So I have randomly searched this topic for over a year and never found a gratifying answer...

       

      We have a couple reports for our Finance group here. These reports are only updated once there are a couple files produced and/or when a table has been updated. The timing on these can be inconsistent, but are the reports require updating as soon as possible.  Now most of the time I am available and I can refresh these reports as soon as they are needed, but occasionally myself or our backup are not available at that moment.

       

      Is there a way...does someone have an example... can someone clearly explain... what is the easiest way to refresh these reports and take the need for our IT team to be present when these reports need updating? We would prefer to automate the refreshing of these reports, but I'm not sure of the best way to approach this.

        • Re: EDX Triggers via Files or Other
          Miguel Angel Baeyens de Arce

          EDX would work if you have an external process which can communicate with QlikView via QMS API (like the command line tool that you have already seen here: Using EDX in QlikView 11 - basic example and here Using EDX in QlikView 11).

           

          There are less sophisticated but good working solutions where you have a task that reloads every minute or five minutes that checks for a value in a table, or a field, or for the timestamp of a file and then triggers the rest of the script, like.

           

          LastLoaded:
          LOAD Timestamp;
          SQL SELECT LastLoaded
          FROM Table;
          
          LET vLoad = Peek('Timestamp', 0, 'LastLoaded');
          
          IF '$(vLoad)' <= XXX THEN // the condition for the load goes here
          
          // The whole app script goes here
          
          ELSE
          
          EXIT SCRIPT;
          
          END IF
          

          You can also play with the variables ErrorMode and ScriptError and the function EXIT SCRIPT to trigger the next task in the chain.

           

          The question is, how do you know that those reports have been produced? Do you get any alert or email or is it just checking from time to time and see if the new files are there?

           

          EDX as in using the QMS API is very handy when you have a way to execute CMD.exe commands from your source system, which is not always the case and that's why you probably have not seen the detailed steps to create a solution to your issue, also because it means developments with C# or Javascript that not everybody is keep to share.

          • Re: EDX Triggers via Files or Other
            Paul Routledge

            Sounds to me like you want some kind of File Watcher facility. Many enterprise scheduling tools like Control-M or Autosys provide this functionality, not sure if you have that kind of infrastructure available.

             

            There are also smaller, non enterprise file watcher utilities or you could roll your own in .NET, take a look in this area FileSystemWatcher Class (System.IO)

             

            But ultimately if you had some kind of file watcher functionality where the action triggered by the arrival/updating of the file is to call EDX you would have your solution. But EDX on it's own will not be sufficient.