Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

Error in Script

Hey,

When i have defined variable as : Let vEndDate = Date(Today(), 'YYYY-MM-DD') ;

and using it as: Date($(vEndDate), 'YYYY-MM-DD') , it is giving me : 1905-06-27 as output. Can someone explain me this absurd behavior?

I ahve attached application also.

Thanks

1 Solution

Accepted Solutions
sasiparupudi1
Master III
Master III

the vEndDate is already haviing a formatted date as per your let statement and you do not need to use the date function again.

use the variable directly

vEndDate

or

'$(vEndDate)'


hth

Sasi


View solution in original post

4 Replies
Anonymous
Not applicable

Hi Nikhil,

You have to lose the $ in the formula.

Try the following:

Date(vEndDate, 'YYYY-MM-DD')


The LET command assigns a value to the variable.

The SET command defines the variable.

As such, the formula with $ would only work if you used the SET command instead of the LET.


Best wishes,

Susana Silva

sasiparupudi1
Master III
Master III

the vEndDate is already haviing a formatted date as per your let statement and you do not need to use the date function again.

use the variable directly

vEndDate

or

'$(vEndDate)'


hth

Sasi


parthakk
Creator II
Creator II

Hi Nikhil,

Your vEndDate will be stored in date format itself. Why u need to convert it again to date format?

Thanks,

Partha Kulkarni

nikhilgarg
Specialist II
Specialist II
Author

Hey,

'$(vEndDate)' is working cool but vEndDate will give error bcoz it will treat it as a field.