May 02, 2023 02:12 AM
Hey Guys
I have a dynamic datefield (updates thru automations) that begins from todays date and records 10 days ahead. Is there a way to write a formulafield that ranks the date with numbers 1-10, i.e so todays date is 1 and tomorrow 2 and so on? I could use that info for navigation in an app.
Thank you in advance.
Jesper
Solved! Go to Solution.
May 02, 2023 08:05 PM
@Jesper_Holmstro , I'm not certain if I follow completely. In your original post it appears to me that the formula is always forward looking since you refer to looking 10 days ahead. In your followup you state that it is possible for yesterday to be 10 which means that the formula needs to look forward and back to a certain degree.
If the goal is to just eliminate the weekends I would think that a formula like this could solve those issues:
May 02, 2023 08:39 AM - edited May 02, 2023 08:40 AM
Something like this would work. This is based on an assumption that there is a possibility that you might have a date show that is before or after your 10 day window. In that case it returns the "OUT OF RANGE" string.
May 02, 2023 03:29 PM
Thank you @Brian_Swanson , but I don't want to count in weekends. I have a calendar mon-fri for 2 weeks that the date is updated every midnight by automation. So if today is Wednesday th 3rd may would be number 1, yesterday should be number 10, tomorrow 2 and so on. The weekends is excluded. With the date time_diff it counts the days. I just want a rank 1-10, with the date farest away is 10.
May 02, 2023 08:05 PM
@Jesper_Holmstro , I'm not certain if I follow completely. In your original post it appears to me that the formula is always forward looking since you refer to looking 10 days ahead. In your followup you state that it is possible for yesterday to be 10 which means that the formula needs to look forward and back to a certain degree.
If the goal is to just eliminate the weekends I would think that a formula like this could solve those issues:
May 03, 2023 12:21 AM
Thank you @Brian_Swanson , that helped a lot!