question

arkiboys avatar image
0 Votes"
arkiboys asked HimanshuSinha-MSFT answered

data flow date format

Hello,
I would like to format the column values in GB date format as follows but I get null.
Any suggestions?
note that the existing values (SourceFormat) are as in yyyy-MM-dd but I would like to change them to: dd/MM/yyyy

I use the following in the expression builder
toDate(toString(byName($0)),Config#lookup($0).SourceFormat, 'Europe/London')

azure-data-factory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

HimanshuSinha-MSFT avatar image
0 Votes"
HimanshuSinha-MSFT answered

Hello @arkiboys ,
Thanks for the ask and using Microsoft Q&A platform .

I did try to play with the toDate function and though i was not successful , I know why its showing NULL in your case . Its expects a the input format as a parameter , which you are not passing . please read here

Quick snippet from the doc

toDate
toDate(<string> : any, [<date format> : string]) => date

Converts input date string to date using an optional input date format.




I will try to get in touch internally with the SME’s , but now you can try the below work around .

concat(split(SourceFormat,'-')[3],'/',split(SourceFormat,'-')[2],'/',split(SourceFormat,'-')[1])

148382-image.png


Please do let me know how it goes .
Thanks
Himanshu


  • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how

  • Want a reminder to come back and check responses? Here is how to subscribe to a notification

  • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators



image.png (59.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.