OrderyBy query

Hey guys, I seem to be having issues with the orderby formula,

I have this start expression that returns the sessions I need, but
<<Start:SELECT(Case Session[SID], ([Ref]=[_THISROW].[Case Ref])) >>

When adding the orderby expression I’m getting errors:
<<Start:SELECT(Orderby(Case Session[SID], ([Ref]=[_THISROW].[Case Ref])), [Order Date], TRUE) >>

Any help would be extremely grateful.
Regards
Ben

1 Like

Hi there! First, what error are you getting?

And my suggestion is to put the order by on the outside, because it seems to (typically) operate on the results of a SELECT query as shown here:
ORDERBY(SELECT(…))

This is a little different than traditional SQL which has a more declarative syntax with ORDER BY clauses appearing at the end, but should have the same effect.

Can you give that a try and let us know?

Thank you!

Mike

2 Likes

Ahhh Mike,

Thanks so much for your reply, I just noticed that I was using [Order Date] instead of [Date]

Sorry to have wasted your time.

Regards
Ben

2 Likes

Not a waste of time! Thanks for following up and glad it’s working for you now. Yes, writing queries like this can be a bit of trial and error until it gets dialed in. Reach out any time.

2 Likes