Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
joshua1990
Post Prodigy
Post Prodigy

YYYYDDD to gregorian date

Hi all!

I have a column in a oracle DB that contains the date in the format YYYYDDD.

To performane an incremental refresh, I need to translate this format into YYYY-MM-DD, but how?

 

4 REPLIES 4
ppm1
Solution Sage
Solution Sage

Instead of converting your date column, you can convert your RangeStart and RangeEnd parameters, and then use those values in your filter step. It will still fold. Here is an example.

 

let
    RSasYYYYDDD = 1000 * Date.Year(RangeStart) + Date.Day(RangeStart),
    REasYYYYDDD = 1000 * Date.Year(RangeEnd) + Date.Day(RangeEnd),
    Source = Sql.Database("localhost", "Flights", [CreateNavigationProperties=false]),
    dbo_Date = Source{[Schema="dbo",Item="Date"]}[Data],
    #"Filtered Rows" = Table.SelectRows(dbo_Date, each [Date] >= RSasYYYYDDD and [Date] < REasYYYYDDD)
in
    #"Filtered Rows"

 

Pat

 

Microsoft Employee
lbendlin
Super User
Super User

 

 

let
  Source = Table.FromRows(
    Json.Document(
      Binary.Decompress(
        Binary.FromText("i45WMjIwMjIwMFSK1YGwDc1MlWJjAQ==", BinaryEncoding.Base64), 
        Compression.Deflate
      )
    ), 
    let
      _t = ((type nullable text) meta [Serialized.Text = true])
    in
      type table [Column1 = _t]
  ), 
  #"Added Custom" = Table.AddColumn(
    Source, 
    "Custom", 
    each Date.ToText(
      Date.AddDays(
        Date.From(Text.Start([Column1], 4) & "-01-01"), 
        Int32.From(Text.End([Column1], 3)) - 1
      ), 
      "yyyy-mm-dd"
    )
  )
in
  #"Added Custom"

 

 

 

Thanks @lbendlin : But this will break query folding, right?

If you are concerned about query folding then you need to do the transforms on the Oracle side, writing your own native query.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.