631
Views
7
Comments
Solved
How to using group by in outsystem
Question

I have SQL query  that return list of data , i want to group by data in outsystem not in sql

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Hi Mahmoud,

There's no straightforward way to do that in OutSystems, you need to program it yourself. That means iterating over the list with a For Each, keeping track of whether the grouped item(s) are still the same, and if so do a sum/min/max whatever over the other attributes you need in the output (and if not add it to the list, etc.).

2022-08-29 07-44-14
Mahmoud Yasaein

Thanks  Kilian.


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
2026-03-12 06-20-48
KUNDAN CHAUHAN
Champion

Hi Mahmoud Yasaein,

There are many threads about this subject, try to see this link answer to see the next steps you should take :)

https://www.outsystems.com/forums/discussion/60728/display-group-by-data-in-reactive-web-app/

Hope it help you,

Thanks

2022-08-29 07-44-14
Mahmoud Yasaein

Thanks KUNDAN for helping 

UserImage.jpg
Silvia Sendim

Hi,

If you don't want use the group by in SQL, you can create an auxiliar table to store the returned data from SQL and that use an aggregate and manage the data with the group by function from aggregate.



2022-08-29 07-44-14
Mahmoud Yasaein

Thanks  Silvia , I ask about any tool in outsystem like group by in entity framework which i can use it in logic not SQL or aggregate .


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Hi Mahmoud,

There's no straightforward way to do that in OutSystems, you need to program it yourself. That means iterating over the list with a For Each, keeping track of whether the grouped item(s) are still the same, and if so do a sum/min/max whatever over the other attributes you need in the output (and if not add it to the list, etc.).

2022-08-29 07-44-14
Mahmoud Yasaein

Thanks  Kilian.


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.