Sortiing using sql query not working

Sortiing using sql query not working

  

I have to sort using advanced sql query but it is not sorting,I have set Expand inline to yes

this is the query 

SELECT {Sheet1}.[Name],{Sheet1}.[Phonenumber] from {Sheet1} @SORT

and the value of input parameter is


EncodeSql(List_SortColumn_GetOrderBy(Sheet1Table.Id,DefaultOrder:"{sheet1}.[name]"))

Thanks,

Ronan.

Hi Ronan,

Do you get errors, or is it just not sorting? And did you debug to see what the List_SortColumn_GetOrderBy produces? (And the EncodeSql?)

Kilian Hekhuis wrote:

Hi Ronan,

Do you get errors, or is it just not sorting? And did you debug to see what the List_SortColumn_GetOrderBy produces? (And the EncodeSql?)

Hi Kilian Hekhuis,

I just published and opened in the browser as soon as i open it showed internal error.when i texted the query it displayed the output but not in the sorted order.


Thanks,

Ronan T.


Hi Ronan,

Did you inspect the internal error, e.g. in Service Center? Did you debug the eSpace? Development is more than just writing code you know...

Kilian Hekhuis wrote:

Hi Ronan,

Did you inspect the internal error, e.g. in Service Center? Did you debug the eSpace? Development is more than just writing code you know...

Hi Kilian Hekhuis,

Ya,I Debugged the error is in sql query near @sort if i remove that it shows no error but not sorted.

Thanks,

Ronan T.


You need to put the full statement in @Sort. So:

SELECT {Sheet1}.[Name],{Sheet1}.[Phonenumber] from {Sheet1} @SORT

@Sort must be something like "ORDER BY {Sheet1}.[Name]".

Hi Ronan,

Aren't you missing the ORDER BY before the @sort?

Regards,

Marelo

Oh dear, ashamed I didn't see that, thanks Lennart (EDIT: and Marcelo, I see now). Alternatively, if you always have a sort, add the ORDER BY to the query, just before @SORT.

Marcelo Ferreira wrote:

Hi Ronan,

Aren't you missing the ORDER BY before the @sort?

Regards,

Marelo

Hi Marcelo Ferreira,

If I use order by @sort ,It shows error at by.

Thanks,

Ronan T


Hi Ronan, 

If you use the order by @sort you must have a @sort always  with a valid contents, even when testing.

Regards

Graça

Solution

Hi Ronan,

This is working for example:

Which error are you getting? Go to service center > monitoring > error

Regards,

Marcelo

Solution

Marcelo Ferreira wrote:

Hi Ronan,

This is working for example:

Which error are you getting? Go to service center > monitoring > error

Regards,

Marcelo

Hi Marcelo Ferreira,

Thank you. i Just wanted to refresh the dependencies after i refreshed and publish it was sorted.

Thanks,

Ronan T.