Systemorph / IFRS17CalculationEngine

Systemorph IFRS 17 Calculation Engine
MIT License
28 stars 5 forks source link

Dealing with CSM and LC during Union between Scenario And BE #135

Closed calderinisystemorph closed 1 year ago

calderinisystemorph commented 1 year ago

Let assume to have the following situation:

      Scenario        |      Best Estimate

BOP C | C MC C | L
R L | L EOP C | C

Now, the Union will take both MC (C and L) and save them to Scenario Partition. This topic is related also to the way Reporting works.

dcolleoni commented 1 year ago

@amuolo @calderinisystemorph is this still relevant after the functionality that stores 0s when a diff wrt best estimate is recognized?

calderinisystemorph commented 1 year ago

The following lines of code, implemented in the method ComputeAsync, notebook ifrs17/Import/Importers.ipynb deals with the mentioned issue.

if(storage.DefaultPartition != storage.TargetPartition) { var bestEstimateIvs = await workspaceToCompute.LoadPartitionedDataAsync<IfrsVariable,PartitionByReportingNodeAndPeriod>(storage.DefaultPartition); ivs = ivs.Where(iv => Math.Abs(iv.Value) >= Precision).ToArray() .Except(bestEstimateIvs, IfrsVariableComparer.Instance(ignoreValue: false)) .Concat(ivs.Where(x => Math.Abs(x.Value) < Precision).Intersect(bestEstimateIvs, EqualityComparer.Instance).Select(x => x with {Value = 0.0}).ToArray()); }