A datatable
In that “Lastnumber” is the value which is getting by adding +1 with the next row “Number”
Here I am getting each row in datatble using add data row …
Help with the logic
A datatable
In that “Lastnumber” is the value which is getting by adding +1 with the next row “Number”
Here I am getting each row in datatble using add data row …
Help with the logic
DO you need to populate only LastNumber? Name and Number exists in Excel/Datatable? Why exactly you are using AddRow?
Hi @Sweety_Girl
“Here I am getting each row in data table using add data row …”
If this is the case, either you’re adding rows with just the “Number” column values and no “Lastnumber” values, or every time your loop runs (assuming there’s some kind of loop involved here), you can find out what the next value in the Number column will be.
If it is the latter, in your add data row property “ArrayRow”, enter – {45 (number value), 72(next number value) + 1}
Enclose the above in an If activity. The condition is that the above “Add data row” only runs if you’re NOT at the last loop. If you are, then for that, you need to have an Add data row activity in the else part as well and in its property–“ArrayRow”–you need to enter this–{78,“”} where “” is an empty string.
~SG
You can follow below steps:
Let us take you are having a datatable dta which is having columns Name and Number with Values and Column Lastnumber without Value.
So use below Query in Assign Activity to get the OutPut.
dta= (From p In dta.Select
Let x=If(Not dta.Rows.IndexOf(p)=dta.Rows.Count-1,Convert.ToString(Convert.ToInt32(dta.Rows(dta.Rows.IndexOf(p)+1)("Number"))+1),String.Empty)
Select dta.Clone.Rows.Add(Convert.ToString(p("Name")),Convert.ToString(p("Number")),x.ToString)).ToArray().CopyToDataTable
Now write dta in Excel.
Regards,
Mahesh
LastNumber value is +1 value inthe 2nd row of “Number”
overload resolution failed
I have already tested the query. It’s working fine…
Can you please post the screen shot with query what you have used.
Regards,
Mahesh
Working
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.