Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion full-ifrs17-template/Report/Reports.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"\n",
"\nThe granularity of the reported figures can be modified by changing the Column Slices options.",
"\nFor example one can add <code>\"GroupOfContract\"</code> to separate the contributions of the individual Group of Contracts.",
"\n<br> We suggest to add this slice between the <code>\"LiabilityType\"</code> and the <code>\"EconomicBasis\"</code> as the order of the inputs corresponds to the order of the columns shown in the report to expand the data.",
"\n",
"\nAggregated values are displayed when the data has a finer granularity than the one selected by the report slice options."
]
Expand All @@ -75,6 +74,7 @@
"var pvReport = ifrs17Report.PresentValues;",
"\npvReport.ReportingNode = \"CH\";",
"\npvReport.ReportingPeriod = (2021, 3);",
"\npvReport.CurrencyType = CurrencyType.Contractual;",
"\npvReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"",
"\npvReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.2\"),(\"LiabilityType\", \"LIC\") }",
"\n(await pvReport.ToReportAsync) with {Height = 720}"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"Report.ForDataCube( Test.GetScopes<FinancialPerformance>(identities).Aggregate().FinancialPerformance.Filter((\"GroupOfContract\", dataNode)) )",
"\n .WithQuerySource(DataSource)",
"\n .SliceRowsBy(\"VariableType\", \"EstimateType\")",
"\n .SliceColumnsBy(CurrencyGrouper(currencyType), \"LiabilityType\",\"GroupOfContract\")",
"\n .SliceColumnsBy(\"Currency\", \"LiabilityType\",\"GroupOfContract\")",
"\n .WithGridOptions( o => o.WithDefaultColumn( c => c.WithWidth(260) ) with {GroupDefaultExpanded = 3, Height = 900, OnGridReady = null} )",
"\n .ToReport()"
]
Expand Down
11 changes: 8 additions & 3 deletions ifrs17/DataModel/DataStructure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1529,17 +1529,21 @@
"\n [Dimension(typeof(Scenario))]",
"\n [IdentityProperty]",
"\n public string Scenario { get; init; }",
"\n",
"\n [NotVisible]",
"\n [Dimension(typeof(Currency))]",
"\n [IdentityProperty]",
"\n [AggregateBy]",
"\n public string Currency { get; init; }",
"\n ",
"\n [NotVisible]",
"\n [Dimension(typeof(Currency), nameof(FunctionalCurrency))]",
"\n [IdentityProperty]",
"\n //[AggregateBy]",
"\n public string FunctionalCurrency { get; init; }",
"\n ",
"\n [NotVisible]",
"\n [Dimension(typeof(Currency), nameof(ContractualCurrency))]",
"\n [IdentityProperty]",
"\n //[AggregateBy]",
"\n public string ContractualCurrency { get; init; }",
"\n ",
"\n [NotVisible]",
Expand Down Expand Up @@ -1628,7 +1632,7 @@
"\n [NotVisible]",
"\n [Dimension(typeof(EconomicBasis))]",
"\n [IdentityProperty]",
"\n //[AggregateBy]",
"\n [AggregateBy]",
"\n public string EconomicBasis { get; init; }",
"\n ",
"\n public double Value { get; init; }",
Expand All @@ -1637,6 +1641,7 @@
"\n public ReportVariable(ReportVariable rv){",
"\n ReportingNode = rv.ReportingNode;",
"\n Scenario = rv.Scenario;",
"\n Currency = rv.Currency;",
"\n FunctionalCurrency = rv.FunctionalCurrency;",
"\n ContractualCurrency = rv.ContractualCurrency;",
"\n GroupOfContract = rv.GroupOfContract;",
Expand Down
9 changes: 0 additions & 9 deletions ifrs17/Report/ReportConfigurationAndUtils.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,6 @@
"# Currency methods"
]
},
{
"cell_type": "code",
"source": [
"public static string CurrencyGrouper(CurrencyType currencyType) => currencyType switch {",
"\n CurrencyType.Contractual => \"ContractualCurrency\",",
"\n CurrencyType.Functional => \"FunctionalCurrency\",",
"\n _ => string.Empty };"
]
},
{
"cell_type": "code",
"source": [
Expand Down
30 changes: 15 additions & 15 deletions ifrs17/Report/ReportMutableScopes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@
"\n",
"\npublic interface PvReport : IIfrs17Report {",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] { \"Novelty\", \"VariableType\" };",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { CurrencyGrouper(CurrencyType), \"LiabilityType\", \"EconomicBasis\" };",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\", \"LiabilityType\", \"EconomicBasis\" };",
"\n IDataCube<ReportVariable> IIfrs17Report.GetDataCube() => DataFilter == null ",
"\n ? (GetScopes<LockedBestEstimate>(GetIdentities()).Aggregate().LockedBestEstimate + GetScopes<CurrentBestEstimate>(GetIdentities()).Aggregate().CurrentBestEstimate)",
"\n : (GetScopes<LockedBestEstimate>(GetIdentities()).Aggregate().LockedBestEstimate + GetScopes<CurrentBestEstimate>(GetIdentities()).Aggregate().CurrentBestEstimate).Filter(dataFilter);",
"\n}",
"\n",
"\npublic interface RaReport : IIfrs17Report {",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] { \"Novelty\", \"VariableType\" };",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { CurrencyGrouper(CurrencyType), \"LiabilityType\", \"EconomicBasis\" };",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\", \"LiabilityType\", \"EconomicBasis\" };",
"\n IDataCube<ReportVariable> IIfrs17Report.GetDataCube() => DataFilter == null ",
"\n ? GetScopes<LockedRiskAdjustment>(GetIdentities()).Aggregate().LockedRiskAdjustment + ",
"\n GetScopes<CurrentRiskAdjustment>(GetIdentities()).Aggregate().CurrentRiskAdjustment",
Expand All @@ -155,15 +155,15 @@
"\n",
"\npublic interface WrittenReport : IIfrs17Report {",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] {\"AmountType\"};",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { CurrencyGrouper(CurrencyType), \"LiabilityType\"};",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\", \"LiabilityType\"};",
"\n IDataCube<ReportVariable> IIfrs17Report.GetDataCube() => DataFilter == null ",
"\n ? GetScopes<WrittenAndAccruals>(GetIdentities()).Aggregate().Written",
"\n : GetScopes<WrittenAndAccruals>(GetIdentities()).Aggregate().Written.Filter(dataFilter);",
"\n}",
"\n",
"\npublic interface AccrualReport : IIfrs17Report {",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] {\"VariableType\"};",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { CurrencyGrouper(CurrencyType), \"EstimateType\"};",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\", \"EstimateType\"};",
"\n IDataCube<ReportVariable> IIfrs17Report.GetDataCube() => DataFilter == null ",
"\n ? GetScopes<WrittenAndAccruals>(GetIdentities()).Aggregate().Advance + ",
"\n GetScopes<WrittenAndAccruals>(GetIdentities()).Aggregate().Overdue",
Expand All @@ -173,37 +173,37 @@
"\n",
"\npublic interface DeferralReport : IIfrs17Report {",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] {\"VariableType\"};",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { CurrencyGrouper(CurrencyType), \"LiabilityType\" };",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\", \"LiabilityType\" };",
"\n IDataCube<ReportVariable> IIfrs17Report.GetDataCube() => DataFilter == null ",
"\n ? GetScopes<Deferrals>(GetIdentities()).Aggregate().Deferrals",
"\n : GetScopes<Deferrals>(GetIdentities()).Aggregate().Deferrals.Filter(dataFilter);",
"\n}",
"\n",
"\npublic interface FcfReport : IIfrs17Report {",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] { \"Novelty\",\"VariableType\" };",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { CurrencyGrouper(CurrencyType), \"LiabilityType\", \"EconomicBasis\" };",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] {\"Novelty\",\"VariableType\"};",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\", \"LiabilityType\", \"EconomicBasis\" };",
"\n IDataCube<ReportVariable> IIfrs17Report.GetDataCube() => DataFilter == null ",
"\n ? GetScopes<Fcf>(GetIdentities()).Aggregate().Fcf",
"\n : GetScopes<Fcf>(GetIdentities()).Aggregate().Fcf.Filter(dataFilter);",
"\n}",
"\n",
"\npublic interface ExpAdjReport : IIfrs17Report {",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] {\"EstimateType\"};",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { CurrencyGrouper(CurrencyType), \"AmountType\" };",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\", \"AmountType\" };",
"\n IDataCube<ReportVariable> IIfrs17Report.GetDataCube() => DataFilter == null ",
"\n ? GetScopes<ExperienceAdjustment>(GetIdentities()).Aggregate().ActuarialExperienceAdjustment",
"\n : GetScopes<ExperienceAdjustment>(GetIdentities()).Aggregate().ActuarialExperienceAdjustment.Filter(dataFilter);",
"\n}",
"\npublic interface TmReport : IIfrs17Report {",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] {\"Novelty\", \"VariableType\"};",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { CurrencyGrouper(CurrencyType) };",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\" };",
"\n IDataCube<ReportVariable> IIfrs17Report.GetDataCube() => DataFilter == null ",
"\n ? GetScopes<LrcTechnicalMargin>(GetIdentities()).Aggregate().LrcTechnicalMargin",
"\n : GetScopes<LrcTechnicalMargin>(GetIdentities()).Aggregate().LrcTechnicalMargin.Filter(dataFilter);",
"\n}",
"\npublic interface CsmReport : IIfrs17Report {",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] {\"Novelty\", \"VariableType\"};",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { CurrencyGrouper(CurrencyType), \"EstimateType\" };",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\", \"EstimateType\" };",
"\n IDataCube<ReportVariable> IIfrs17Report.GetDataCube() => DataFilter == null ",
"\n ? GetScopes<Csm>(GetIdentities()).Aggregate().Csm + ",
"\n GetScopes<Lc>(GetIdentities()).Aggregate().Lc + ",
Expand All @@ -214,35 +214,35 @@
"\n}",
"\npublic interface ActLrcReport : IIfrs17Report {",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] {\"Novelty\",\"VariableType\"};",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { CurrencyGrouper(CurrencyType), \"EstimateType\" };",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\", \"EstimateType\" };",
"\n IDataCube<ReportVariable> IIfrs17Report.GetDataCube() => DataFilter == null ",
"\n ? GetScopes<LrcActuarial>(GetIdentities()).Aggregate().LrcActuarial",
"\n : GetScopes<LrcActuarial>(GetIdentities()).Aggregate().LrcActuarial.Filter(dataFilter);",
"\n}",
"\npublic interface LrcReport : IIfrs17Report {",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] {\"VariableType\"};",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { CurrencyGrouper(CurrencyType), \"EstimateType\" };",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\", \"EstimateType\" };",
"\n IDataCube<ReportVariable> IIfrs17Report.GetDataCube() => DataFilter == null ",
"\n ? GetScopes<Lrc>(GetIdentities()).Aggregate().Lrc",
"\n : GetScopes<Lrc>(GetIdentities()).Aggregate().Lrc.Filter(dataFilter);",
"\n}",
"\npublic interface ActLicReport : IIfrs17Report {",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] {\"Novelty\",\"VariableType\"};",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { CurrencyGrouper(CurrencyType), \"EstimateType\" };",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\", \"EstimateType\" };",
"\n IDataCube<ReportVariable> IIfrs17Report.GetDataCube() => DataFilter == null ",
"\n ? GetScopes<LicActuarial>(GetIdentities()).Aggregate().LicActuarial",
"\n : GetScopes<LicActuarial>(GetIdentities()).Aggregate().LicActuarial.Filter(dataFilter);",
"\n}",
"\npublic interface LicReport : IIfrs17Report {",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] {\"VariableType\"};",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { CurrencyGrouper(CurrencyType), \"EstimateType\" };",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\", \"EstimateType\" };",
"\n IDataCube<ReportVariable> IIfrs17Report.GetDataCube() => DataFilter == null ",
"\n ? GetScopes<Lic>(GetIdentities()).Aggregate().Lic",
"\n : GetScopes<Lic>(GetIdentities()).Aggregate().Lic.Filter(dataFilter);",
"\n}",
"\npublic interface FpReport : IIfrs17Report {",
"\n string[] IIfrs17Report.defaultRowSlices => new string[] {\"VariableType\", \"EstimateType\"};",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { CurrencyGrouper(CurrencyType),\"LiabilityType\" };",
"\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\",\"LiabilityType\" };",
"\n int IIfrs17Report.headerColumnWidthValue => 500;",
"\n IDataCube<ReportVariable> IIfrs17Report.GetDataCube() => DataFilter == null ",
"\n ? GetScopes<FinancialPerformance>(GetIdentities()).Aggregate().FinancialPerformance",
Expand Down
5 changes: 4 additions & 1 deletion ifrs17/Report/ReportScopes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@
"\n Identity.ReportIdentity.FunctionalCurrency, ",
"\n GetStorage().GetFxPeriod(GetStorage().Args.Period, x.VariableType, x.Novelty),",
"\n (Identity.ReportIdentity.Year, Identity.ReportIdentity.Month),",
"\n Identity.CurrencyType)).Fx, x ));",
"\n Identity.CurrencyType)).Fx, x ) with { Currency = Identity.CurrencyType switch {",
"\n CurrencyType.Contractual => x.ContractualCurrency,",
"\n CurrencyType.Functional => x.FunctionalCurrency,",
"\n _ => GroupCurrency }});",
"\n ",
"\n private IDataCube<ReportVariable> Eops => Data.Filter((\"VariableType\", AocTypes.EOP));",
"\n private IDataCube<ReportVariable> NotEops => Data.Filter((\"VariableType\", \"!EOP\")); // TODO negation must be hardcoded (also to avoid string concatenation)",
Expand Down