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

Help with setting Number Format String to Date for a variable

I've experienced this from time to time and am wondering if anyone else has and/or if there is a fix or workaround.

Basically we are defining some variables in a Qlikview document to hold dates.  We start by defining the variable (Document Settings\Variables).  Then we go to the Document Settings\Number tab and attempt to click the Date radio button and then set the Format Pattern to MM/DD/YYYY.  This seems to work for some variables but not others.  Basically after selecting the Date and entering the pattern then clicking Apply we are returned to the top of the variable list and if we go back to the variable we are working with the changes were not saved.

We are not setting any values in the varaibles when we are doing this definition.  I have verified this in the Variable Overview window.

We are on the Qlikview Client version 11.0.11426 SR2 64 bit.

I've verified this behaviour in a brand new document as well.  In that scenario I created three variables, each in the same manner.  The first and second one I was able to set but the third I was not able to.

Any help would be appreciated.

2 Replies
Gysbert_Wassenaar

If you store a date in a variable then consider if you are storing a number or a simply string that looks like a date. Numbers can be formatted as dates. Strings are just strings that need to be converted to a date first with the date# function before they can be given a format. Depending on the default date format the strings that match that format may be recognized as dates and the others won't.

See this blog post for more information: Why don’t my dates work?

And Tip 5 of this document


talk is cheap, supply exceeds demand
Not applicable
Author

Agreed.  I have reviewed these in the past and have a pretty decent understanding.  

In this particular case I don't believe it is that as I'm not even able to get the format set as Number or Integer to stick.  I've also tried pre-populating the variable with an integer value that is a valid value for a date.