Hi Anybody i would like to inquire that as i am new in UiPath am tasked to get certain historical data from a certain stock in an Excel File to input into another taking the highest value. How Do i do that anyone can help real quick thanks.
Welcome to the UIPath Community.
Do you mean you want to read max value from particular column in Excel file ?
- use Read Range activity to read the data from excel file and store result in DataTable and say “DT”.
- Try below expression to find max value from excel column
int MaxValue=Convert.ToInt32(DT.AsEnumerable().Max(Function(row) row(“ColumnName”)))
- And then use Write Cell activity to write into another excel file and make sure it should be inside Excel Application Scope activity.
Thanks Brother for the Write Cell will be the input of where i wanna write it?
Thanks brother will try!
As I said in earlier post, after finding max value store it in one variable of type Integer and say maxValue.
In Write Cell activity specify like below:
Sheet: “Sheet Name”
Range: “A1” ( If you want to write output in A1 cell)
Use this. Mention the file and cell name where you want to write the maximum value.
Hope this helps!
Ok thanks for the help but the error encodes “Input string is not in the correct format”
Could you please send me workflow and excel file and send to me. Will check and update you.
Hi what is “Data”
Sorry i cant send as they say i am new Screens hots
Did you get Max value from High column or not.
use this code in an assign activity
For better understanding download this workflow
UsingMaxFunction.xaml (5.9 KB)
test.xlsx (9.8 KB)
Data is ‘Column Name’, you can replace it with the column you want.
You can use this component to easily get the maximum value of a data column.
use the DataTable Consolidate activity.
You can refer to the documenation attached to understand how the inputs should be provided.
This is a sample which I created using the same activity for another purpose which uses Sum. You can understand the usage of it using this.
DataTablePluginsTest.xaml (7.2 KB)
Thanks a lot.
when i do that, getting this error:
but my variable is already int32. I don’t get it