Platform

Platform

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

 View Only
  • 1.  Restrict line items in rowcount()

    Posted 02/26/18 03:06 PM

    Hi all! Is there a possibiliy to use rowcount() and restrict the data I want to count? My example: I want to count the rows in a table, but only if columnA=Primary and columnB IN (A, C, T). Unfortunatly, I haven't found any suitable function. The only solution from my point of view would be a new transform and add filter to this transform. Then the function rowcount() could be used. What do you think? Thanks in advance!


    #Platform


  • 2.  Re: Restrict line items in rowcount()

    Posted 02/26/18 03:24 PM

    Have you tried an if/then to say =1 if those two statements are true, and then do a sumif to total them?


    #Platform


  • 3.  Re: Restrict line items in rowcount()

    Posted 02/26/18 03:26 PM

    I would Use SUMIF(), you can look up exact formatting but basically =SumIf([column you want to check],[what you are checking for],[column to sum])

     

    So in your example the simplest way would be create a new column and check for Column A = Primary(if(colum A=primary, 1,0) to be true, another column and use a =if(if(search (A,column B))>0,1,0) +if(search (C,column B))>0,1,0) +if(search (T,column B))>0,1,0) >0,1,0)

     

    You can then add these columns and create a sum column to equal 1 if the value is >0, and then use the sumif function on this new column.


    #Platform


  • 4.  Re: Restrict line items in rowcount()

    Posted 02/27/18 09:34 AM

    @Travis Cole: I like your idea!!!

     

    But sorry!!! I probably forgot to mention the most important thing: I want to do a count on another table. And ROWCOUNT was the only function I've found so far, which can do this. 

     

    So, I have table A which needs to count something from tables B and C. Whole table B (easy by using ROWCOUNT) and in table C I need to restrict the line entries to the above given example.

     

    I also saw the SUMIF function. But from my understanding and testing, this function only counts values from the current table and not from a different one. So, adding a new column (to table C) and filling it with 1 - when all necessary conditions are fulfilled - is easy. But then I struggle with: ROWCOUNT(TableC) where NewColumn=1.

     

    Do you still have any ideas?


    #Platform


  • 5.  Re: Restrict line items in rowcount()

    Posted 02/27/18 09:38 AM

    Without knowing exactly what is being done it may be tough, but could you do the sumif in the other table and use a lookup to pull the value into the table you are working on?


    #Platform


  • 6.  Re: Restrict line items in rowcount()

    Posted 02/27/18 10:16 AM

    I believe, an example is needed.  And I still believe, I'm the issue here and Apptio can do this.

     

    This is the goal: Table A:

    CountTableBCountTable
    =ROWCOUNT(TableB)

    ???

    =SUM(Table C.Selection) does not work

     

    Table B: ROWCOUNT = 2

    LocationCosts
    Hanover500
    Berlin1000

     

    Table C: I only want to count line items with Selection = 1

    LineItemTypeStatusSelection
    1PrimaryA1
    2SecondaryA0
    3PrimaryC1

     

    I hope, this example makes it easier to understand my question.


    #Platform


  • 7.  Re: Restrict line items in rowcount()
    Best Answer

    Posted 03/06/18 05:26 AM

    How about (and not sure I follow):

    In C you do a SumIf, this gives you the count of lines given your criteria. (So you need a column where if criteria is met it equals 1, as you have in your example)

    Then you do a LookUp on primary, getting the SumIf column, this will bring back the first row, which is fine because the SumIf will be the same in all rows.

    This should give you the row count.

    Maybe.


    #Platform


  • 8.  Re: Restrict line items in rowcount()

    Posted 03/06/18 05:27 AM

    Sorry, just read this. So yes, what Travis said!


    #Platform


  • 9.  Re: Restrict line items in rowcount()

    Posted 03/07/18 09:07 AM

    Thanks a lot for all your help!! This really solved my question!


    #Platform