I’m writing in my excel, by appending ranges in each iteration, and by each iteration I need to sort my column in an ascending order.
I’m managing to do it but at one point the column stops to be sorted in an ascending order and I can´t find the problem
For each origin number, I need to organize the rows by sorting in an ascending order, by the column Date of Creation.
What is happening is that it does it correctly until a certain point an then it does not. You can see in the Sample file I´m sharing, row 8 should be after row 5.
Hey @Filipe_Silva! I’m not sure about your scenario, so I’m assuming the following: You append rows throughout the workflow and the expected result is this table in excel sorted by ASC date.
→ In this case, I will suggest the following approach! Insert the lines one by one without worrying about the sort yet. At the end of the whole workflow, read this excel table to a dt, do the sort as I will show next and then write the sorted table again.
Unfortunately this does not work in my case, don´t know why because I´m using a query just like you, but I´m doing the following :
Order By DateTime.ParseExact(row(“Date”).toString,“dd-MM-yyyy”, System.Globalization.CultureInfo.InvariantCulture) Select row).CopyToDataTable
With your input:
Order By DateTime.ParseExact(row(“Date”).toString,“dd-MM-yyyy”, System.Globalization.CultureInfo.InvariantCulture) Ascending Select row).CopyToDataTable
But with your input, now my sort is not happening at all and my column Date is disorganized.