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
otmaneoirda
1 year agoNew Contributor
Member expansion on the "Remove" Function Alternative
Hello Community, I'm writing a rule to copy data from one scenario to another using api.data.calculate. However, I would like to exclude some accounts from being copied. Something like the follow...
- 1 year ago
You can remove more than one by separating them with a comma. Eg .Remove(Acc1, Acc2)
rhankey
1 year agoContributor III
You can pre-filter or post-filter data.
Here is an example of post-filtering, where the filter is applied to the destination buffer just before it is written back to the cube:
api.Data.Calculate("S#POV = RemoveZeros(S#SrcScenario)","A#Root.Base.Remove(A1,A2,A3))")
Here is an example of pre-filtering, where the filter can be applied to any one or all of the source buffers as desired:
api.Data.Calculate("S#POV = FilterMembers(RemoveZeros(S#SrcScenario),[A#Root.Base.Remove(A1,A2,A3)]))")
It usually more performance efficient to pre-filter the data, otherwise you are having OS calculate way more rows than are needed, only to toss them out after the fact.
Of course, with more advanced data buffer handlers, it is possible to filter or manipulate any data buffer way beyond the above two simple filtering methods.
Related Content
- 2 years ago
- 3 years ago