01-10-2022 02:52 PM - last edited on 05-19-2023 10:37 AM by JackLacava
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?
01-10-2022 02:53 PM
Small correction: Total Net ROI / Total Revenue = 510,000 / 15,000,000 = 3.4% and not 3.14%
01-10-2022 02:53 PM
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
01-10-2022 02:54 PM
01-10-2022 02:55 PM
Glad it worked. I’m surprised I didn’t import those DevExpress ones. Maybe it is 6.5 and I’ve everything on one machine.
01-10-2022 02:56 PM
I still like using Studio rather than the embedded Report Designer within the Windows app.
In any case, thanks again for the code example. Wish someone gave a thorough course on advanced OneStream Studio development.