Forum Discussion

anoomohan's avatar
anoomohan
Helper III
1 year ago
Solved

extract date

Pleaes help mewith the right answer for below - different sites are showing different answer

 

 

 

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from rajendraongole1 and ray_aramburo.

     

    Hi anoomohan ,

     

    During my testing, both C and D options were able to get date columns with a hierarchical structure. The difference is that C will split the column into date and visual (the question doesn't talk about whether the time and original data are still needed), while column D needs to be extracted with the date in text form, which still needs to be formatted. If a correct answer is needed, then C is straightforward to get the desired result, while D requires an additional step, so I would choose C.

     

    Best Regards,
    Zhu

     

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

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for the reply from rajendraongole1 and ray_aramburo.

     

    Hi anoomohan ,

     

    During my testing, both C and D options were able to get date columns with a hierarchical structure. The difference is that C will split the column into date and visual (the question doesn't talk about whether the time and original data are still needed), while column D needs to be extracted with the date in text form, which still needs to be formatted. If a correct answer is needed, then C is straightforward to get the desired result, while D requires an additional step, so I would choose C.

     

    Best Regards,
    Zhu

     

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

  • Hi anoomohan - correct answer is: Apply a transformation to extract the last 11 characters of the Logged column and set the data type of the new column to Date.

    Explaination: The column "Logged" contains both date and time.To analyze by date, you should extract only the date portion from the string (first 10 characters).

     

     

    Plea

    • anoomohan's avatar
      anoomohan
      Helper III

      right answer given is to split the column with at as delimiter

       

      in fact, different sites give different answer for this question 

       

       

    • anoomohan's avatar
      anoomohan
      Helper III

      also u mentioned to extract last 11 characters - 2018-12-31 at 8:59 

      is this including spaces - here if we select last 11 characters - will it be "-31 at 8:59" ; and we will have only 2018-12 left? 

  • The simplest step is to extract the first 11 characters (answer D) but this will work 100% only with the assumption that all the values within that column have the same format