Type | Read/write | Author | Availability |
|---|---|---|---|
Read | FINBOURNE | Provided with LUSID |
The Lusid.ComplianceRuleResult.Breakdown provider enables you to write a Luminesce query that retrieves the underlying contributions to a rule’s result in a compliance run. For example, it can show you the lineage, properties, and numerator and denominator values used in the compliance run; learn more about compliance rules in LUSID.
Note
The LUSID user running the query must have sufficient access control permissions to both use the provider and read compliance data. This should automatically be the case if you are the domain owner.
See also: Lusid.RunCompliance, Lusid.ComplianceRuleResult, Lusid.ComplianceRule
Basic usage
@@RunScope = select '<run-scope>';
@@RunCode = select '<run-code>';
@breakdown = use Lusid.ComplianceRuleResult.Breakdown with @@RunScope, @@RunCode
--runScope={@@RunScope}
--runCode={@@RunCode}
enduse;
select * from @breakdown;Input tables
Lusid.ComplianceRuleResult.Breakdown takes in scalar variables and outputs a table of data; see example 1.
Options
Lusid.ComplianceRuleResult.Breakdown has options that enable you to refine a query.
An option takes the form --<option>=<value>, for example --runScope=PMS. Note that no spaces are allowed either side of the = operator.
Current options at article update time are listed in the table below. For the very latest information, run the following query using a suitable tool and examine the online help:
@x = use Lusid.ComplianceRuleResult.Breakdown
--help
enduse;
select * from @x;Current options | Explanation |
|---|---|
| The scope of the compliance run. [String] |
| The code of the compliance run. [String] |
| The asAt datetime of the query. [DateTime, Default: latest] |
| The maximum number of |
| The maximum number of lineage stages to expand. Each stage generates one column named after that stage's |
Examples
Example 1: Retrieve the breakdown for a specific compliance run
In this example, we retrieve the breakdown for the result in this Lusid.ComplianceRuleResult example.
@@RunScope = select 'PMS';
@@RunCode = select 'bbbcfccd-d773-4a30-b478-d5bb9e34363e';
@breakdown = use Lusid.ComplianceRuleResult.Breakdown with @@RunScope, @@RunCode
--runScope={@@RunScope}
--runCode={@@RunCode}
enduse;
select * from @breakdown;Lusid.ComplianceRuleResult.Breakdown returns one row per breakdown group. Part of the table of data returned is as follows, containing multiple rows for the same rule and portfolio:

The following columns identify the run and rule a row belongs to:
ComplianceRunScopeComplianceRunCodeComplianceRuleScopeComplianceRuleCode
The remaining columns are dynamic and depend on the compliance template and variation involved in the run.
Note
The
Initialcolumn refers to the first lineage stage in the compliance rule sequence, which has itsLabelset toInitial. You can see this, for example, at the end of How do I perform a pre-trade compliance run and view the results?
Example 2: Kick off a compliance run and retrieve its results breakdown
In this example, we use the ComplianceRunCode returned by Lusid.RunCompliance to immediately retrieve the breakdown for the run.
@@ComplianceRunScope = select 'PMS';
@@ComplianceRunCode = select ComplianceRunCode
from Lusid.RunCompliance
where IncludeEntityTypes = 'OrdersAndAllocations'
and Recipe = 'Finbourne-Examples/Recipe'
and RuleScope = 'PMS'
and RunScope = @@ComplianceRunScope
limit 1;
@breakdown = use Lusid.ComplianceRuleResult.Breakdown with @@ComplianceRunScope, @@ComplianceRunCode
--runScope={@@ComplianceRunScope}
--runCode={@@ComplianceRunCode}
enduse;
select * from @breakdown;Example 3: Retrieve additional lineage and property details
By default, the Lusid.ComplianceRuleResult.Breakdown table of results only includes the first 6 lineage stages and 6 ResultsUsed/PropertiesUsed keys. In this example, we specify the maxLineageDepth and maxDynamicColumns options to see more:
@@RunScope = select 'PMS';
@@RunCode = select 'bbbcfccd-d773-4a30-b478-d5bb9e34363e';
@breakdown = use Lusid.ComplianceRuleResult.Breakdown with @@RunScope, @@RunCode
--runScope={@@RunScope}
--runCode={@@RunCode}
--maxLineageDepth=10
--maxDynamicColumns=10
enduse;
select * from @breakdown;