IBM Apptio

Apptio

A place for Apptio product users to learn, connect, share and grow together.


#Aspera
#Apptio
#Automation
#FinOps
#Apptio
#ITAutomation
 View Only
  • 1.  Adding years to a date

    Posted 06/01/21 08:17 AM
    ​​Hi All,

    My data source has a date column that an asset was purchased - I need to add 4 years to this date but cannot work out the formula to do so - can anyone help please?

    thanks
    #CostingStandard(CT-Foundation)


  • 2.  RE: Adding years to a date

    Posted 06/01/21 10:50 AM
    Edited by Guillermo Cuadrado 11/05/24 06:27 PM

    One way to do this, assuming a format YYYY/MM/DD hh:mm:ss. If it's a different format, you can always use the same technique by extracting the year somehow, and then inserting the new year with another MID().

     
    Also, I have taken the brutal approach of adding 4 to the Year (hence the 4.003 elapsed time, because of the leap year in 2020), but from a human perspective, that would be correct.

     

    I did the following:
    1) Year=Left(Received Date,4)                    (label column)
    2) Year plus 4=Year+4                                  (numeric column)
    3) New Date=Year plus four&Mid(Received Date,5,Len(Received Date))

    To see that Apptio still understands "New Date" as a Date column I tried one last thing:

    4) Elapsed Time=Elapsed(Received Date,New Date)/3600/24/365

    Which yields the 4 year difference.
    Good luck, @Roisin Rogers!

    You probably can do it in other ways, but this seems to work.