9 Replies Latest reply: Apr 5, 2018 3:56 AM by Marcus Sommer RSS

    Use of a variable in the load script

    Pasquale Cosimato

      Hello,

      I create a variable in the script V_DIFF:

       

      Trace ***** Dimension: min_conf_last_year *****;

      min_conf_last_year:

      Load

      min(PRT_CONFIRMDATE) as minLastConf;

      SQL Select * from "APP_CUR"."SUR_PARTICIPATION_T"

      where CAM_ID = $(v_Last_Year);

       

      Trace ***** Dimension: min_conf_this_year *****;

      min_conf_this_year:

      Load

      min(PRT_CONFIRMDATE) as minthisConf;

      SQL Select * from "APP_CUR"."SUR_PARTICIPATION_T"

      where CAM_ID = $(v_This_Year);

       

      SET V_DIFF = ROUND(minthisConf-minLastConf)


      Now I want use this variable to calculate a sum in  another table, but I get error:


      Trace ***** Dimension: Partecipant *****;

      Partecipant:

       

       

      if( Year(PRT_CONFIRMDATE) = '2016', date(floor(PRT_CONFIRMDATE + $(V_DIFF) ),'DD.MM.YYYY'), date(floor(PRT_CONFIRMDATE),'DD.MM.YYYY')) as DataUpd_Conf,

      ;

        

      SQL

      Select * from ...

       

       

      Why I cannot use the valiable like this?

      How I can do ?

       

       

      Thanks