Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

nikhilgarg
Valued Contributor

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
Honored Contributor III

Re: Error in Script

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
susmvs88
New Contributor III

Re: Error in Script

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
Honored Contributor III

Re: Error in Script

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

parthakk
Contributor II

Re: Error in Script

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
Valued Contributor

Re: Error in Script

Hey,

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