3 Replies Latest reply: Jun 9, 2010 5:02 PM by flores RSS

    Setting load script variable to previously loaded value

      Is it possible to set a variable to the value of a field that has been previously loaded in the load script? I'm trying to use a database to drive the configuration of various application settings. I have a table that will always contain one row of configuration data when loaded into QlikView - that table would store the configuration data I'm trying to use in variables. The table structure looks something like this:

      ProjectID ConfigSetting1

      X Foo

      Y Bar

      First I load my table into QlikView:

       

      ConfigTable:
      SQL
      SELECT *
      FROM ConfigTable
      WHERE ProjectID = 'X';


      I then want to use the value of ConfigSetting1 to set a variable:

       

      SET vConfigSetting1 = ConfigSetting1;


      That syntax doesn't work, so I tried a bunch of variations with SET, LET and dollar-sign expansion, all to no avail. My ultimate goal is to use this variable when building a string so I can conditionally pull in a project-specific include file later in the load script. For example:

       

      TableWithProjectSpecificLoadLogic:
      $(Include=$(vEnvironment)\Includes\ThisIncludeFile_$(vConfigSetting1).txt);


      Any help is appreciated.

      Thanks,

      Jim