Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

JustJoshin
New Contributor

Date Variable not saving in override format

Hi,

I have a Date field in my load script coming in as:

Timestamp(left(resolutiondate, 10) & ' ' & mid(resolutiondate, 12, 7), 'MM-DD-yyyy') as [Resolved Simplified],

and I am trying to use a Calendar  button object to set start and end dates for the column using variables.

I have a variable "vResolvedStart" that has a

min: =Min({1} [Resolved Simplified])
max: =Max({1} [Resolved Simplified])

with a number  tab settings including "override document settings" and the format set to Date and format pattern "M-D-YYYY"

The issue is when I check in the Variable overview I see the definition as a number. "43770.42224537"

Am I overlooking something?

4 Replies
Partner
Partner

Re: Date Variable not saving in override format

In Qlik the number that you see is a date but you need to format it using date function

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

Yousef Amarneh
Support
Support

Re: Date Variable not saving in override format

Josh, did Yousef's suggestion get things working as you wanted?  He is correct by the way, you need to encapsulate the expression with the date function he mentioned to see the actual date in the variable, otherwise it is likely going to be shown as you are seeing it.  If Yousef's comment worked, please be sure to use the Accept as Solution button on his post to give him credit for the help and let other Community Members know it worked too.  If you are still working on things, leave an update.

Regards,
Brett

To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.
JustJoshin
New Contributor

Re: Date Variable not saving in override format

Would this need to be set? The Load statement? Does this need to be set elsewhere for the variable. For comparison I have a similarly setup up calendar button to variable that does not seem to be having this issue (This is a legacy QVW I am overhauling so I did not create it originally nor is that person available).


The working variables

LOAD Snippet
Timestamp(left(created_u1, 10) & ' ' & mid(created_u1, 12, 7), 'MM-DD-yyyy') as [Created Simplified],

I have a variable "vStartDate" that has a

min: =Min({1} [Created Simplified])
max: =Max({1} [Created Simplified])

with a number tab settings including "override document settings" and the format set to Date and format pattern "MM-DD-yyyy".




Support
Support

Re: Date Variable not saving in override format

Josh, best thing would be to attach the QVW or a sample that shows the issue, so folks can dig into at this point, not sure if anyone else will have anything without that.

Regards,
Brett

To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.