Is there a one-letter abbreviation for month?

I am aware that I can use %b for the abbreviated month (three letters) and %M for the full month, but is there a way to have a one-letter abbreviation for month? For example, "J" for January and "F" for February.

Best Answers

  • edhg
    edhg Member
    Answer ✓

    Much closer now. It works if I have nothing in the series, but it breaks the months apart since it is not aggregating them anymore. I tried the "hide empty values" and that fixes the line, but not the duplication of the months along the x-axis.

    This is what I have in the x-axis in case it helps to see:

    CONCAT(LEFT(MONTHNAME(`DATE`),1),DATE_FORMAT(`DATE`,'%y'))

  • MarkSnodgrass
    Answer ✓

    That series does make it challenging. Have you considered just using your date field and then in the date range filter, choose to graph by month?

    It will angle the values when space is tight and it works properly with a series.


    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.

Answers

  • MarkSnodgrass
    edited April 2022

    You could pull the first character from the month name to get that like this:

    LEFT(MONTHNAME(CURRENT_DATE()),1)
    

    That would get you what you want. If you are using this along the x-axis, it might be helpful to create a beast mode with the month number and put that in your sorting, so that they are in chronological order.

    MONTH(CURRENT_DATE())
    

    Replace current_date() with the date field in your database for each of the above.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • edhg
    edhg Member

    @MarkSnodgrass Thank you for the quick reply. You answer got me closer, but the problem is that when I do that, it consolidates the months that start with the same letter (e.g. January, June and July become one in "J").

    Any thoughts on that?

    And you are right, I am putting this along the x-axis along with the last two digits of the year. So, I was hoping for J21, F21, M21, A21, M21, and so forth until J22, F22, etc.

  • Try putting your actual date field in your sorting properties. This should break up June, July and January getting combined as well as the years in the right order.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • edhg
    edhg Member

    It is what I had in the sorting already, but unfortunately, it is not breaking it apart. I removed it and put it in again, but nothing. I might have to go with month numbers instead.

  • Try creating a beast mode called something like YearMonthNumeric with this as the formula:

    YEAR(`date`)*100 + MONTH(`date`)
    

    and then put this in the sorting. It should end up looking like this:


    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • edhg
    edhg Member
    Answer ✓

    Much closer now. It works if I have nothing in the series, but it breaks the months apart since it is not aggregating them anymore. I tried the "hide empty values" and that fixes the line, but not the duplication of the months along the x-axis.

    This is what I have in the x-axis in case it helps to see:

    CONCAT(LEFT(MONTHNAME(`DATE`),1),DATE_FORMAT(`DATE`,'%y'))

  • MarkSnodgrass
    Answer ✓

    That series does make it challenging. Have you considered just using your date field and then in the date range filter, choose to graph by month?

    It will angle the values when space is tight and it works properly with a series.


    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • edhg
    edhg Member

    For sure. I just wanted to see if there was a way of shortening it. I recall being able to do it either in Excel or PowerBI in the past, so I was wondering if it was possible in Domo.

    Thank you so much for the assistance. I will definitely have to go with just the date as you showed.