Adding Parameter Order By to a advanced query

Adding Parameter Order By to a advanced query

  
Greetings,

Today I tried to add a parameter Orderby to my advanced query to make diferent order bys to an existing table.
(I'm using a advanced query because its a bit more complex than what I can do with the simple one)

I tried to do it like I was doing to the simple one but then I get the following error:

The SELECT item identified by the ORDER BY number 1 contains a variable as part of the expression identifying a column position. Variables are only allowed when ordering by an expression referencing a column name.

Fixed by adding Yes to Expand Inline.