Friday, August 3, 2007

Business Scorecard Manager development notes

It's a typical requirement to have a scorecard that needs regular updating to refer to a new current period. It's also typical that the database contains data for future periods which means Time Intelligence can't be used to get the scorecard to dynamically update itself. So what options does MOBSM give us for programmatic control?

For the scorecard, all the necessary objects are exposed as per the sample code which updates the current and previous members for all kpis in all scorecards.

IBpm pmServer = PmService.CreateInstance(BsmServerUrl); ScorecardCollection scorecards = pmServer.GetScorecards();
for (int i = 0; i <>
{
Scorecard scorecard = scorecards[i];
{
KpiCollection kpis = pmServer.GetKpisFromScorecard(scorecard.Guid);
for (int j = 0; j <>
{
Kpi kpi = kpis[j];
KpiMeasure kpiactual = kpi.Actual;
kpiactual.TimeIntelligenceCurrentMember = new Member(specify member here);
kpiactual.TimeIntelligencePreviousMember = new Member(specify member here);
pmServer.CreateKpi(kpi);
}
}

}


Unfortunately it's not quite so easy to update the periods displayed in chart report views. The Kpi.ReportView.CustomData attribute is an xml string that contains the report view definition, and lurking within this is more encapsulated xml containing the chart definitions. By the time you're finished you will know xml traversal like the back of your hand (and if you have the same attitude to xml as me, you will like the back of your hand a LOT better!).

Addendum:
I realised that I'd be a lot better off adding some calculated members and hierarchies to the time dimension and referring to these instead of updating the current and previous time intelligence members for the scorecard and traversing the chart's IncludedMembers.

The techniques described above are more appropriate for dynamic update based on user selection than as part of a period end process.

No comments: