Platform

Platform

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

 View Only
  • 1.  Column Counting Lines in Current Month

    Posted 10/24/17 03:44 PM

    Is it possible to create a formula column in a table that will put the value "1" if the date column is in the current month?  I want it to be dynamic so that if I am in September only September dates get a "1" and if I'm in October only October dates get a "1".

     

    Any help is appreciated!


    Thanks!





    #TBMStudio


  • 2.  Re: Column Counting Lines in Current Month

    Posted 10/24/17 06:31 PM

    Hi @Molly Meinert, I'm not sure how your date is formatted, but try comparing your date column to a column with the formula =CurrentDate()

     

    So like this :

    Date (this is your date column already populated in data)

    Test =CurrentDate()

    In Current Month =IF(Date=Test,1,0)

     

    That should give you the behavior you're looking for, granted your Date column may be formatted differently than CurrentDate()'s return value. You can update how the return value appears though. View that in the functions page CurrentDate function 

     

    Hope that helps!

     

    Shelby


    #TBMStudio


  • 3.  Re: Column Counting Lines in Current Month

    Posted 10/25/17 01:54 AM

    I agree with @Shelby Ohyama. However, you need to be a little careful with dates in Apptio, and how you do comparisons. If you do the above, but convert them to labels, then oyu will be OK. However if they are formatted as Dates, oyu may get unexpected results.

     

    For example, the following code tests if a Date is greater than the current fiscal year. Note you need to use the days operator to do that comparison.

    PO date is a Date column in the source data

    current year=Right(DateFormat(CurrentDate(),"ffff"),4)
    valid year=If(days(PO Date)>=days(Start of Year),"Yes","No")

     

    For you example you could use the following formulae, but make sure they the columns are set as Labels and not Dates, so that you are just doing a string comparison

     

    Current Month = DateFormat(CurrentDate(),"ddMMM")

    Comparison Date = DateFormat (DateinYourData,"ddMMM")

    In Current Month =IF(Curent Month=Comparison Date,1,0)


    #TBMStudio


  • 4.  Re: Column Counting Lines in Current Month

    Posted 10/27/17 03:25 PM

    Thank you both!  I'll give this a try!


    #TBMStudio