Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

help with calendar variable

Hi all,

i have a problem with a couple of calendars. they are assigned to variables (vFromDate and vToDate). the format of the date is DD/MM/YYYY but when i select a date from the calendars the result of the variable is in the number format.

i then have a button which applies the From/To dates to the Date field but it isn't working because of the formats.

I am unsure on what to do to correct this as the date format is correct, it just seems that the calendars are applying the wrong format to the variables.

i have attached an example, can anyone offer any advice please?

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

You can set the format on the number tab of the calendar object properties, or the number tab of the document properties (select Variables in the drop down at the left top corner).

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

5 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

You can set the format on the number tab of the calendar object properties, or the number tab of the document properties (select Variables in the drop down at the left top corner).

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sunny_talwar

I guess I don't understand the issue. Would you not be able to use this for your expression?

='vFromDate' &'

'&Date(vFromDate)


Capture.PNG

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi,  those text boxes were added for visual confirmation only. i need the variables to be the DD/MM/YYYY format automatically, so when the 'Apply Date Range' button is clicked it would apply the variable values to the Date field. at the moment that doesnt work because of the different formats

sunny_talwar

May be use this as your search string:

='>=' & Date(vFromDate) & '<=' & Date(vToDate)


Capture.PNG

Mahamed_Qlik
Specialist
Specialist

Hi hopkinsc,

You can try this.

-Whever you will use the vFromDate variblae, just convert it to proper date format as below :

='vFromDate' &'

'&Date(vFromDate,'DD-MM-YYYY')

Regards,

Mahamed