MAX() and MIN () functions over time periods

Currently you can compare time periods using operators '=', '>' and '<' which is great and very useful. But when it comes to comparing more than two dates, it becomes a nightmare to find a MAX or MIN.

 

Unlike with number or dates, you either have to go through countless IF THEN ELSE cases which is probably impractical or you have to use additional Line Items to calculate it.

 

Please allow using MAX() and MIN() functions using not only numbers, but time period data type as well

6
6 votes

New · Last Updated

Comments

  • Can you use TIMESUM to achieve this? 

  • @AWhitworth, well, no you can't 😄

    Why do you ask?

  • Upvoting because this is an interesting idea. Would like to know more about the intended use case here @Kavadera.

     

    The "workaround" would be to convert the time periods to dates and use MAX() or MIN() on the dates, and then convert the final result back to a Time Period if needed.

     

    @AWhitworth Per the documentation on TIMESUM(), it does not work on Time Period formatted line items. I tested this as well and confirmed that an error is returned (see below). Also, functionally speaking, TIMESUM() is more or less an aggregation function (like a [SUM: ...]), whereas MAX() and MIN() directly compare line item values.

     

    ryan_kohn_0-1653945897913.png

     

  • @ryan_kohn I actually don't remember the use case, but I needed to do that for some reason. For many years I haven't faced this problem since I mostly don't use system timeline

     

    Your workaround is definitely valid. For custom time lists it's tolerable that you have to convert back and forth to date format, but it's not what I expect to do when using system timeline. Thus I published the idea 🙂

Get Started with Idea Exchange


See our Submission Guidelines and Idea Evaluation Criteria, then start posting your own ideas and showing support for others!