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

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?

0 7 435
7 REPLIES 7

@Aleksi_Alkio probably can roll this off of his tongueโ€ฆ

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

@Bellave_Jayaram hrmโ€ฆ iโ€™m thinking maybe some sort of find, len, etcโ€ฆ

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.

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

Iโ€™ll need to play with that concept a bitโ€ฆ

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

Top Labels in this Space