8 Replies Latest reply: Feb 12, 2018 8:11 AM by Lukas Roček RSS

    Variable in variable

    Lukas Roček


      I have a problem with using variable in another variable.

      I use number slider from 1 to 6 (step by 1), which changing variable 'vHour' - so it is number.

      Then I have the second (text) variable 'vPeriod', which is name of flag in load script.

      I use set analyse with this flag, so I need change set analyse by text variable.

      This code does not work: [flag&text($(vHour))&hours]


      Load script for flags:

      if(now()-num(eventdtcr) < 0.25,'1','0') as flag6hours,

          if(now()-num(eventdtcr) < 0.2083,'1','0') as flag5hours,

          if(now()-num(eventdtcr) < 0.1666,'1','0') as flag4hours,

          if(now()-num(eventdtcr) < 0.125,'1','0') as flag3hours,

          if(now()-num(eventdtcr) < 0.0833,'1','0') as flag2hours,

          if(now()-num(eventdtcr) < 0.0416,'1','0') as flag1hours...


      Set analyse: if(len(text(avg({$<$(vPeriod)={'1'}>} flagEPA))) = 0,'NO EVENT SCAN',avg({$<$(vPeriod)={'1'}>} flagEPA))


      Next idea: '[flag' & text($(vHour)) & 'hours]' does not work too...

      Thank you for your's answers.