Order Notion chart by dateOrder Notion chart by date

Order Notion chart by date

Tags
Tips
Formula
Template
Published
Oct 22, 2021
How to order my notion chart by date ?
That's a question that we often get at Nochart. So we though that this would be an interesting article for you guys :)

Ordering your chart by date

Most of the time, ordering a notion chart by date in Nochart is straightforward to do:
  • Select the date you want to order by :
Select your date column in the order by select
Select your date column in the order by select

Ordering your chart when your column is not a date

But sometime, your month property in Notion is not set as a date.
Here, Month text and Year type's is select.  Not date.
Here, Month text and Year type's is select. Not date.
When your date is set as a select or a text, Nochart won't detect that it's actually a date and will treat it as a text and sort it alphabetically.
And end up with Month in alphabetical order.
And end up with Month in alphabetical order.
In this case what you need, is to use formula in Notion in order to calculate the right date and use it to order your chart:
  1. Turn your month text into the number of the month by creating a new field named Calculated Month and use this formula:
if(prop("Month text") == "January", 1, if(prop("Month text") == "February", 2, if(prop("Month text") == "March", 3, if(prop("Month text") == "April", 4, if(prop("Month text") == "May", 5, if(prop("Month text") == "June", 6, if(prop("Month text") == "July", 7, if(prop("Month text") == "August", 8, if(prop("Month text") == "September", 9, if(prop("Month text") == "October", 10, if(prop("Month text") == "Novermber", 11, if(prop("Month text") == "December", 12, 1))))))))))))
Here is what you should obtain (8 for august, 9 September ...)
notion image
  1. Create a new column called Date to Assemble Calculated Month and Year to get the date of the month:
dateAdd(dateAdd(dateAdd(fromTimestamp(0), 1 - 1, "days"), prop("Calculated Month") - 1, "months"), ((prop("Calculated Month") > month(now())) ? year(now()) : toNumber(prop("Year"))) - 1970, "years")
And Voilà ! You should have a correct date column:
notion image
Now all you have to do is order your chart by Date:
notion image
 
💡
You can access and duplicate the template with the formula here
Let me know if this article as been helpful on the chat or on our twitter.