Sorting data by first column name value and add 3 empty rows between them

Input

expected output

i also want to make a sum in the end of each
i have column that have amount.

One of many approaches is to group the data by the first column value
(Non-LINQ, LINQ Approach)

Hi @ldiaz ,

Can you try this,

Input
Input
Output
output
Sample xaml
SortData.xaml (12.1 KB)

image

your file works. but when i applied it in my workflow it shows this warning. i don’t know.

it works now . not my problem is in the same column i have cell that contains (-) i can’t convert the column price because of if . can you help?

Hi @ldiaz

Can you share any screenshot?

Product1 -100
Product1 109
Product1 100

Price total will be 109

Working fine for me.

Can you explain your issue little elaborate.

Thanks!

1 Like

when this activity is enabled

uipath throws this error
Assign: Input string was not in a correct format.
Input string was not in a correct format.

Hi @ldiaz ,

Could you show us the data containing that specific value which contains hyphen (-) ?

It might also be the case if there are empty values in the column. Do you have such values ?


here sir

@ldiaz ,

In that case, Could you check with the below Expression :

FilteredDT.AsEnumerable.Sum(Function(x)CDbl(if(x("Column Name").ToString.IsNumeric,x("Column Name").ToString,"0")))
1 Like

Hi @ldiaz

Can you try this

filterDT.AsEnumerable.Sum(Function(x) if(IsNumeric(x(“Price”).ToString.Trim),CDbl(x(“Price”).ToString.Trim),0.0))

Thanks!

hi . this works . thank you

Can you mark as Solution

image

Can you check this xmal
SortData1.xaml (4.7 KB)

Hi @ldiaz ,

Apology for asking you have marked solution to your reply !

Could you mark solution to my post!

Regards

1 Like

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