## Convert month number to month (month period)

Occasional Contributor

## Convert month number to month (month period)

Hi,

I am looking for a way to convert a month number (f.e. 1) to month name (f.e. 'Jan 20').

How would you do this?

Kind regards,

Catheline

1 ACCEPTED SOLUTION

Accepted Solutions
Certified Master Anaplanner

Your question leaves the YEAR definition open in my opinion.

Other than that I guess an easy solution would be to:

1. Transform the number into a date (i left between quotes what could be harcoded) using the DATE function as DATE("01" , input , "YYYY)

->  outcome "01"/1/"YYYY"

2. Use the period function on the date

Let me know if I misunderstood anything or my answer is not clear.

Regards,

15 REPLIES 15
Moderator

It surely is achievable but it would be great if you can post some screenshot on what exactly are you trying to do? Do you have any global module? Are you using Native timescale? Number 1 will be considered as Jan in all the years, are you furnishing Year number as well anywhere?

Moderator

See if this helps

Step 1: Create a Fake Months List

Step 2: Create one Global module. Month from Native Time Scale line item is what you are interested in.

Moderator

Flip your list around, instead of having Jan, Feb, Mar, etc as the code, have that as the name and the code be 1, 2, 3, 4, 5, etc.

Rob

Moderator

@rob_marshall  I thought of doing so but @Catheline  needs to input 1-12 numbers in a cell and system should derive months based on those numbers. If I flip it I think it gets complicated.

Moderator

I get what you are saying, but you do a finditem() on the number to render the month, no?

Moderator

Ah I see what you saying!!

Certified Master Anaplanner

Your question leaves the YEAR definition open in my opinion.

Other than that I guess an easy solution would be to:

1. Transform the number into a date (i left between quotes what could be harcoded) using the DATE function as DATE("01" , input , "YYYY)

->  outcome "01"/1/"YYYY"

2. Use the period function on the date

Let me know if I misunderstood anything or my answer is not clear.

Regards,

Occasional Contributor

Hi @paolovm,

I like this idea!

It avoids having to make an additional list.

Thank you!

Certified Master Anaplanner

If that works as you'd expect appreciate if you could mark the "Accept as Solution" field so others can refer to this discussion in future.

🙂