Can I get the position of something in a list...

(Grant Stead) #1

Can I get the position of something in a list? for example if I do an orderby and get a list of results, Can I then say so _THIS key is 5th?

(Grant Stead) #2

@Aleksi_Alkio probably can roll this off of his tongue…

(Bellave Jayaram) #3

It would be possible with a INDEXOF() function but it doesn’t exist.

(Grant Stead) #4

@Bellave_Jayaram hrm… i’m thinking maybe some sort of find, len, etc…

(Praveen Seshadri (AppSheet)) #5

We don’t have this functionality. While we have “List” types, there are no operations to sort them. In fact, their order is not guaranteed (they are really more Sets than Lists) so anything involving position would be a hack at best at the moment.

(Aleksi Alkio) #6

How about something like… TOP(ORDERBY(SELECT(…),[Datetime],5) - TOP(ORDERBY(SELECT(…),[Datetime],4)?

(Grant Stead) #7

I’ll need to play with that concept a bit…

(Praveen Seshadri (AppSheet)) #8

OrderBy only works with a list of keys/refs. So it is going to be challenging (not to mention, wildly inefficient!)