Skip to main content
Contributor
March 23, 2025
Solved

Change View POV inside Custom Calculate BR

  • March 23, 2025
  • 2 replies
  • 0 views

Dear all,

 

We have 2 custom calculate functions (Finance BR) that are executed one after the other. The 1st one uses V#Period as POV and the 2nd uses V#YTD as View POV. These POV are set on the data management steps that use these functions.

We'd like to merge both functions into one to simplify maintenance but the fact that they use different View POV creates an issue; if the data management steps uses V#Periodic or V#YTD, one function will work properly but not the other. Do you know how it can be set as a fixed View POV into the functions itself? Maybe there's a way updating the value of the "args" variable that is used as an input into the formula.

Thank you for the help and guidance.

Best regards,

Carlos

 

Best answer by markolainio

You can define the view by using ExpressionDestinationInfo like this:

Dim destination As ExpressionDestinationInfo = api.Data.GetExpressionDestinationInfo("V#YTD")

api.Data.SetDataBuffer(result_buffer, destination)

2 replies

RobbSalzmann
Legend
March 26, 2025

If you're sure your calcs will always use V#Period, then V#YTD, consider just hard-coding the values and be done with it.  Simple is often better.

Post your code if you need a little help making it work like this.

Contributor
March 26, 2025

Thank you Robb.

In case of an api.data.calculate that makes sense, but how to manage in case of calculating using a data buffer? Because the output data buffer will take the view from the POV. Is there a way to change it hardcoded?

Thank you 

Newcomer
March 27, 2025

You can define the view by using ExpressionDestinationInfo like this:

Dim destination As ExpressionDestinationInfo = api.Data.GetExpressionDestinationInfo("V#YTD")

api.Data.SetDataBuffer(result_buffer, destination)