グループ集計

UIPATHを利用してグループ集計のフローを考えました。
.netのサンプルを参考にしながら作成しましたが集計キーの作成までは大丈夫のような感じです。
しかし、サマリーのところでエラーがでます。

Assign: Invalid usage of aggregate function Sum() and Type: Object.

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Data.DataException: Invalid usage of aggregate function Sum() and Type: Object.
at System.Data.Common.ObjectStorage.Aggregate(Int32 records, AggregateType kind)
at System.Data.DataColumn.GetAggregateValue(Int32 records, AggregateType kind)


row(“合計”) = DT03.Compute(“Sum(時間)”,expr)でエラーがでます。

file.xlsxを読み込み DT03へ
DataView = new dataview(DT03)
isDistinct = True
cols = {“A”,“B”}
DT04 = DataView.ToTable(isDistinct,Cols)
Add Data Columnで"合計"を追加 DT04

for each row
foreach row in DT04
expr = “A=’” & row(“A”).ToString & “’ and B=’”& row(“B”).ToString & “’”
row(“合計”) = DT03.Compute(“Sum(時間)”,expr)

変数:
3

excelのpivotテーブルも考えましたがUIPATHでできるか試したところエラーがでました。
間違い指摘していただければ幸甚です。

1 Like

Hi @matrix99999,

To do the aggregation you have the custom activity in the gallery package that i have attached it below. using this you can do the sum

Can you please attach your xaml. ?

Regards
Balamurugan.S

Thank you !
I attach the xaml file.
I would be happy if you could check it.
main_test2.xaml (13.9 KB)

Hi @matrix99999,

Can you attach the Excel file please.

Regards
Balamurugan.S

Thank you !
I attach the excel file.
I would be happy if you could check it.

Hi @matrix99999,

Here I have attached the sample to solve your problem.
I have used the BalaReva.Datatable.Activities to solve the problem with simple steps that i have attached it below.

Samples : Matrix9991.zip (16.1 KB)

1.Open the sample project.
2.Install the package thru the documnet.
InstallationGuide.zip (121.8 KB)
3.Save the project.
4.Close the studio and reopen it.

Take a look this about the package.

Regards
Balamurugan.S

1 Like