2 Replies Latest reply: Aug 26, 2015 8:10 AM by Tobias Lutz RSS

    Script parameters set in QlikView Management Console are ignored

      Hi all,

       

      I am an active reader of this forum and could so far resolve all of my QlikView issues with the help of your discussions. But now I am stuck.


      In order to distribute my QlikView Application, I uploaded the .qvw-file in the SourceDocuments folder on the QlikView Server and set up a task in the QlikView Management Console (QVMC). For section access and individual access to document sheets, I use two external Excel files. The path to these Excel files is set in the script as follows:


      set vImport_Document_Path = 'C:\TL\QlikView\Project\ExternalData\';


      Execution of the task on the QlikView Server works fine.


      Now starts the hassle. I want to declare exactly the same variable in QVMC with the path to the two external excel files on the QlikView Server (this makes sense for me in order to perform local tests without having to change anything in the script). On the Reload tab in the section "Script Parameters", I have the possibility to set a “Parameter name” and a “Parameter value”. I did this as follows:


      Parameter name: vImport_Document_Path

      Parameter value: C:\ProgramData\QlikTech\SourceDocuments\ExternalDocuments\


      But QlikView-Server constantly ignores these values. Instead it takes the corresponding value from the script.


      Thanks in advance,

      Tobias

        • Re: Script parameters set in QlikView Management Console are ignored
          Peter Cammaert

          If you say "Instead it takes the corresponding value from the script", that means that you are setting the same variable in the script as well, thereby always overriding the value passed as a parameter. Using variables to pass values is tricky stuff.

           

          A solution to this can be as follows:

           

          • In your document, clear the value of your variable in Settings->Variable Overview
          • At the end of your script, add a line like: LET vImport_Document_Path = ''; That will make sure that at the start of the next reload, the variable exists (necessary for passing parameter values) and contains nothing (see further)
          • Now in your script (probably at the beginning) make the assignment of a default value to your variable conditional. Only set the variable if it is empty (meaning that no value has been passed from QDS). You can use a test like
            IF '$(vImport_Document_Path)' = '' THEN ...

           

          Should work.

           

          Peter