Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Nested IF statement dates

Hi,   I am trying to get the most recent date from 2 columns. If the result date is in 2018 then it must be transformed to 1-1-2019. this part to transform from 2018 to 2019 is where i get stuck. ...
  • novilpawar's avatar
    7 years ago

    Anonymous  hi,

     

    Create one calculated column.

    please change my columns name with yours.

    ""

    CC = 

    var max_date= IF([Colum 1]>[Colum 2] , [Colum 1] , [Colum 2])

    var upd_date = IF(YEAR(max_date) < 2019 || max_date = null , DATE(2019,1,1) , max_date)

    return

    upd_date

    ""

     

    Regards,

    Novil

  • tex628's avatar
    tex628
    7 years ago

    Replace NULL with BLANK()
    Remove the .Date from the date columns.