Hello guys!
Let me explain what I did first.
I’m using a csv reading activity and getting the result.
After that, I realised that the column I want is as a string, but I needed it to be a Double, so I converted it to Double.
But the Filter DataTable activity won’t let me get the values >= 10, I don’t know why but it always returns a blank csv, what can I do?
The column before my changes.
After:
1 Like
@joaovictor ,
Use this LINQ to get the amount column >=10
(From row In inputDataTable.AsEnumerable()
Let amountDouble = Double.Parse(row("Amount").ToString())
Where amountDouble >= 10
Select row).CopyToDataTable()
Change column name as per your datatable.
Thanks,
Ashok
1 Like
@ashokkarale tks for helping me,
if you don´t mind, could you tell me how do i use this LINQ, i´m kinda new with UiPath
Parvathy
(PS Parvathy)
June 19, 2024, 5:27pm
4
Hi @joaovictor
=> Use Read CSV activity to read the CSV file and store the output in a variable say dtInput
=> Use the below syntax in Assign activity:
FilteredDt = dtInput.AsEnumerable.Where(Function(x) Cdbl(x("column name").ToString)>=10).CopyToDataTable()
Note: FilteredDt
is of DataType System.Data.DataTable. Please change the column name according to yours
=> Use Write CSV activity to write the FilteredDt
back to excel.
Hope it helps!!
1 Like
@joaovictor ,
Sure!
Use like this. inputDataTable
would be your datatable from CSV file.
dtOutput is of datatype Datatable
Sample xaml.
Workflow2.xaml (7.2 KB)
Thanks,
Ashok
1 Like
Thanks @ashokkarale and @Parvathy you´re amazing!!!
1 Like
Parvathy
(PS Parvathy)
June 19, 2024, 5:54pm
7
Hi @joaovictor
If the query is working please mark my post as solution to close the loop
Forum FAQ - How to mark a post as a solution
This document is part of our beginners guide .
This article will teach you how to properly mark a post as a solution.
We were closely following our last UiPath Forum feedback round! topic and carefully extracted all the bits of feedback that was provided. As such, we would like to tackle the topic of solutions on our Forum and how to properly use them.
When is the topic resolved?
The topic can be considered resolved when the topic author has fo…
Happy Automation!!
system
(system)
Closed
June 22, 2024, 5:55pm
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.