2 Replies Latest reply: Jul 21, 2013 6:05 PM by Paul Scotchford RSS

    Use a Variable as a Script line

    Paul Scotchford

      Hi

       

      I'm a newbie to QV (but not BI e.g. SSAS etc).

       

      In my LOAD script I would like to set the value of a variable that has its definition stored in

      a database.

       

      Scenario:

      We have a Business Dictionary in our DW (SQLServer 2012) and in it I will define a

      variable called _vExecutable  it will be defined with a script line of let vCurrentYear = Lookup ('Year','Date_Key','$(zLastCompletePeriod)','CALENDAR');

       

      Of course,If I hardcoded this in the LOAD Script it would be as let vCurrentYear = Lookup('Year','Date_Key','$(zLastCompletePeriod)','CALENDAR');

      But as stated we dont want to do this except where absolutely necessary

      Requirement:

      I would like to substitute the LET statement with a Variable that defines _vCurrentYear , in a nutshell , execute variables as script lines

      Can you see where Im heading with this ?

       

      We dont want to hard code environment variables in the LOAD script, we want to utilise our dictionary

      as much as possible as this is the one stop repository for business definitions and calculations (formulas)

       

      Result:

      I did test this using EXECUTE _vExecutable  but get a "Script Line Error" , the error window does imply something did actually work as I see a value embedded in the 'Date_Key' field.

       

      Any feedback gratefully received, thanks in advance

       

      Paul

      (Brisbane, Qld)