Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Variable getting change???

Hi Experts,

This post quite been simple but getting trouble with this...

I have declared a variable in Document properties, like "=date(today())"

variable before.bmp

After some days or subsequent reload the value is getting changed to some date, I wanted the value to be constant as "=date(today())".

variable after.bmp

How could I resolve this???

Many thanks in Advance...

14 Replies
Not applicable
Author

Hi,

today() will itself return date in proper format, no need of date() function.

Regards

sivarajs
Specialist II
Specialist II

Today will return Current date and time ,obviously it will get change for every reload

Not applicable
Author

Hi,

Variables can contain numeric or alphanumeric data. If the first character of a variable value is an equals sign ' = ' QlikView will try to evaluate the value as a formula (QlikView expression) and then display or return the result rather than the actual formula text.

That is why the value of your variable is date "10/09/2012" and not "=date(today())".

Regards,

Janzen

Anonymous
Not applicable
Author

thanks for the response..

then how could i proceed with today() after reload also...

Not applicable
Author

Hi,

What do you mean? After reload, the value of the variable must be today()? When do you trigger your reload?

Regards,

Janzen

Not applicable
Author

whichver date u want u can hardcode it in var, for eg, if u always want to show 29/10/2012,use

var=date(41211)

So, even after u relaod after few days it will remain 29/10/2012

to convert date to num,u can use: num(ur date)

Anonymous
Not applicable
Author

I am using that varible for my calender object so daily it should show the current date...

Not applicable
Author

then u can simply use today() as ur variable value

jagan
Partner - Champion III
Partner - Champion III

Hi Madhu,

If you want to change the date variable based on the current date, then create a variable and assign

=Today()

as expression.  This automatically returns you current date.

Hope this helps you.

Regards,

Jagan.