53
Views
7
Comments
Solved
Need a help with SQl multiple sorting.
Application Type
Traditional Web
Service Studio Version
11.54.50 (Build 63188)

Hi,

I am working on traditional web application where i am using TableRecords, RichWidgets\List_SortColumn, RichWidgets\List_Navigation widgets and in preparation i am using a sql to fetch the data which is source to TableRecords widget and in sql i have add a simple sql querie,

"Order BY @OrderBy" with this querie i can sort the table.

But i cant achieve multiple column sort.

Please help me with this issue.

Thank you.

UserImage.jpg
Milind Bansal
Solution

Hi @nani 

Please find the attached OAP file. 

I hope current solution will work for you.

Multiple Column Sort.oap
2023-05-23 04-55-55
Wasimkhan Syed Abuthahir

Hi,

Hope this document for dynamic sorting on SQL query will help you.


Regards,

Wasimkhan S

2026-01-03 13-44-38
Erwin van Rijsewijk
Champion
UserImage.jpg
Sneha Kumari

Hi @nani , Can you check if the below screenshot works for you and make sure you are passing properly formed input for sorting.


UserImage.jpg
Milind Bansal

Hi Nani,

Please check the attached screenshot that might help you to solve the problem.
In below screenshot I have wrote the query and created 1 input parameter as Expand Inline is "Yes"In below Screenshot I am passing the value of Input parameter "Sorting" value
Richwidget already have the function called List_SortColumn_GetOrderBy. It takes 2 input, the id of the table and default column to sort. so when you try to sort the column on the table it automatically take that column and pass to the query.

I hope above solution will help you.

UserImage.jpg
Nani

Hi, thank you for you time but i haven't found any solution.
what you are posting a dynamic sorting which i have already achieve i need a multiple sort.

SQL query 
ORDER BY @OrderBy

Old Parameter values OrderBy = {User}.[Id] ASC or {User}.[Name] Desc ..ect.., if i use this "List_SortColumn_GetOrderBy " function it can be only one.

But i need multiple order at some time 

Required parameter value OrderBy = {User}.[Id] ASC, {User}.[Name] Desc, {User}.[Username] ASC

if i click on username column OrderBy value should change to 

= {User}.[Id] ASC, {User}.[Name] Desc, {User}.[Username] DESC

I hope you guys understand what i need.

UserImage.jpg
Milind Bansal
Solution

Hi @nani 

Please find the attached OAP file. 

I hope current solution will work for you.

Multiple Column Sort.oap
UserImage.jpg
Nani

Hi, Milind.

 It working great matching my requirements, i am also trying to implement but you have completed first.

Thank you, for your time and support.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.