Forum Discussion
Marcello
3 years agoContributor
api.Data.SetDataBuffer in increment mode
Hi all,
we have a databuffer with values to be cumulated in a specifi destination intersection.
The issue we have is that api.Data.SetDataBuffer always wirte the last value.
Is there a standard...
- 3 years ago
Hi Giacomo,
we had a call with a Onestream consultant
The final outcome is that we agreed that the best way to handle cumulation is to use the "evergreen" api.Data.GetDataCell and "api.Data.Calculate" (while looping records in the databuffer).
This give us 2 advantages:
- we can instruct the calculation with element names rather than the IDs
- we can debug the calculation line by line
Thanks a lot for the help.
Marcello
Marcello
3 years agoContributor
Hi Marc,
sorry how many commas do I need to put? Is it the "isDurableCalculatedData" that makes the cumulate?
Thanks,
Marcello
- JackLacava3 years ago
OneStream Employee
I think Marc is talking about dataBufferObj.setCell(newValue, accumulateIfCellAlreadyExists) - that second parameter is a boolean. That method allows you to accumulate values in a single cell of the buffer.
So you will still have to loop through cells, but you can avoid having to retrieve existing numbers.
Note that you can also simply sum two buffer objects together, e.g.
Dim resultBuf as DataBuffer = originalBuffer + newValuesBuffer
Related Content
- 2 years ago
- 4 years ago
- 1 month ago