Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikBeginner1
Creator
Creator

Use of variable for report

Hello,

LET vReloadDate = Date(ReloadTime(),'DD/MM/YYYY');

I have this variable stored in my app.

I have a number of flags for a report I am building, and I am trying to use the Date(ReloadTime(),'DD/MM/YYYY') as a variable in my load editor, but the results differentiate to when I use a hardcoaded Date(ReloadTime(),'DD/MM/YYYY'). Please see examples below,

 IF(Date(ZMEffectiveDate,'DD/MM/YYYY') > '$(vReloadDate)' ,0,1) as ZMBBNIVAL01, - This is what I tried when using the variable above.

 IF(Date(ZMEffectiveDate,'DD/MM/YYYY') > Date(ReloadTime(),'DD/MM/YYYY'),0,1) as ZMBBNIVAL01, - This is when I hardcoded the Reload time instead of using the variable. The results shown from this is correct.

 

The reason why I am trying to use as a variable, is because I want to add functionality where the user is able to amend the date which will change the results of the report if they would like to see past history.

Any understanding into why the variable is not working correctly? 

Thanks in advance,


 

Labels (2)
1 Reply
nikolay_dolgono
Partner - Contributor II
Partner - Contributor II

Hi, @QlikBeginner1 !

When you use '$(vDate)' construction, it will put the text string, not date.

Either use Number (LET vDate = Num(ReloadTime())) , or you should use Date#('$(vDate)','DD/MM/YYYY')

Notice, that in different locations number cam contain ',' symbol. Use Replace(... , ',', '.') in this case