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

pling's avatar
pling
New Contributor II
3 years ago
Solved

Removezeros in getdatabuffer

Hi,

We have a seeding rule that is copying zeros:

sourceActualsBuffer = api.Data.GetDataBuffer(DataApiScriptMethodType.Calculate,S#Actual_Opco:U5#None,False, destinationBuffer)

 

I am trying to change it so it does not include zeros, by applying the removezeros function:

sourceActualsBuffer = api.Data.GetDataBuffer(DataApiScriptMethodType.Calculate,"RemoveZeros(S#Actual_Opco:U5#None)",False, destinationBuffer)

 

When I do this, I get an error see attachmement.

I tried to change the quotes RemoveZeros("S#Actual_Opco:U5#None") but then i get a different error when validating. 

 

Could not find anything in the reference on how to fix this. Anybody can help?

 

  • Hi, you can use GetDataBufferUsingFormula, e.g.

    api.Data.GetDataBufferUsingFormula("RemoveZeros(FilterMembers(S#ACT:O#Top,F#Closing.Base))",,False)
     
    You can also use your data buffer, loop through the cells and remove the zeros and no data cells like that.

3 Replies

  • Henning's avatar
    Henning
    Icon for OneStream Employee rankOneStream Employee

    Hi, you can use GetDataBufferUsingFormula, e.g.

    api.Data.GetDataBufferUsingFormula("RemoveZeros(FilterMembers(S#ACT:O#Top,F#Closing.Base))",,False)
     
    You can also use your data buffer, loop through the cells and remove the zeros and no data cells like that.
  • pling's avatar
    pling
    New Contributor II

    Thanks Henning! seems to work. Need to further test it!

  • chris_rothermel's avatar
    chris_rothermel
    Icon for OneStream Employee rankOneStream Employee

    Yes the RemoveZeros function for the script is wonderful.  It would also be nice to apply that command to a DataBuffer object.   

    Please vote for this enhancement:

    https://community.onestreamsoftware.com/idea/PlatformCore/add-removezeros-as-a-databuffer-method/45348