I want to count character in column Create ID.
If count character= 7 insert 0 in front of old text.
Please guide me for solve it.
data.xlsx (10.2 KB)
I want to count character in column Create ID.
If count character= 7 insert 0 in front of old text.
Please guide me for solve it.
data.xlsx (10.2 KB)
You can use For Each Row activity, inside that you can access the Create ID column value as CurrentRow(“Create ID”).ToString, and get the character count inside that string using Length method
CurrentRow(“Create ID”).ToString.Length
This is input file
and Below is the output
Count_Char.zip (41.7 KB)
Hi,
Try below linq
Assign activity:
ResultDataTable = (From row In YourDataTableVar.AsEnumerable()
Let value = row.Field(Of String)(“ColumnA”)
Let newValue = If(value.Length = 7, “0” + value, value)
Select YourDataTableVar.Clone().Rows.Add({newValue}).CopyToDataTable()).CopyToDataTable()
I have a question.
If I want to sort column Planned Start (ascending)
How to edit your code?
Thank you.
Hi @fairymemay
Try this:
ResultDataTable = (From row In YourDataTableVar.AsEnumerable()
Let value = row.Field(Of String)("ColumnA")
Let newValue = If(value.Length = 7, "0" + value, value)
Order By row.Field(Of DateTime)("Planned Start") Ascending
Select YourDataTableVar.Clone().Rows.Add({newValue}).CopyToDataTable()).CopyToDataTable()
Hope it helps!!
Hi,
Here is the modified linq query:-
ResultDataTable = (From row In YourDataTableVar.AsEnumerable()
Let value = row.Field(Of String)(“ColumnA”)
Let newValue = If(value.Length = 7, “0” + value, value)
Select YourDataTableVar.Clone().Rows.Add({newValue})
Order By DateTime.ParseExact(row.Field(Of String)(“Planned start date”), “dd/MM/yyyy”, CultureInfo.InvariantCulture)
).CopyToDataTable()
Hi @fairymemay
Pass your datatable variable in place of YourDataTableVar.
Regards
@Jayesh_678 @Parvathy error as below.
Hi,
Import below dependencies from import tab
Imports System.Data
Imports System.Globalization
Thanks
Replace Column A with your Id column name , replace planned start date with your planned start date column. Column names are case sensitive.
Thanks
Hi @fairymemay
What is your output variable DataType?
ResultDataTable = (From row In YourDataTableVar.AsEnumerable()
Let value = row.Field(Of String)("ColumnA")
Let newValue = If(value.Length = 7, "0" & value, value)
Order By DateTime.ParseExact(row.Field(Of String)("Planned Start"), "M/d/yyyy", System.Globalization.CultureInfo.InvariantCulture) Ascending
Select YourDataTableVar.Clone().Rows.Add({newValue}).CopyToDataTable()).CopyToDataTable()
Hope it helps!!
Hi,
Give me some time. I will provide you a xaml file.
Thanks
@Jayesh_678 if I want to more filter column Owner = IT or Eng.
How to edit code?