0

In Google Dataprep when I apply min() to a date it gives a long serial number e.g. 1304985600000. I'm trying to get the first order date of a customer but I can't seem to do anything with this number

Thanks

Aaron Harris
  • 415
  • 1
  • 5
  • 15

2 Answers2

2

It's a UNIX timestamp represented in milliseconds. With this value in BigQuery, simply do:

SELECT TIMESTAMP_MILLIS(1304985600000)

Output:

Row f0_  
1   2011-05-10 00:00:00.000 UTC 
Graham Polley
  • 14,393
  • 4
  • 44
  • 80
1

You can convert the unix timestamp to a Date in Cloud Dataprep using the UNIXTIMEFORMAT function: https://cloud.google.com/dataprep/docs/html/UNIXTIMEFORMAT-Function_57344709

Lars Grammel
  • 1,999
  • 16
  • 21