Dynamic sorting on grouped columns
Application Type
Traditional Web
Service Studio Version
11.10.21 (Build 41597)
Platform Version
11.10.0 (Build 22910)

Hi everyone,

I have the following issue that I am struggling with. I am using an aggregate on top of a table stored in an external SQL database and retrieved the data via an extension (Integration Studio). Within this aggregate I created two group by columns and one count, so 3 output columns. If I add normal sort, the table is sorted correctly. I can also see this by looking into the executed SQL. 

Adding the dynamic sort (to be able to use table sorting at the front-end) doesn't give any response. There is no "order by" created in the executed SQL script at all.

I read this forum post (https://www.outsystems.com/forums/discussion/19105/sorting-on-an-aggregate-with-a-group-by/) and tried the different things:

  • Removing the sort and rebuild it again
  • Appling normal and dynamic sort at the same time and changing the order, only the normal sort appears in executes SQL
  • Using dynamic sort only
  • Rebuilding the aggregate again

Does anybody have a solution for this issue?

Kind regards,

Patrick

image20210429140757.png

Hi Patrick,

Do you have alias on your grouped by columns? If not, you should do that.

Hi Eduardo,

I renamed the column, but this does not make sense.

Patrick


On your List_SortColumn input you need to put your changed column name (alias).

Hi Eduardo,

I did, but this has nothing to do with the executed SQL, which just don't include the dynamic Order By.

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