Forum Discussion

AtharvaKabade's avatar
AtharvaKabade
New Contributor
5 days ago

How to looping Through Cube View Rows to Read Amount and Text Value Using Business Rule?

 

 

3 Replies

  • sameburn's avatar
    sameburn
    Contributor III

    Hi AtharvaKabade​ 

    If you want to replicate that CubeView data set in its entirety, you may want to consider using the FDX CubeView BRApi

    There is an example here

    This method uses your CubeView to derive the data set and returns the output as a DataTable.

    You can then interact with this DataTable to retrieve the values you want e.g. loop through DataRows or use .Select, etc

    So less overhead for development since you can read your variables directly from the CubeView itself (including Commentary and / or Dynamic Calcs)

    Hope this helps

    Sam

  • dsebenaler's avatar
    dsebenaler
    New Contributor III

    Hey Atharva. I think some of the key OneStream API functions/subs you could try using include:

    1. Api.Data.GetDataCell().CellAmount - can be used to get a cell's amount/decimal value 
    2. Api.Data.GetDataCellEx().DataCellAnnotation - can be used to get a cell's annotation/text value 

    For the loop itself I would recommend trying to use data buffers to grab slices of the data units that are represented in your cube view. You can use a "for each...next" loop to loop through the cells in each required data buffer and utilize (1) and (2) for each cell in the loop to drive additional logic within the finance business rule.