1 Reply Latest reply: Sep 6, 2017 9:33 PM by Juan Moreno RSS

    Variable does not seem to update in published app

    Juan Moreno



      I have a variable called "vMaxTimePeriodIdx" in my load script. If from the Data Load Editor, I click "Load Data", this variable gets a new value according the script, and everything works as expected.

      However, if I publish the app and I set up a periodic reload, this variable does not seem to update. I have a trace in the load script, so I can see in the log that the variable takes the corresponding new value, but if I put a KPI or any other object in a dashboard it remains with the value previous to the load.


      How can the same script behave different in the published app? Any idea on what may be happening? H









      LOAD MaxUpdateTimestamp15Min;

      SQL SELECT max(start_date) as MaxUpdateTimestamp15Min FROM measure_update WHERE period = '15min'; //and start_date >= CURRENT_DATE;



      if NoOfRows('TempDWHMaxUpdate') > 0 then


          vMaxTimePeriodDate = Date(Timestamp(peek('MaxUpdateTimestamp15Min', 0, TempDWHMaxUpdate)), 'YYYY/MM/DD');   

          vMinDWHMaxUpdate = Minute(Timestamp(peek('MaxUpdateTimestamp15Min', 0, TempDWHMaxUpdate)));

          if (vMinDWHMaxUpdate >= 0 and vMinDWHMaxUpdate < 15) then

             vPeriod = 0;

          elseif (vMinDWHMaxUpdate >= 15 and vMinDWHMaxUpdate < 30) then

             vPeriod = 1;

          elseif (vMinDWHMaxUpdate >= 30 and vMinDWHMaxUpdate < 45) then

             vPeriod = 2;

          elseif (vMinDWHMaxUpdate >= 45 and vMinDWHMaxUpdate < 60) then

             vPeriod = 3;      

          end if;


      vMaxTimePeriodIdx = Hour(Timestamp(peek('MaxUpdateTimestamp15Min', 0, TempDWHMaxUpdate))) * 4 + vPeriod;

      end if;



      Drop Table TempDWHMaxUpdate;



      TRACE >>> Latest 15 min link update time period index:  $(vMaxTimePeriodIdx);