Hello - I am pulling values from an excel sheet, for example, I have six columns that are all named “Total”. I am pulling these 6 columns using Read Range, with range selection of
“E1:E100,H1:H100, K1:K100,N1:N100,Q1:Q100,T1:T100”
Now, how can I write a variable that selects all the values from this range with value of “0”?
For this I have created a variable called Array and data type of DataRow. I want to set this variable to equal all the rows where value is “0”, no matter what column they are in, in above range.
Please let me know if you need additional details or explanation. Thanks!
will the range you specified works in Uipath read range activity? If so is it fetching only 6 columns or all columns between E and T?
Is all the 6 column names Total? If so do not check Add Header
Assuming 1 works, build a data table with 6 columns and add the range to the data table and you can do Dt.Select(“col1=0 or col2=0 …or col6=0”) and assign it to your array.
Hello - First, yes, all 6 columns are named “Total”. I’ve adjusted my Read Range to select everything in the sheet “” and excluded the headers from DataTable. Next I assigned:
Table.Select(“Col5=0 or Col8=0 or Col11=0 or Col4=0 or Col7=0 or Col20=0”) to my array
But, I’m getting an error saying “Cannot find Column [Col5]”
Since its 0-based, 5th column is Column-4 etc. Brackets are to make sure interpreter correctly sees it as column name.
If it doesnt work, use output data table activity to see how it looks in message box.
Then extract time part and check for the range
Based on that add them to different collections
At Last add the values to other excel sheet in the required format.
@ENC
Create the lists like List A, List B …
1.Run one foreach row for the excel sheet which you have read and stored in a datatable
2.then extract the time part of second column and replace the colon by dot(: by .)
3.then check whether the value extracted is less than 3.00 if it so add that to List A
4.Else check is it less than 6.00 if it is then add that to list B and so on
5.Finally after completion enter all the values in different lists to different columns.