Group By using multiple Aggreagate Functions

Am trying to perform multiple aggregates in group by , can some1 help me on how to write this query in UiPath Style ?

select colA,colB,colC,colD, Count(colD) as AlertCount, SUM(colE),colF,colG from Table group by colD

Any help would be apprecited. Thanks!

find starter help here, ready for your modifications
GrouBy_Custom_Statics-Aggs.xaml (11.9 KB)

change the groupby key:

(From d In dtData.AsEnumerable
Group d By k=d("ColD").toString.Trim Into grp=Group
Select grp.toList).toList

Modify the dtResult Datatable as by your needs

Examples on some Aggregations you wwill find in the demo
Also have alook here:

In case of you need further assistance then please share sime sample input and and expected output with us


Hi @ppr yes i will be needing your assistance here…
So, this is the Input and Output am expecting and the workflow you provided… am kind of not able to understand … pls help me…

What i am trying to get is – Sum of CaseCount based on CaseName and AlertCount Column Signifies the Number of time the CaseName appered in the Input.

find starter help for the updated requirements here:
hss.xaml (16.4 KB)

  • demo1: Custom Aggregation Approach
  • demo 2: LINQ Approach

Kindly note: saome values are set to dummy values due fast prototyping reasons, but should not affect the general functionality of the implementation

Thank you so much @ppr This works :innocent: :innocent:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.