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

Date formatting issue

Hi,

I have set the date format in the script (see attached) but when I add the date fields to the dashboard as a text object they don't seem to be formatted correctly (see attached). Any ideas on what the issue might be here?

I would like to fix the problem in the script rather than have to reformat each individual object containing a date in the dashboard...

Many thanks

Dilpreet

1 Solution

Accepted Solutions
marcus_sommer

Any calculation with a date will remove the formatting and return a pure number. This means you will need to format it again usually by wrapping it within a date(), like:

date(max(DateField)) or date(today()-1) and similar cases.

- Marcus

View solution in original post

3 Replies
agigliotti
Partner - Champion
Partner - Champion

do as below in the script:

date(fieldName, '$(DateFormat)') as fieldName

marcus_sommer

Any calculation with a date will remove the formatting and return a pure number. This means you will need to format it again usually by wrapping it within a date(), like:

date(max(DateField)) or date(today()-1) and similar cases.

- Marcus

Brett_Bleess
Former Employee
Former Employee

Dilpreet, just giving you some additional links that may help you in addition to the two posters.  If any of them got you what you needed, be sure to come back and use the Accept as Solution button on their post(s) to give them credit and let others know the suggestion worked.

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/date-...

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/DateA...

https://community.qlik.com/t5/Qlik-Design-Blog/Why-don-t-my-dates-work/ba-p/1465849

https://community.qlik.com/t5/Qlik-Design-Blog/The-Date-Function/ba-p/1463157

Regards,
Brett

 

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.