Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Identical calendar objects return different results

This is about quite a specific file. In the QVW attached, there are two calendar objects that use two different variables. One is vStart and the other is vEnd. Both variables are set on document load, one to 6 days ago and one to one day ago (yesterday). Both calendar objects have identical min and max values:

=date('01/01/2000','DD/MM/YYYY') and =date('31/12/2070','DD/MM/YYYY')

So far so good, the page loads, the date objects both display valid dates I.E. 24/05/2014 and 29/05/2014.

But they work differently in terms of functionality. The first, for vStart, returns a date as expected, in the format DD/MM/YYYY. The second, however, returns a number, presumably a timestamp(?) I want the second calendar object to return a date just like the first, can anybody tell me why it isn't?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Not sure why you need it, changing Number format to Date in the calendars should be enough.  But if you wish so:

Create input box, and add your variables there.  Go to the number tab of the input box.  Make sure your variables are in Date format.


View solution in original post

8 Replies
Anonymous
Not applicable
Author

The vEnd variable is in integer format.

No need to change, just use "Date" format in the calendars object properties.

Not applicable
Author

Where can I find that option? How is the vEnd variable defined differently from the vStart and how can you tell? Thanks.

Anonymous
Not applicable
Author

It is on the Number tab of the object properties.  Check Override Document Settings, and then "Date" radio-button.

Not applicable
Author

Thanks that worked!

I'm still a little confused as to why they work differently though?

Where can I tell what type of variable it is?

Not applicable
Author

Actually that didn't work, sorry. The value of the calendar object textbox is in a DD/MM/YYYY format, but the variable is still being set as a timestamp. How can I change the variable type?

Anonymous
Not applicable
Author

Not sure why you need it, changing Number format to Date in the calendars should be enough.  But if you wish so:

Create input box, and add your variables there.  Go to the number tab of the input box.  Make sure your variables are in Date format.


Not applicable
Author

Hi,

Perhaps you can use the function Date() like in SQL:

Date(vEnd, 'DD/MM/YYYY')

Not applicable
Author

Perfect! I had no idea the properties of the input box have an effect on the actual variables. Thanks.