Forum Discussion

OS_Pizza's avatar
OS_Pizza
Contributor III
2 years ago

Cube view

I have 2 rows named row1 and row2.

1.  Row1 has two members namely A and B.

2. Row2 has three members namely C,D and E.

Now, I want to add row1 and row2 so that it sum all A,B,C,D and E.

Will this work or will it just take first 2 members(i.e A and C)  of each row? GetDataCell(CVR(Row1) + CVR(Row2)):Name(TotalSum)

  • Thomas_Bennett's avatar
    Thomas_Bennett
    New Contributor III

    Well I had to test this as I wasn't sure that the CVR would pull data from a getdatacell due to calc on the fly, Threw some random combination of accounts together to test and it worked 😮 

     

  • Thomas_Bennett's avatar
    Thomas_Bennett
    New Contributor III

    OneStream is not ideal for summing on the fly, CVR/CVC allow you to specify the index number of a member within a row or column so in your example it would look something like: GetDataCell(CVR(Row1,1) + CVR(Row1,2) +CVR(Row2,1) +CVR(Row2,2) + +CVR(Row2,3)):Name(TotalSum)

    However this is not very dynamic.  

    Do create something dynamic is a lot more difficult. I have solved the problem but I'm not sure my method is best practice so I wont share here!

     

    • OS_Pizza's avatar
      OS_Pizza
      Contributor III

      How about

      Row1 = GetDataCell("A#A + A#B): Name("Operating income (loss)")

      Row2 = GetDataCell("A#C + A#D + A#E): Name("Operating income (loss)")

      I want to add Row1 and Row2 in another row called Row3 without using the member filter?