Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
New Contributor II

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
Highlighted
MVP & Luminary
MVP & Luminary

Re: Date formatting issue

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
Highlighted
Partner
Partner

Re: Date formatting issue

do as below in the script:

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

Highlighted
MVP & Luminary
MVP & Luminary

Re: Date formatting issue

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

Highlighted
Digital Support
Digital Support

Re: Date formatting issue

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.