Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help Please..Correct syntax for using Today

I am new to Qlikview and trying to understand the 'Today' syntax using an If statement. The goal is to find the number of days open from Today's date - ClaimNotifyDate. 

if (ClaimStatus = F , StatusDate-ClaimNotifyDate ,$(=today() - ClaimNotifyDate)) as 'Days Open',

I am receiving this error message: Error in expression:')'expected

Thanks..

1 Solution

Accepted Solutions
danielact
Partner - Creator III
Partner - Creator III

How often is this reloaded? I don't know if the values in the script get updated if it's not reloaded. If it's reloaded every day, there's no need for a variable.

You also don't need the dollar sign expansion. Just use your original expression (assuming the other fields are formatted properly as dates) -

if (ClaimStatus = F , StatusDate-ClaimNotifyDate , Today() - ClaimNotifyDate) as 'Days Open'

View solution in original post

3 Replies
oscar_ortiz
Partner - Specialist
Partner - Specialist

I would create a variable for the Today() function in the laod script:

LET vToday = Today();

For the expression i believe you had your ClaimNotifyDate field in the same expression as today function.

if (ClaimStatus = F , StatusDate-ClaimNotifyDate ,$(=today() - ClaimNotifyDate)) as 'Days Open'

if (ClaimStatus = F , StatusDate-ClaimNotifyDate ,$(vToday)-ClaimNotifyDate) as 'Days Open'

Something to worry about here is that you want to have your date fields recognized as date fields.  So you still may have issues returning proper data and that;s most likely due to the format of the date fields you have.

Good luck

Oscar

danielact
Partner - Creator III
Partner - Creator III

How often is this reloaded? I don't know if the values in the script get updated if it's not reloaded. If it's reloaded every day, there's no need for a variable.

You also don't need the dollar sign expansion. Just use your original expression (assuming the other fields are formatted properly as dates) -

if (ClaimStatus = F , StatusDate-ClaimNotifyDate , Today() - ClaimNotifyDate) as 'Days Open'

Not applicable
Author

Daniel,

Thanks for providing the correct answer. To answer your question regards to reloading the data, currently I am reloading it, its not currently scheduled. Once scheduled it will probably be weekly.

Thanks.