How to find the MAX value in a list

I need to find the max value in a list. I know I can do a Search For and sort descending, but that is slow on a large list. It seems like there would be some sort of lookup function.

Does anyone have any tips on how to accomplish this?

Thanks.

Hey @gnelson,

You perform your search, then select the field you want the max value to come from, then :max

For example, here I search through my data type “randoms”, get the field called “number”, and then apply :max.

43%20PM



Looking to accelerate your app development?

Let me turn
:thinking: :tired_face: :confounded:

into
:grinning: :sunglasses: :woman_student:

Development through Coaching at https://uniqueideas.com or schedule a free intro session :gift:

Ken Truesdale
LinkedIn

2 Likes

Hi @mebeingken, thanks for your quick response.

So I’ve been looking for that max function before I posted this question. I still don’t see it, so I’m figuring the field I’m looking for the max value must be a number field. Is that correct?

The field I need to find that value from is a text field. If I sort descending or ascending they appear in the correct order, though. Am I trying to do something that isn’t possible?

yes thats correct, you could add an order field to your type.

1 Like

Correct, :max needs a number field. And while you may see the correct sorting on short lists of text values that have number characters, that quickly falls apart.

For example, consider the values 1, 2, 3, 15, and 20. Sorted they will be:

1
15
2
20
3

1 Like

True, but this particular field is always in the format of 19-123-0123. But knowing the limit of this function now, I know how to resolve it.

Thanks for your help!