Skip to main content
auroraj5980
July 28, 2023
Solved

Sort data Export DSE to Excel smartservice

  • July 28, 2023
  • 1 reply
  • 0 views

I am generating an excel with Export DSE to EXCEL.
The smartservice consults a view with the data ordered by a date field.
The result obtained in the smartservice is ordered by id (PK), not by date.
How can we order by the date field in this smartservice or collect the records as they are in the view without ordering them by pk?

    Best answer by mathieud0001

    For your view, you'll have to calculate a sequence that will act as your PK (which will be different than your real PK in the table which will help you maintain the order.

    You could use row_number() in your view SQL to do this.

    1 reply

    mathieud0001
    July 28, 2023

    For your view, you'll have to calculate a sequence that will act as your PK (which will be different than your real PK in the table which will help you maintain the order.

    You could use row_number() in your view SQL to do this.