Platform

Platform

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

 View Only
  • 1.  How to adjust a date?

    Posted 02/10/22 08:22 PM
    Currently, I have a table that I need to create a new date column for that is one month different from a column in the existing table.  However, there does not seem to be an easy way just to adjust the month to do a date partion in a differnet table.
    #TBMStudio


  • 2.  RE: How to adjust a date?

    Posted 02/11/22 06:48 AM
    Edited by James Funk 11/05/24 06:24 PM
    If I'm understanding your question correctly, you could just parse out the month from the the current field, add 1, then use that value to create your adjusted date field that you use in the date partition.

    Original Date="2/11/2022"
    Original Month = Split(Original Month,1,"/")
    Original Day = Split(Original Month,2,"/")
    Original Year = Split(Original Month,3,"/")
    Adjusted Month = If(Original Month=12,1,Original Month +1)
    Adjusted Year = If(Original Month=12,Original Year+1,Original Year)
    Adjusted Date = Adjusted Month&"/"&Original Day&"/"&Adjusted Year

    Some of this might need to be modified depending on the format of your original date field.

    I'm pretty sure there are other methods using combinations of the Dateformat(), Days(), and/or Months() formulas that might require fewer formula fields, but I find the above is pretty straightforward and obvious to anyone who might be coming later and looking at your config.