Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
QSense
Creator II
Creator II

Date format

Hello ,

I have date field its format:DD-MM-YYYY HH:MM

I want to make format such WeekStart-WeekEnd like 19 Jan 2012 - 26 Jan 2012

Labels (1)
3 Replies
Not applicable

Below format conversion should help:

=Date(WeekStart(Date(Now(),'DD-MM-YYYY HH:MM')),'D MMM YYYY') & ' - ' & Date(WeekEnd(Date(Now(),'DD-MM-YYYY HH:MM')),'D MMM YYYY')

Replace Now() to your [Date Column]

Note: The output will be a String and no longer be treated as a Date

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You can simplify this (where DateField is the field on which the expression is based, and is a valid date):

=Date(WeekStart(DateField),'D MMM YYYY') & ' - ' & Date(WeekEnd(DateField),'D MMM YYYY')

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

As vigi-baba said, this will be a string. If you want this expression to sort properly by date, you could use a dual value:

Dual(Date(WeekStart(DateField),'D MMM YYYY') & ' - ' & Date(WeekEnd(DateField),'D MMM YYYY'), WeekStart(DateField))

Regards

Jonathan

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