Julian Date
Hi Experts,
I have connected to one database and I am getting date in Julian format. How can I convert them into normal date?
Thanks,
Ajeet Mahajan
Answers

HI @user18189
Which format are your Julian dates in? YYDDD or YYYYDDD?
Since Julian dates count the number of days and doesn't use months you'd need some sort of DATE_ADD function call to add the number of days.
1 
0

If you're doing this via a Magic ETL2.0 you can utilize these formulas in a single formula tile: (MAGIC ETL2.0 only  I've broken them down for easier reability). julian is your date field with your Julian date. This formula assumes you'll always have a 7 digit date.
JDAY:
RIGHT(`julian`, 3)
JYEAR:
LEFT(`julian`, 4)
GYEAR:
DATE_FORMAT(CONCAT(`JYEAR`, '0101'), 'YYYYMMDD')
GDATE:
DATE_ADD(`GYEAR`, (`JDAY`  1))
Alternatively if you want to do this in a beast mode or want a condensed version for your formula tile you can do this:
DATE_ADD(DATE_FORMAT(CONCAT(LEFT(`julian`, 4), '0101'), 'YYYYMMDD'), (RIGHT(`julian`, 3)  1))
To break down the logic. I'm splitting out the days and years, then calculating the first of the year. Once I have the first of the year I'll then add the specific number of days to the first of the year (minus 1 since we're 1 based).
If you don't have Magic ETL 2.0 (in beta) talk to your CSM or alternatively use magic 1.0 tiles to get the left and right values from your julian date, figure the first of the year for your julian date, add the days to that date.
Something like this should work (copy and paste into your magic ETL 1.0 dataflow)
{"contentType":"domo/dataflowactions","data":[{"name":"String Operations","id":"b4919418af274d33ba575337b66ca10a","type":"StringCalculator","gui":{"x":456,"y":120},"dependsOn":["302bdd61b1d841f9b935bfa893f48562"],"removeByDefault":false,"notes":[],"calculations":[{"calcType":"SUBSTR_RL","constantB":{"value":"4","type":"LONG"},"constantC":{"value":"LEFT","type":"STRING"},"fieldA":"julian","fieldName":"JYEAR"},{"calcType":"SUBSTR_RL","constantB":{"value":"3","type":"LONG"},"constantC":{"value":"RIGHT","type":"STRING"},"fieldA":"julian","fieldName":"JDAY"}]},{"name":"Combine Columns","id":"e7d3dcda71ee4b69a75addcefd7858d5","type":"ConcatFields","gui":{"x":672,"y":120},"dependsOn":["e21f76c759f849b3aada891e70fbe989"],"removeByDefault":false,"notes":[],"separator":"","targetFieldName":"GSTART","removeSelectedFields":true,"fields":[{"name":"JYEAR"},{"name":"GMONTH"},{"name":"GDAY"}]},{"name":"Add Constants 1","id":"e21f76c759f849b3aada891e70fbe989","type":"Constant","gui":{"x":576,"y":120},"dependsOn":["b4919418af274d33ba575337b66ca10a"],"removeByDefault":false,"notes":[],"fields":[{"name":"GDAY","type":"STRING","value":"01"},{"name":"GMONTH","type":"STRING","value":"01"}]},{"name":"Set Column Type","id":"5cf87171de0e4efda6bbac6ea4af627c","type":"Metadata","gui":{"x":768,"y":120},"dependsOn":["e7d3dcda71ee4b69a75addcefd7858d5"],"removeByDefault":false,"notes":[],"fields":[{"name":"GSTART","type":"DATE","dateFormat":"YEAR_FIRST"},{"name":"JDAY","type":"LONG"}]},{"name":"Date Operations","id":"f7af926d8cbe476baa270fb02863aaaf","type":"DateCalculator","gui":{"x":888,"y":120},"dependsOn":["5cf87171de0e4efda6bbac6ea4af627c"],"removeByDefault":false,"notes":[],"calculations":[{"fieldName":"Gregorian 1","calcType":"ADD_SUBTRACT_DATE","fieldA":"GSTART","fieldB":"JDAY","constantC":{"type":"STRING","value":"DAYS"}}]}]}
1 
@GrantSmith Thanks for replying!
0 
Did that solve your problem? If so can you accept the answer so it's easier for others to find the solution in the future? Thanks!
1