Shreeja
(K shreeja)
October 30, 2021, 12:34pm
1
How to get the index of the column where value says “Y”
Use Case Description
I am facing difficulty in getting the index values in the excel where the value says “y” .Fo a single “y” I did use Lookup range and got the index value due to which I could extract the currency value corresponding to it.But in case of multiple “y” I am facing difficulty in get the values where it says “y”.Can anyone help me with this ?
AS-IS WORKFLOW, TO-BE WORKFLOW
Other information about the use case
Industry categories for this use case : Other Sector
Skill level required : Advanced
UiPath Products that were used : UiPath Studio
Other applications that were used : -
Other resources : -
What is the top ROI driver for this use case? : Other
Yoichi
(Yoichi)
October 30, 2021, 12:49pm
2
Hi,
Can you try the following steps?
First ReadRange without AddHeaders option(Let’s say dt)
Then
arrResult = dt.Columns.Cast(Of DataColumn).Where(Function(c) dt.Rows(0)(c).ToString="y").Select(Function(c) c.Ordinal).ToArray()
Regards,
ppr
(Peter Preuss)
October 30, 2021, 12:52pm
3
When all row Indexes are needed, where a partivlar col value equals y:
Lets assume the Excel ist read in into a datatable
Assign activty
arIndex datatype: int32( ) =
Enumerable.range(0,dtData.rows.count).Where(function (x) dtData.rows(x)(colnameorindex).toString().trim().equals("y")).toarray
Shreeja
(K shreeja)
October 30, 2021, 4:11pm
4
Yoichi:
arrResult
I did try this…Got the array indexes …But not quite sure how to retrieve the corresponding currencies.Can you help me with that?
Shreeja
(K shreeja)
October 30, 2021, 4:29pm
5
I got the answer-The values corresponding to the cells.
Thank you so much. It helps slight_smile:
system
(system)
Closed
November 2, 2021, 4:30pm
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.