Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

mvivanco
New Contributor II

Using variables in Qlik Sense

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

Tags (1)
Community Browser