Forum Discussion

Langtry's avatar
Langtry
Regular Visitor
3 years ago
Solved

Converting Date Hour Minute dimension to useable date format (from google analytics)

Hi there!

I'm pulling in a dimension via the Google Analytics connector that gives me YYYYMMDDHHMM. Example: 202207281824

 

What's the best way to turn that in to a useable date type? I could probably do it with a bunch of split column functions, concatenation, etc. But I'd have to create those steps on all the tables. Is there formula that would worK? 


Appreciate any help you can provide.

 

Thanks,

Paul

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Langtry ,

     

    Here's my steps of solution.

    1.Change your column as text type.

     

    2.Split column by number of characters.

     

    3.Still make the new columns are text types.

     

     

    4.Add a custom column.

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Langtry ,

     

    Here's my steps of solution.

    1.Change your column as text type.

     

    2.Split column by number of characters.

     

    3.Still make the new columns are text types.

     

     

    4.Add a custom column.

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • ppm1's avatar
    ppm1
    Solution Sage

    You can use this expression in a custom column (or with Table.TransformColumns() )

     

    = Date.FromText(Text.Start([DateTimeText],8))

     

    Pat