ORDERBY() as part of a slice

I’m finding myself having to repeat an ORDERBY() for a slice over and over again - I can’t help but think of all the cycles wasted in this repetition during sync/calculation.

If I had the ability to order the rows of a slice AT THE SLICE LEVEL - then I wouldn’t need to worry about the sort order for any of my views, when using any formulas I know the rows will be in the order I’m expecting, etc.

The same could be said for regular data sources as well - being able to order rows at the table level would be handy; again, one-and-done. :nerd_face:

As always, thanks for considering!

Great idea! It would also be awesome if the list of keys generated by REF_ROWS had a default sort order.


@GreenFlux you can actualy use ORDERBY() with REF_ROWS

Here’s an example from an app I’m working on:

orderby(REF_ROWS("Page_Elements", "Walkthrough_Link"), 
  [Element_Column_Name], false,
  [EditDateTime], true

This puts my refrows in the correct order, and from here I’m able to work off that assumption. :slight_smile:
This is one example of where I’m using orderby() over and over, so being able to establish something as a “hard code” would be awesome.


Coming back to this again. @praveen is this anywhere on the radar? This would REALLY make a lot of advanced things much easier.

  1. We wouldn’t have to setup the sort in the view, it’s taken care of in the list
  2. We can make assumptions based on the sorting we’ve established; things like:
    • INDEX([Related Child_Records], 1)
    • If I know the sort order, this is either the first record created or the last
      • a MUCH more efficient way of finding the MaxRow() or MINROW() - even if it is a hack
  3. and other advanced things that wouldn’t make sense to most. :nerd_face:

Also, having the sort built into the virtual columns type would remove the neccessity of wrapping ORDERBY() around things.

Which I’ve just discovered now causes the auto-ref set to fail:



AppSheet is supposed to be (less) no code in philosophy.

This would save the need to code more expressions in other parts of AppSheet were we currently have to.