How to change date format DD MMM YYYY

Kayley
Occasional Contributor

How to change date format DD MMM YYYY

Hi,

 

I have a date formatted line item (example: 4/1/2020) - this is in mm/dd/yyyy format

However, i want to show as 1 April 2020 or 1 Apr 2020.

How do I do that?

3 ACCEPTED SOLUTIONS

Accepted Solutions
ChrisHeathcote
Community Boss

Re: How to change date format DD MMM YYYY

To create the name of the month you need create a new list for the months of the year. Use the month number as the code and map your month number in you module to the code in the new list using FINDITEM.

 

To combine them into a single line item convert you items into TEXT format and concatenate them using "&" to separate each source line item.

 

Good luck,

Chris Heathcote
Bedford Consulting

Gold Partner and Regional Partner of the Year 2021, EMEA

View solution in original post

Nithya
Occasional Contributor

Re: How to change date format DD MMM YYYY

Hi @Kayley 

 

To achieve the display with month name,

Create a list (Eg. Month) with month number, code should also be month number

Add a property to the list for month name (Eg. Month Name)

List.png

In the module create line item to refer to month using FINDITEM() and LOOKUP()

Concatenate the results (date, month name, year) as per desired format using &

Sample attached below with formula,

Date Format 1.png

 

Month (List)   :    FINDITEM(Month, TEXT(MONTH(Date)))

Month Name  :    Month.Month Name[LOOKUP : Month (List)]

Date (Text)    :    TEXT(DAY(Date)) & " " & Month Name & " " & TEXT(YEAR(Date))

 

Thanks,

Nithya

 

 

View solution in original post

nathan_rudman
Master Anaplanner/Community Boss

Re: How to change date format DD MMM YYYY

this is too complex for this. 

 

You can achieve it faster with this:

nathan_rudman_0-1608127026744.png nathan_rudman_1-1608127044338.png

 

 

 

 


Nathan Rudman, Anaplan Model Builder

View solution in original post

8 REPLIES 8
Nithya
Occasional Contributor

Re: How to change date format DD MMM YYYY

Hi @Kayley 

The date format in Anaplan is presented based on user browser settings, which would either be represented as DD/MM/YYYY or MM/DD/YYYY.

However, to represent the date in any other format apart from the above such as DD MMM YYYY, a separate line item formatted as text can be created with custom formula referencing date line item to achieve the same.

 

Thanks

Nithya

Kayley
Occasional Contributor

Re: How to change date format DD MMM YYYY

Hi @Nithya 

 

Thank you for your reply. 

 

Yes, i have created a separator to identify the Day, Month and Year as per image below. However, i'm not sure how to change the numeric month 4, to April and I'm not sure how to combine the day month and year together in a line item, so that it read 1 April 2020.

Kayley_0-1608123677258.png

Kayley_1-1608123761110.png

 

 

ChrisHeathcote
Community Boss

Re: How to change date format DD MMM YYYY

To create the name of the month you need create a new list for the months of the year. Use the month number as the code and map your month number in you module to the code in the new list using FINDITEM.

 

To combine them into a single line item convert you items into TEXT format and concatenate them using "&" to separate each source line item.

 

Good luck,

Chris Heathcote
Bedford Consulting

Gold Partner and Regional Partner of the Year 2021, EMEA

View solution in original post

Nithya
Occasional Contributor

Re: How to change date format DD MMM YYYY

Hi @Kayley 

 

To achieve the display with month name,

Create a list (Eg. Month) with month number, code should also be month number

Add a property to the list for month name (Eg. Month Name)

List.png

In the module create line item to refer to month using FINDITEM() and LOOKUP()

Concatenate the results (date, month name, year) as per desired format using &

Sample attached below with formula,

Date Format 1.png

 

Month (List)   :    FINDITEM(Month, TEXT(MONTH(Date)))

Month Name  :    Month.Month Name[LOOKUP : Month (List)]

Date (Text)    :    TEXT(DAY(Date)) & " " & Month Name & " " & TEXT(YEAR(Date))

 

Thanks,

Nithya

 

 

View solution in original post

nathan_rudman
Master Anaplanner/Community Boss

Re: How to change date format DD MMM YYYY

this is too complex for this. 

 

You can achieve it faster with this:

nathan_rudman_0-1608127026744.png nathan_rudman_1-1608127044338.png

 

 

 

 


Nathan Rudman, Anaplan Model Builder

View solution in original post

Kayley
Occasional Contributor

Re: How to change date format DD MMM YYYY

Hi @nathan_rudman , @Nithya , @ChrisHeathcote 

 

Thank you so much all for your solutions! It works now! 😁

rob_marshall
Moderator

Re: How to change date format DD MMM YYYY

@Kayley 

 

@nathan_rudman solution is the best as it will perform the best (less concatenations, no lookup, all around better for Hyperblock)  and it is easy to follow for other model builders.

ChrisHeathcote
Community Boss

Re: How to change date format DD MMM YYYY

@nathan_rudman 

A nice simple solution. As a solutions should be!

Bravo!

Chris Heathcote
Bedford Consulting

Gold Partner and Regional Partner of the Year 2021, EMEA