1 Reply Latest reply: Apr 17, 2013 10:23 AM by Marcus Sommer RSS

    Store variable value into an external qvs file and use them in load script of another qlikview file.

      Hello everyone,

       

      I need to know how can I store value of a variable (that is provided by user through some input box on front end), into a qvs file in the following format:

       

      set parameter1 = $(variable1)

      set parameter2 = $(variable2)...and so on..

       

      So that I can read this qvs file from load script of another qlikview file and use the parameter values to modify my data load.

        • Re: Store variable value into an external qvs file and use them in load script of another qlikview file.
          Marcus Sommer

          I believe this is not possible ... but you can write it in txt-files and load it as include-variable in other qvw. You needed a trigger on the variable, which run by change and triggered a macro like this:

           

          public sub Write

           

          Dim fso, File, FilePfad, FileName, varName, varValue

           

          varValue= ActiveDocument.Variables("vValue").GetContent.String

          varName= ActiveDocument.Variables("vName").GetContent.String

           

          Set fso = CreateObject("Scripting.FileSystemObject")

          Set File = fso.OpenTextFile(FilePfad & FileName, 2, true)

           

          File.Writeline "let " & varName & " = '" & varValue & "';"

          File.Close

           

          Set fso = Nothing

          Set File = Nothing

           

          end sub

           

          variablen-load:

          $(Include=FilePfadFileName.txt);

           

          - Marcus