The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
Gidon_Albert
3 years agoContributor II
Data Buffer FilterMembers() with Empty Cells
Does the api.Data.GetDataBufferUsingFormula("FilterMembers(...)") only get cells that have values?
Is there a way to create a data buffer with empty cells?
Use case: We need to to cycle th...
ckattookaran
3 years agoValued Contributor
Yes and no, you can create a buffer with existing data only. Now once you have that anchor you can loop through those cells and get stuff from the members that are there in the buffer. You can then create a new buffer and while looping through your anchor you can change the account and other members of the result databuffer cell and save it.
Not sure if that is what you are looking for.
- Gidon_Albert3 years agoContributor II
Right. So the problem is that the initial data buffer does not generate any cells because there are no cells with data. In other words, the anchor is empty so there is nothing to loop through.
- JackLacava3 years ago
OneStream Employee
Yes. A different approach, starting from scratch, should work but it's very low level and somewhat tedious. This is a rought start that should work (not tested...
'create a new PK for each cell, describing the intersection Dim newPk As New DataBufferCellPk() newPk.AccountId = api.Members.GetMemberId(dimtype.Account.id, "myacc") newPk.FlowId = api.Members.GetMemberId(dimtype.Flow.Id, "myflow") '... set all dimensions ... ' create a new cell with the pk. There are other constructors too. Dim newCell As New DataBufferCell(newPk, 10.0, DataCellStatus.CreateDataCellStatus(False, False)) ' create the buffer, put cell(s) in it Dim newBuffer As New DataBuffer() newBuffer.SetCell(si, newCell) ' trigger saving to database Dim dest As ExpressionDestinationInfo = api.Data.GetExpressionDestinationInfo("") api.Data.SetDataBuffer(newBuffer, dest)
Related Content
- 3 years ago
- 1 year ago