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)
変数:
excelのpivotテーブルも考えましたがUIPATHでできるか試したところエラーがでました。
間違い指摘していただければ幸甚です。
1 Like
balupad14
(Balamurugan)
October 7, 2018, 8:49am
2
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
Hi Friends.
I have included some activities in the package of BalaReva.Datatable.Activities
You can see in the below namespace
[image]
The key advantages are below
1.ConvertInputColumn - When you read the data from excel , it is always string format. Using this property can able change the data type and do the aggregation .
2.NullValue - If you have empty of null value in the data. can able to assign the default value for it.
3.Select- It is place to keep the condition(Where)
Sample Fil…
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)
balupad14
(Balamurugan)
October 7, 2018, 11:31am
4
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.
balupad14
(Balamurugan)
October 7, 2018, 2:30pm
6
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.
Hi Friends.
Below you have Documentation and Sample attachment for the “BalaReva.Datatable.Activities”
You can find the Activities in DataTableExtensions NameSpace
[image]
Add Data Row Range
It allows to add collection of datarow into DataTable.
Sample File : AddDataRowRange.zip (7.8 KB)
Remove Data Row Select
It allows to remove the data rows based on the Select(Where) condition from DataTable.
Sample File : RemoveDataRowSelect.zip (7.6 KB)
Group By Aggregation(Sum,Count,Avg,Max,…
Regards
Balamurugan.S
1 Like