0

enter image description hereMy question is , I have a file in .txt format where there is a column called Timestamp along with many other columns.

Timestamp 01.06.2021 10:30:45...row 1 01.06.2021 10:40:45...row 2 01.06.2021 10:31:30...row 3

Now I would like to sort them in correct order, the required o/p would be:

Timestamp 01.06.2021 10:30:45....row 1 01.06.2021 10:31:30....row 2 01.06.2021 10:40:45....row 3

But the problem is I applied a data flow in ADF, with the sort activity but the files are not changing. Any help would be highly appreciated.

this is how the Timestamp column looks

chat_dev
  • 7
  • 2
  • Can you show use the file data more detailly, any screenshots? – Leon Yue Jun 02 '21 at 01:47
  • @LeonYue, thanks for replying. I just added a link of the image that shows the Timestamp column structure . It takes the column as string. So, the problem is sorting is not happening at all. – chat_dev Jun 02 '21 at 09:05
  • Hi @chat_dev, got it! Did you try to convert the date format and then sort again? – Leon Yue Jun 02 '21 at 09:07
  • Hi@LeonYue, yes I did that then the date section is going out of the picture. Keeping only the time stamp. – chat_dev Jun 02 '21 at 09:54

1 Answers1

0

The error is caused by the string 01.06.2021 10:30:45 is not a valied date string, that's why the sort doesn't work.

Please convert it to correct date data type with Derived Column and then sort again. For example:

Source: enter image description here

Derived Column: expression toString(replace({Timestamp }, '.', '-'),'dd-mm-yyyy hh:mm:ss:sss'): enter image description here

Sort active: enter image description here

Leon Yue
  • 15,693
  • 1
  • 11
  • 23
  • Thanks@Leon Yeu. I agree with you. The dataset is quite unstructured and is coming in real time , with some other encoded format.I will try that right away and let you know. But thanks a lot for a quick solution. – chat_dev Jun 02 '21 at 09:56