0 Replies Latest reply: Nov 30, 2014 10:35 AM by MOISES VIVANCO RSS

    Using variables in Qlik Sense

    MOISES VIVANCO

      Hello everyone:

      I am using Qlik sense and I find it very  useful. I have a small problem using variables that are not presented in QlikView

       

      I have defined two variables:

       

      SET vAñoMesDiaMax=Max(Year([Start Time])& Date([Start Time],'MM')&Date([Start Time],'DD'));

      SET vDiaMax=right(Max(Year([Start Time])& Date([Start Time],'MM')&Date([Start Time],'DD')),2);

      SET vAñoMesDiaPasado=if($(vDiaMax)<1,$(vAñoMesDiaMax)-70,$(vAñoMesDiaMax)-1);

       

      When used in a script did not report anything.The expression used is as follows

      Avg({<Año=,Mes=,AñoMesDia={">$(vAñoMesDiaPasado)<=$(vAñoMesDiaMax)"}>}Disponibilidad)

      En Qlikview is Ok.

      But i Use the next sentence result OK. with the Variables:

      SET vAñoMesDiaMax=20141128;

      SET vAñoMesDiaPasado=20141127;

      Avg({$<Año=,Mes=,AñoMesDia={">20141127<=20141128"},ESTADO_CELDA={'EN_SERVICIO'}>}DISPONIBILIDAD)

       

      where will I be wrong?

      Regards

       

      Moises