dr1992
September 7, 2022, 11:59am
1
Hey there,
I need to find if a cell of a Data Table contains the word ‘Ply’ (it may be part of a full value, eg: Ply-Lining CDV (Network)) and then if it does, get the value in the column next to it, which will be the cost of the item.
So eg DT:
(This won’t be in excel, of course)
It needs to realise that ‘ply’ is in Col 1 and return £300 in Col2
How would I do this? My Data table variable is set to pDT.
Thank you for your help!
ppr
(Peter Preuss)
September 7, 2022, 12:02pm
2
do a start with filtertable activity and using the contains operation
Hey!
Try this
Read range output - pDt
Read range output - ResultDt (This is for headers)
Take one for each row in data table and pass the pDt and create the rowindex variable in the properties panel
Take one if condition and pass the expression like this
CurrentRow("Col1").ToString.Trim.Contains("ply")
Now take one assign activity in the then block pass the value like this
ResultDt.Rows(RowIndex_Dt1).Item("Col1") = dt1.Rows(RowIndex_Dt1).Item("Col2").ToString.Trim
Now use write range provide the dt as ResultDt → Chcek AddHeaders
Try this and let me know
Regards,
NaNi
dr1992
September 7, 2022, 1:40pm
4
Is that not just for excel? I shan’t be working with excel in this case!
dr1992
September 7, 2022, 2:44pm
5
For each row, then ‘If’ row(0).ToString.Contains(“WORD”)
Assign: DesiredValue = row(“Column2”).ToString
Str=DT.Asenumerable.Where(Function(r) r(0).Tostring.Contains(Your_String)).First().Item(1).Tostring
system
(system)
Closed
September 11, 2022, 3:15am
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.