Platform

Platform

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

 View Only
Expand all | Collapse all

Count Lines with Current Month

  • 1.  Count Lines with Current Month

    Posted 01/10/18 04:24 PM

    Hey all!

     

    Looking to write a formula that will give me a count of lines in the table that have the current month in it.  We have a column (Short Date) that has MM-YYYY combo in it.  We want to say =if(Short Date=Current Date,1,0).  Current Date being whatever month/year we are in.

     

    Does anyone know how to go about doing this?  Everything I've tried so far has brought back an error.

     

    Thanks!

    Molly




    #TBMStudio


  • 2.  Re: Count Lines with Current Month

    Posted 01/11/18 02:39 AM

    Hi Molly,

     

    maybe the Months() and the CurrentDate() function might help you:

     

    The months function returns a decimal value (months count since January 1, 1970). So a formula - depending on your date format - might look like this:

     

    =If(Months('your date column')=Months(CurrentDate('your date format'),1,0)

     

    Didn't test it but maybe it helps.

     

    Months() Function

    CurrentDate() Function


    #TBMStudio


  • 3.  Re: Count Lines with Current Month

    Posted 01/11/18 07:29 AM

    Thanks!


    #TBMStudio


  • 4.  Re: Count Lines with Current Month

    Posted 01/11/18 03:06 AM

    Hi Molly,

    According to me you have two posibilities

    1.  Create column "Is current date" with function =if(Short Date=CurrentDate("MM-yyyy"),1,0) and then column "Count" with formula =Sum({Is current date}) 

    2. Create a table transform and set on Date filter: Row filter (Start) on "Short Date" column. Number of rows in table transform is what you are looking for.


    #TBMStudio


  • 5.  Re: Count Lines with Current Month

    Posted 01/11/18 07:30 AM

    Thanks!


    #TBMStudio