Hello
I have a column (“Status”) that Contains many Status Like: Success, Failed, In Progress, etc…
i want to store Any Word appear “Success”, Failed the Values in a variable so i can use it Later For Counting,
The question is how can each value and store in a variable ?
@Karam_Abulawii
prepare a datatable with build datatable activity - dtStatistic
Cols: Status, Count
Assign activity:
left side: dtStatistic
right side:
(From d in YourDataTableVar.AsEnumerable
Group d by k=d(“Status”).toString.Trim into grp=Group
Let ra = new Object(){k, grp.Count}
Selet r= dtStatistic.Rows.Add(ra)).CopyToDataTable
it will create for a statistic dynamily on all occuring status values
Thanks For the Reply
But i want to add Columns Dynamically Based on the Values of the Columns
when “Success” Appear Then add a column named “Success” and get the Count and so on
i will attach the Workflow if You can help me Do it
Thanks in advance LastTest.zip (356.2 KB)
this can be achieved by postprocessing dtStatistic retrieved as described fom above
FLOW:
prepare a datatable with build datatable activity - dtStatistic
Cols: Status, Count
Assign activity:
left side: dtStatistic
right side:
(From d In YourDataTableVar.AsEnumerable
Group d By k=d(“Status”).toString.Trim Into grp=Group
Let ra = New Object(){k, grp.Count}
Select r= dtStatistic.Rows.Add(ra)).CopyToDataTable
Generate dtTarget:
Assign activity: dtTarget | DataType: DataTable = new DataTable()
(From i In Enumerable.Range(0, dtStatistic.Rows.Count)
Let ra = dtStatistic.AsEnumerable.Select(Function (x) x(i)).toArray
Select r = dtTarget.Rows.Add(ra)).CopyToDataTable