Hi all,
I’m having an issue formating a data column as numeral with one decimal digit.
The datatable has no headers and I need to convert the column index 3, which is as general now, to number.
The point is that I don’t want to use Excel activities but instead manipulate the data directly in the data table. Is it possible?
Best regards and many thanks,
Roberto Piccolli
Hi
Check with this thread for your scenario
Hi @sankar.mayilsamy
How about this expression?
(From d In DtBuild.AsEnumerable
Where CInt(d(1).toString.Trim)>=70
Select d).CopyToDataTable
Note → Need to give the Filter amount value instead of 70 in the expression
Check out the XAML file
ConertStringToInt.xaml (8.1 KB)
Regards
Gokul
Regards
Gokul
Cheers @roberto.piccolli
Hi @roberto.piccolli
Yes its possible and can you share the input and expected out
ppr
(Peter Preuss)
September 15, 2023, 9:56am
4
Yes in general possible.
When the data column Datatype is matching for the new value, then we can convert e.g. within a for each row and and assign Activitiy
When the data column Datatype is not matching for the new value, then we do the following:
Adding a new helper column
doing the conversion e.g. within a for each row
deleting origing column
renaming helper column to origin column name
moving helper column to the origin position by using the setOrdinal method of the data columns within an invoke method activity
For conversion / updating the column also have look here:
How to Update Data Column Values of a Data Table | Community Blog
e.g. DataColumn.Expression approach
I need to convert the column index 3 to number with one decimal digit
So the expected result would be 2.0; 3.0; 5.0 and so on
HI @roberto.piccolli
hope it will help for you
inside the loop you can use this condition = String.Format(“{0:F1}”, cint(CurrentRow(0)))
can see the output
1 Like
let me know its working or not for you
@roberto.piccolli
system
(system)
Closed
September 18, 2023, 10:48am
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.