Skip to main content

Introduction

Introduction

A plug-in is a class that defines one or more computations to use in the Analyzer and in queries. A plug-in has the following features:

  • In any given context, the plug-in instance has access to the lowest-level data.

  • It can accept parameters.

  • It executes asynchronously. When the plug-in is used in a pivot table, the system can display the plug-in current status (as the string n% complete) in any pending cells.

    The pivot table automatically refreshes when the results are available.

  • Values returned by the plug-in are cached.

Plug-ins are especially appropriate for complex or time-consuming computations. For example, you might have a computation that uses several different parts of the source record, as well as external information; a plug-in would be suitable in this case.

How Plug-ins Can Be Used

Depending on the plug-in class, you can use it in some or all of the following ways:

  • With the MDX %KPI function (which also enables you to specify values for any parameters). This is possible in all cases.

    This means that in all cases, you can define a calculated member that uses the plug-in. (For information on defining calculated members, see Defining Calculated Members.)

  • Directly in the Analyzer and in widgets. This is possible if the PLUGINTYPE class parameter is "Pivot" and the PUBLIC class parameter is 1 (the default).

    To create a plug-in that cannot be directly used in the Analyzer or in widgets, specify PLUGINTYPE as "Aggregate". Or specify PUBLIC as 0.

Available Plug-in Classes

The %DeepSee.PlugIn package provides several plug-in classes for you to use in calculated measures. These classes are as follows:

  • %DeepSee.PlugIn.DistinctOpens in a new tab — Gets the count of distinct values for a given level in a given cell.

    %DeepSee.PlugIn.MedianOpens in a new tab — Gets the median value for a given measure, across all the lowest-level records used in a cell.

  • %DeepSee.PlugIn.PercentileOpens in a new tab — Gets a percentile value for a given measure, across all the lowest-level records used in a cell.

    These plug-in classes are defined with PLUGINTYPE as "Aggregate" and so cannot be directly used in the Analyzer or in widgets. For more details on them, see %KPI in the reference MDX Functions.

  • Other classes — More advanced plug-ins for use with Text Analytics. These are used by the Pivot Analysis screens in the Analyzer.

Another sample plug-in class is BI.Model.KPIs.PluginDemo. This plug-in class is defined with PLUGINTYPE as "Pivot" and thus can be used directly.

Samples That Demonstrate Plug-ins

Within the BI samples, see the dashboards in the KPIs & Plug-ins folder:

  • The dashboard HoleFoods Plug-ins uses the calculated measures Median Revenue and 90th Percentile Revenue, which are defined in the HoleFoods cube. These measures use the %KPI function to retrieve values from the sample plug-in classes %DeepSee.PlugIn.MedianOpens in a new tab and %DeepSee.PlugIn.PercentileOpens in a new tab.

  • The dashboard Patients Plug-ins has a pivot table that uses the calculated measures Median Test Score and 90th Percentile Test Score. These calculated members are defined in the Patients cube, in a similar manner to the ones in the previous bullet.

    This dashboard contains another pivot table, which directly uses the plug-in defined by the sample class BI.Model.KPIs.PluginDemo.

FeedbackOpens in a new tab