Skip to main content
Contributor
January 10, 2022

Studio Report - calculating % at Group band level

  • January 10, 2022
  • 1 reply
  • 0 views

SOURCE: ONESTREAM CHAMPIONS

Champions,
Is there a way to have a Studio report recalculate a value at a group summary level instead of having the report sum up values from the detailed band?

In example below, the ROI% as the 401 Total line is displaying 4.7% which is the summed up total of % from detail records. This value should instead be recalculated as Total Net ROI / Total Revenue = 510,000 / 15,000,000 = 3.14%

In Studio, Is there a way to define a calculated field that uses data from other fields on the same band i.e. the group total Net ROI and Total Revenue?

 

https://discourse-static.influitive.net/uploads/db_8467a788_7b9e_45b8_8b6c_d37e1967220d/original/1X/ad449b0c9dc199805a6c0159e56cea02d6698bfb.png
image.png1046×396 8.73 KB

1 reply

CosimoAuthor
Contributor
January 10, 2022

Small correction: Total Net ROI / Total Revenue = 510,000 / 15,000,000 = 3.4% and not 3.14%

Newcomer
January 10, 2022

I guess this is where scripts can come in handy. However, there is no documentation whatsoever on how to write them.
Here is something you can try
Remove the Summary on that label, add a script on the before print event.

Imaging that 4.7 is called as label47, 510000 is called as label45, and 15,000,000 is called as label46
Then this will give you what you are looking for.

Private Sub label47_BeforePrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs)
dim decRevValue as decimal = Decimal.Parse(me.label46.Summary.GetResult())
dim decROIValue as decimal = Decimal.Parse(me.label45.Summary.GetResult())

me.label47.text = decROIValue/decRevValue
End Sub
CosimoAuthor
Contributor
January 10, 2022

Thanks KING!

At first I was getting an error where the code was not recognizing GetResults() function but after adding a few DevExpress Imports, it works!

 

https://discourse-static.influitive.net/uploads/db_8467a788_7b9e_45b8_8b6c_d37e1967220d/original/1X/acc6a78fb873bb348ba83ee117ccddde4fda7bfb.png
 

 

 

https://discourse-static.influitive.net/uploads/db_8467a788_7b9e_45b8_8b6c_d37e1967220d/original/1X/f9a491443b1d77936316376a21f21442f6ae9675.png