diff --git a/ifrs17-template/Files/DataNodes/DataNodeStates_CH_2020_12.csv b/ifrs17-template/Files/DataNodes/DataNodeStates_CH_2020_12.csv
index 8aad64e9..42e0398a 100644
--- a/ifrs17-template/Files/DataNodes/DataNodeStates_CH_2020_12.csv
+++ b/ifrs17-template/Files/DataNodes/DataNodeStates_CH_2020_12.csv
@@ -22,3 +22,4 @@ DTR1.3,Active,
DTR1.4,Active,
DTR2.1,Active,
DTR2.2,Active,
+DTP1.1,Active,
diff --git a/ifrs17-template/Files/DataNodes/DataNodes_CH.csv b/ifrs17-template/Files/DataNodes/DataNodes_CH.csv
index c694756e..6fae278b 100644
--- a/ifrs17-template/Files/DataNodes/DataNodes_CH.csv
+++ b/ifrs17-template/Files/DataNodes/DataNodes_CH.csv
@@ -24,6 +24,7 @@ DT2.2,DT2.2 NOCI LIC,DT2,2020,LIC,P,
DT3.1,DT3.1 Runoff - PA 0.8,DT3,2020,LRC,P,
DT4.1,DT4.1 CSM PA 0.8,DT4,2020,LRC,P,
DT5.1,DT5.1 Simple Import on DT 4.1,DT5,2020,LRC,P,
+DTP1.1,DTP1.1 Projection,DT1,2020,LRC,P,
,,,,,,
@@ReinsurancePortfolio,,,,,,
SystemName,DisplayName,ContractualCurrency,LineOfBusiness,ValuationApproach,OciType,
diff --git a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12_Projection.csv b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12_Projection.csv
new file mode 100644
index 00000000..11a03541
--- /dev/null
+++ b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12_Projection.csv
@@ -0,0 +1,13 @@
+@@Main,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+ReportingNode,Year,Month,Scenario,,,,,,,,,,,,,,,,,,,,,,,,,,
+CH,2020,12,,,,,,,,,,,,,,,,,,,,,,,,,,,
+@@Cashflow,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23
+DTP1.1,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0
+DTP1.1,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25
+DTP1.1,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3
+DTP1.1,,RA,BOP,N,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5
+DTP1.1,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0
+DTP1.1,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25
+DTP1.1,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3
+DTP1.1,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5
diff --git a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3_Projection.csv b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3_Projection.csv
new file mode 100644
index 00000000..84aaedd3
--- /dev/null
+++ b/ifrs17-template/Files/TransactionalData/Nomin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Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23,Values24,Values25,Values26,Values27,Values28,Values29,Values30,Values31,Values32,Values33,Values34,Values35,Values36,Values37,Values38,Values39,Values40,Values41,Values42,Values43,Values44,Values45,Values46,Values47,Values48,Values49,Values50,Values51,Values52,Values53,Values54,Values55,Values56,Values57,Values58,Values59,Values60,Values61,Values62,Values63,Values64,Values65,Values66,Values67,Values68,Values69,Values70,Values71,Values72,Values73,Values74,Values75,Values76,Values77,Values78,Values79,Values80,Values81,Values82,Values83,Values84,Values85,Values86,Values87,Values88,Values89,Values90,Values91,Values92,Values93,Values94,Values95,Values96,Values97,Values98,Values99,Values100,Values101,Values102,Values103,Values104,Values105,Values106,Values107,Values108,Values109,Values110,Values111,Values112,Values113,Values114,Values115,Values116,Values117,Values118,Values119,Values120,Values121,Values122,Values123,Values124,Values125,Values126,Values127,Values128,Values129,Values130,Values131,Values132,Values133,Values134,Values135,Values136,Values137,Values138,Values139,Values140,Values141,Values142,Values143,Values144,Values145,Values146,Values147,Values148,Values149,Values150,Values151,Values152,Values153,Values154,Values155,Values156,Values157,Values158,Values159,Values160,Values161,Values162,Values163,Values164,Values165,Values166,Values167,Values168,Values169,Values170,Values171,Values172,Values173,Values174,Values175,Values176,Values177,Values178,Values179,Values180,Values181,Values182,Values183,Values184,Values185,Values186,Values187,Values188,Values189,Values190,Values191,Values192,Values193,Values194,Values195,Values196,Values197,Values198,Values199,Values200,Values201,Values202,Values203,Values204,Values205,Values206,Values207,Values208,Values209,Values210,Values211,Values212,Values213,Values214,Values215,Values216,Values217,Values218,Values219,Values220,Values221,Values222,Values223,Values224,Values225,Values226,Values227
+DTP1.1,PR,BE,MC,I,,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0,0,110,0
+DTP1.1,NIC,BE,MC,I,,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,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,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0,0,115,0
+DTP1.1,ICO,BE,CL,C,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+DTP1.1,NIC,BE,CL,C,,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29
+DTP1.1,,CU,CL,C,,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5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.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5
diff --git a/ifrs17-template/Import/InteractWithImportScopes/EvaluateImportScopes.ipynb b/ifrs17-template/Import/InteractWithImportScopes/EvaluateImportScopes.ipynb
index 9c1022ef..557bf115 100644
--- a/ifrs17-template/Import/InteractWithImportScopes/EvaluateImportScopes.ipynb
+++ b/ifrs17-template/Import/InteractWithImportScopes/EvaluateImportScopes.ipynb
@@ -22,7 +22,7 @@
"
Interact With Import Scope Calculation
",
"\n",
"\n
",
- "\nAfter successfully loading the parsed data in the dataSource, the import scopes with for a specific partition can be re-evaluated in this notebook. ",
+ "\nAfter successfully loading the parsed data in the dataSource, the import scopes for a specific partition can be re-evaluated in this notebook. ",
"\nThe import scopes can then be displayed, examined and used for further calculations."
],
"metadata": {},
@@ -47,25 +47,6 @@
"execution_count": 0,
"outputs": []
},
- {
- "cell_type": "code",
- "source": [
- "var mystring = $\"#!eval-notebook \\\"//{projectName}/{environmentName}/{notebookName}\\\"\";",
- "\nmystring"
- ],
- "metadata": {},
- "execution_count": 0,
- "outputs": []
- },
- {
- "cell_type": "code",
- "source": [
- "#!eval mystring"
- ],
- "metadata": {},
- "execution_count": 0,
- "outputs": []
- },
{
"cell_type": "code",
"source": [
diff --git a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2021_3__BE_Projection_DTP.csv b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2021_3__BE_Projection_DTP.csv
new file mode 100644
index 00000000..d779d489
--- /dev/null
+++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2021_3__BE_Projection_DTP.csv
@@ -0,0 +1,68 @@
+@@Main
+Month,ReportingNode,Scenario,Year
+3,CH,,2021
+@@BE
+AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value,Value1,Value10,Value11,Value12,Value2,Value3,Value4,Value5,Value6,Value7,Value8,Value9
+,ICO,EOP,DTP1.1,C,BE,C,214.75519,212.02188750718875,0,0,0,209.2851720673257,206.54504212869566,195.55029210385797,0,0,0,0,0
+,ICO,BOP,DTP1.1,C,BE,N,217.48509,217.48509190465353,0,0,0,217.48509190465353,217.48509190465353,206.54504212869566,0,0,0,0,0
+,ICO,CF,DTP1.1,C,BE,N,-3,-6,0,0,0,-9,-12,-12,0,0,0,0,0
+,ICO,IA,DTP1.1,C,BE,N,0.2701,0.536795602535152,0,0,0,0.8000801626720645,1.0599502240420131,1.005249975162221,0,0,0,0,0
+,NIC,EOP,DTP1.1,C,BE,C,6227.90059,6148.634737708471,0,0,0,6069.269989952443,5989.806221732173,5670.958471011882,0,0,0,0,0
+,NIC,BOP,DTP1.1,C,BE,I,299.67555,299.67554969423594,0,0,0,299.67554969423594,299.67554969423594,5989.806221732173,0,0,0,0,0
+,NIC,CF,DTP1.1,C,BE,I,-60,-120,0,0,0,-180,-240,-240,0,0,0,0,0
+,NIC,IA,DTP1.1,C,BE,I,2.22541,4.421958800332403,0,0,0,6.589625297997124,8.728397290768823,20.104999503244414,0,0,0,0,0
+,NIC,MC,DTP1.1,C,BE,I,4174.48341,4174.4834131388725,0,0,0,4174.4834131388725,4174.4834131388725,-1858.905379158262,0,0,0,0,0
+,NIC,YCU,DTP1.1,C,BE,I,-121.28052,-118.1431714896662,0,0,0,-115.04514678459145,-111.98651754996263,0,0,0,0,0,0
+,NIC,BOP,DTP1.1,C,BE,N,869.94037,869.9403676186141,0,0,0,869.9403676186141,869.9403676186141,826.1801685147826,0,0,0,0,0
+,NIC,CF,DTP1.1,C,BE,N,-12,-24,0,0,0,-36,-48,-48,0,0,0,0,0
+,NIC,EV,DTP1.1,C,BE,N,1073.77596,1060.1094375359446,0,0,0,1046.4258603366293,1032.725210643479,977.7514605192906,0,0,0,0,0
+,NIC,IA,DTP1.1,C,BE,N,1.0804,2.147182410140608,0,0,0,3.200320650688258,4.2398008961680524,4.020999900648884,0,0,0,0,0
+,PR,EOP,DTP1.1,C,BE,C,-8235.70419,-8130.883944345274,0,0,0,-8025.932913619873,-7920.8509393700615,-7499.210336599693,0,0,0,0,0
+,PR,BOP,DTP1.1,C,BE,I,-399.63393,-399.63392949885525,0,0,0,-399.63392949885525,-399.63392949885525,-7920.8509393700615,0,0,0,0,0
+,PR,CF,DTP1.1,C,BE,I,110,220,0,0,0,330,440,440,0,0,0,0,0
+,PR,IA,DTP1.1,C,BE,I,-4.06229,-8.071643244317976,0,0,0,-12.028044656909643,-15.931463990226685,-36.69159735007779,0,0,0,0,0
+,PR,MC,DTP1.1,C,BE,I,-7804.35661,-7804.356612431655,0,0,0,-7804.356612431655,-7804.356612431655,344.38482345086777,0,0,0,0,0
+,PR,YCU,DTP1.1,C,BE,I,220.42273,214.69493406195306,0,0,0,209.0392779075355,203.45589000153996,0,0,0,0,0,0
+,PR,BOP,DTP1.1,C,BE,N,-725.25164,-725.2516371911986,0,0,0,-725.2516371911986,-725.2516371911986,-688.7696469017443,0,0,0,0,0
+,PR,CF,DTP1.1,C,BE,N,10,20,0,0,0,30,40,40,0,0,0,0,0
+,PR,EV,DTP1.1,C,BE,N,358.0741,353.5166932324031,0,0,0,348.95360493999436,344.38482345087215,326.0526233304213,0,0,0,0,0
+,PR,IA,DTP1.1,C,BE,N,-0.89655,-1.7817492736072882,0,0,0,-2.6555726887897606,-3.5180097105452597,-3.335599759097978,0,0,0,0,0
+,ICO,EOP,DTP1.1,L,BE,C,220.81922,217.92904608167225,0,0,0,215.03742940655545,212.14436800619401,200.55766071046145,0,0,0,0,0
+,ICO,BOP,DTP1.1,L,BE,N,223.70795,223.70794814165566,0,0,0,223.70794814165566,223.70794814165566,212.14436800619401,0,0,0,0,0
+,ICO,CF,DTP1.1,L,BE,N,-3,-6,0,0,0,-9,-12,-12,0,0,0,0,0
+,ICO,IA,DTP1.1,L,BE,N,0.11127,0.22109794001662042,0,0,0,0.3294812648998566,0.4364198645384417,0.41329270426751263,0,0,0,0,0
+,NIC,EOP,DTP1.1,L,BE,C,6403.75734,6319.942336368489,0,0,0,6236.085452790103,6152.186672179621,5816.172160603377,0,0,0,0,0
+,NIC,BOP,DTP1.1,L,BE,I,299.67555,299.67554969423594,0,0,0,299.67554969423594,299.67554969423594,6152.186672179621,0,0,0,0,0
+,NIC,CF,DTP1.1,L,BE,I,-60,-120,0,0,0,-180,-240,-240,0,0,0,0,0
+,NIC,IA,DTP1.1,L,BE,I,2.22541,4.421958800332403,0,0,0,6.589625297997124,8.728397290768823,8.265854085350242,0,0,0,0,0
+,NIC,MC,DTP1.1,L,BE,I,4174.48341,4174.4834131388725,0,0,0,4174.4834131388725,4174.4834131388725,-1909.2993120557476,0,0,0,0,0
+,NIC,BOP,DTP1.1,L,BE,N,894.83179,894.8317925666227,0,0,0,894.8317925666227,894.8317925666227,848.5774720247761,0,0,0,0,0
+,NIC,CF,DTP1.1,L,BE,N,-12,-24,0,0,0,-36,-48,-48,0,0,0,0,0
+,NIC,EV,DTP1.1,L,BE,N,1104.09609,1089.645230408359,0,0,0,1075.187147032775,1060.721840030968,1002.7883035523055,0,0,0,0,0
+,NIC,IA,DTP1.1,L,BE,N,0.44508,0.8843917600664817,0,0,0,1.3179250595994263,1.745679458153767,1.6531708170700505,0,0,0,0,0
+,PR,EOP,DTP1.1,L,BE,C,-8466.14614,-8355.337739046408,0,0,0,-8244.473976886846,-8133.554824371677,-7689.323757058888,0,0,0,0,0
+,PR,BOP,DTP1.1,L,BE,I,-399.63393,-399.63392949885525,0,0,0,-399.63392949885525,-399.63392949885525,-8133.554824371677,0,0,0,0,0
+,PR,CF,DTP1.1,L,BE,I,110,220,0,0,0,330,440,440,0,0,0,0,0
+,PR,IA,DTP1.1,L,BE,I,-4.06229,-8.071643244317976,0,0,0,-12.028044656909643,-15.931463990226685,-15.083326918206922,0,0,0,0,0
+,PR,MC,DTP1.1,L,BE,I,-7804.35661,-7804.356612431655,0,0,0,-7804.356612431655,-7804.356612431655,353.632818450943,0,0,0,0,0
+,PR,BOP,DTP1.1,L,BE,N,-745.81732,-745.8173219936826,0,0,0,-745.8173219936826,-745.8173219936826,-707.2656369018847,0,0,0,0,0
+,PR,CF,DTP1.1,L,BE,N,10,20,0,0,0,30,40,40,0,0,0,0,0
+,PR,EV,DTP1.1,L,BE,N,368.09331,363.27555387158293,0,0,0,358.45539029942796,353.63281845094235,334.3184242199516,0,0,0,0,0
+,PR,IA,DTP1.1,L,BE,N,-0.3693,-0.7337857494834521,0,0,0,-1.0934586051736035,-1.4483149082024256,-1.3712115380188103,0,0,0,0,0
+,ICO,EOP,DTP1.1,N,BE,C,225,222,0,0,0,219,216,204,0,0,0,0,0
+,ICO,BOP,DTP1.1,N,BE,N,228,228,0,0,0,228,228,216,0,0,0,0,0
+,ICO,CF,DTP1.1,N,BE,N,-3,-6,0,0,0,-9,-12,-12,0,0,0,0,0
+,NIC,EOP,DTP1.1,N,BE,C,6525,6438,0,0,0,6351,6264,5916,0,0,0,0,0
+,NIC,BOP,DTP1.1,N,BE,I,300,300,0,0,0,300,300,6264,0,0,0,0,0
+,NIC,CF,DTP1.1,N,BE,I,-60,-120,0,0,0,-180,-240,-240,0,0,0,0,0
+,NIC,MC,DTP1.1,N,BE,I,4260,4260,0,0,0,4260,4260,-1944,0,0,0,0,0
+,NIC,BOP,DTP1.1,N,BE,N,912,912,0,0,0,912,912,864,0,0,0,0,0
+,NIC,CF,DTP1.1,N,BE,N,-12,-24,0,0,0,-36,-48,-48,0,0,0,0,0
+,NIC,EV,DTP1.1,N,BE,N,1125,1110,0,0,0,1095,1080,1020,0,0,0,0,0
+,PR,EOP,DTP1.1,N,BE,C,-8625,-8510,0,0,0,-8395,-8280,-7820,0,0,0,0,0
+,PR,BOP,DTP1.1,N,BE,I,-400,-400,0,0,0,-400,-400,-8280,0,0,0,0,0
+,PR,CF,DTP1.1,N,BE,I,110,220,0,0,0,330,440,440,0,0,0,0,0
+,PR,MC,DTP1.1,N,BE,I,-7960,-7960,0,0,0,-7960,-7960,360,0,0,0,0,0
+,PR,BOP,DTP1.1,N,BE,N,-760,-760,0,0,0,-760,-760,-720,0,0,0,0,0
+,PR,CF,DTP1.1,N,BE,N,10,20,0,0,0,30,40,40,0,0,0,0,0
+,PR,EV,DTP1.1,N,BE,N,375,370,0,0,0,365,360,340,0,0,0,0,0
\ No newline at end of file
diff --git a/ifrs17-template/Test/IfrsVariablesTest.ipynb b/ifrs17-template/Test/IfrsVariablesTest.ipynb
index 4b8513ef..ebc28828 100644
--- a/ifrs17-template/Test/IfrsVariablesTest.ipynb
+++ b/ifrs17-template/Test/IfrsVariablesTest.ipynb
@@ -64,59 +64,26 @@
{
"cell_type": "code",
"source": [
- "var bmFiles = new BenchmarkMetadata[]{",
- "\n // 2020 Q4",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__A.csv\" , \"CH\", 2020, 12),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__AA.csv\" , \"CH\", 2020, 12),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__APA.csv\" , \"CH\", 2020, 12),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__BE.csv\" , \"CH\", 2020, 12),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__BEPA.csv\", \"CH\", 2020, 12),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__C.csv\" , \"CH\", 2020, 12),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__DA.csv\" , \"CH\", 2020, 12),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__F.csv\" , \"CH\", 2020, 12),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__OA.csv\" , \"CH\", 2020, 12),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__RA.csv\" , \"CH\", 2020, 12),",
- "\n // 2021 Q1",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__A.csv\" , \"CH\", 2021, 3),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__AA.csv\" , \"CH\", 2021, 3),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__APA.csv\" , \"CH\", 2021, 3),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__BE.csv\" , \"CH\", 2021, 3),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__BEPA.csv\" , \"CH\", 2021, 3),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__C.csv\" , \"CH\", 2021, 3),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__DA.csv\" , \"CH\", 2021, 3),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__F.csv\" , \"CH\", 2021, 3),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__L.csv\" , \"CH\", 2021, 3),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__LR.csv\" , \"CH\", 2021, 3),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__OA.csv\" , \"CH\", 2021, 3),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__RA.csv\" , \"CH\", 2021, 3),",
- "\n // 2020 Q4",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_BE.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_BEPA.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_A.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_APA.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_DA.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_C.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_F.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
- "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_RA.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
- "\n};"
+ "var excludedDataNodes = new string[]{};",
+ "\nvar includedDataNodes = new string[]{};"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
- "cell_type": "code",
+ "cell_type": "markdown",
"source": [
- "var excludedDataNodes = new string[]{};"
+ "# Functions"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
- "cell_type": "markdown",
+ "cell_type": "code",
"source": [
- "# Functions"
+ "public bool IsCorrectValue(double value) => Math.Abs(value) <= BenchmarkPrecision;"
],
"metadata": {},
"execution_count": 0,
@@ -134,43 +101,76 @@
{
"cell_type": "code",
"source": [
- "public IfrsVariable CreateVariable(IDataRow row, Guid partition)",
+ "public double ParseIfrsVariableValue(IDataRow row, string nameOfIfrsVariableValue)",
"\n{",
- "\n if (!double.TryParse(row[nameof(IfrsVariable.Value)]?.ToString(), AllowedNumberStyles, CultureInfo.InvariantCulture, out var doubleValue))",
- "\n throw new Exception(\"Value cannot be parsed.\");",
- "\n ",
- "\n return new IfrsVariable(){AocType = row.Field(nameof(IfrsVariable.AocType)),",
- "\n Partition = partition,",
- "\n Novelty = row.Field(nameof(IfrsVariable.Novelty)),",
- "\n DataNode = row.Field(nameof(IfrsVariable.DataNode)),",
- "\n EstimateType = row.Field(nameof(IfrsVariable.EstimateType)),",
- "\n AmountType = row.Field(nameof(IfrsVariable.AmountType)),",
- "\n AccidentYear = Int32.TryParse((row.Field(nameof(IfrsVariable.AccidentYear))), out var accidentYear) ? accidentYear : (int?)null,",
- "\n EconomicBasis = row.Field(nameof(IfrsVariable.EconomicBasis)),",
- "\n Value = (-1.0) * doubleValue };",
+ "\n return (row.Table.Columns.Contains(nameOfIfrsVariableValue)",
+ "\n ? (double.TryParse(row[nameOfIfrsVariableValue]?.ToString(), AllowedNumberStyles, CultureInfo.InvariantCulture, out var value) ",
+ "\n ? value ",
+ "\n : throw new Exception(nameOfIfrsVariableValue + \" cannot be parsed.\"))",
+ "\n : default(double));",
"\n}"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
+ {
+ "cell_type": "code",
+ "source": [
+ "public IfrsVariable CreateVariable(IDataRow row, Guid partition)",
+ "\n => new IfrsVariable(){AocType = row.Field(nameof(IfrsVariable.AocType)),",
+ "\n Partition = partition,",
+ "\n Novelty = row.Field(nameof(IfrsVariable.Novelty)),",
+ "\n DataNode = row.Field(nameof(IfrsVariable.DataNode)),",
+ "\n EstimateType = row.Field(nameof(IfrsVariable.EstimateType)),",
+ "\n AmountType = row.Field(nameof(IfrsVariable.AmountType)),",
+ "\n AccidentYear = Int32.TryParse((row.Field(nameof(IfrsVariable.AccidentYear))), out var accidentYear) ? accidentYear : (int?)null,",
+ "\n EconomicBasis = row.Field(nameof(IfrsVariable.EconomicBasis)),",
+ "\n Value = ParseIfrsVariableValue(row, nameof(IfrsVariable.Value)), ",
+ "\n Value1 = ParseIfrsVariableValue(row, nameof(IfrsVariable.Value1)), ",
+ "\n Value2 =ParseIfrsVariableValue(row, nameof(IfrsVariable.Value2)),",
+ "\n Value3 = ParseIfrsVariableValue(row, nameof(IfrsVariable.Value3)), ",
+ "\n Value4 = ParseIfrsVariableValue(row, nameof(IfrsVariable.Value4)), ",
+ "\n Value5 = ParseIfrsVariableValue(row, nameof(IfrsVariable.Value5)), ",
+ "\n Value6 = ParseIfrsVariableValue(row, nameof(IfrsVariable.Value6)), ",
+ "\n Value7 = ParseIfrsVariableValue(row, nameof(IfrsVariable.Value7)), ",
+ "\n Value8 = ParseIfrsVariableValue(row, nameof(IfrsVariable.Value8)),",
+ "\n Value9 = ParseIfrsVariableValue(row, nameof(IfrsVariable.Value9)), ",
+ "\n Value10 = ParseIfrsVariableValue(row, nameof(IfrsVariable.Value10)), ",
+ "\n Value11 = ParseIfrsVariableValue(row, nameof(IfrsVariable.Value11)), ",
+ "\n Value12 = ParseIfrsVariableValue(row, nameof(IfrsVariable.Value12))};"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "static double[] GetValues(this IfrsVariable iv) => Enumerable.Range(0, 12).Select(x => (double)iv.GetType().GetProperty( x == 0 ? \"Value\" : \"Value\" + x.ToString()).GetValue(iv, null)).ToArray();"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
{
"cell_type": "code",
"source": [
"public class BenchmarkTestResult",
"\n{",
"\n public string ErrorMessage {get; set;}",
- "\n public double ExpectedValue {get; set;}",
- "\n public double ComputedValue {get; set;}",
+ "\n public double[] ExpectedValue {get; set;}",
+ "\n public double[] ComputedValue {get; set;}",
+ "\n",
"\n public BenchmarkTestResult (string message)",
"\n {",
"\n ErrorMessage = message;",
"\n }",
- "\n public BenchmarkTestResult (string message, double expValue, double compValue)",
- "\n {",
+ "\n",
+ "\n public BenchmarkTestResult(string message, double[] expValue, double[] compValue){",
"\n ErrorMessage = message;",
"\n ExpectedValue = expValue;",
- "\n ComputedValue = compValue; ",
+ "\n ComputedValue = compValue;",
"\n }",
"\n}"
],
@@ -181,24 +181,36 @@
{
"cell_type": "code",
"source": [
- "public List CompareAgainstBm(List errors, IEnumerable expected, IEnumerable computed)",
- "\n{",
- "\n var expectedNotComputed = expected.Where(x => Math.Abs(x.Value) > BenchmarkPrecision).Except(computed, EqualityComparer.Instance);",
- "\n var computedNotExpected = computed.Where(x => Math.Abs(x.Value) > BenchmarkPrecision).Except(expected, EqualityComparer.Instance);",
- "\n if (expectedNotComputed.Any())",
- "\n foreach (var variable in expectedNotComputed)",
- "\n errors.Add(new BenchmarkTestResult(\"Extra expected variable for: Partition \" + variable.Partition + \", \" + variable.ToIdentityString()));",
- "\n if (computedNotExpected.Any())",
- "\n foreach (var variable in computedNotExpected)",
- "\n errors.Add(new BenchmarkTestResult(\"Extra computed variable for: Partition \" + variable.Partition + \", \" + variable.ToIdentityString()));",
- "\n",
- "\n var comparer = EqualityComparer.Instance; ",
- "\n foreach (var benchmarkVariable in expected) {",
- "\n var computedVariable = computed.FirstOrDefault(y => comparer.Equals(benchmarkVariable,y))?? null;",
- "\n if(computedVariable == null || Math.Abs(benchmarkVariable.Value + computedVariable.Value) < BenchmarkPrecision) continue;",
- "\n errors.Add(new BenchmarkTestResult(\"Value does not match for Variable: Partition \" + benchmarkVariable.Partition + \", \" + benchmarkVariable.ToIdentityString(), -benchmarkVariable.Value, computedVariable.Value));",
+ "var includingProperties = typeof(IfrsVariable).GetIdentityProperties().Select(x=>x.Name).ToArray();"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "public List CompareAgainstBm(List errors, IEnumerable expected, IEnumerable computed){",
+ "\n var comparer = IfrsVariableComparer.Instance(true); ",
+ "\n var comparerIfrs = IfrsVariableComparer.Instance(false, BenchmarkPrecision);",
+ "\n var expectedNotComputed = expected.Where(x => Math.Abs(x.Value) > BenchmarkPrecision).Except(computed, comparer);",
+ "\n var computedNotExpected = computed.Where(x => Math.Abs(x.Value) > BenchmarkPrecision).Except(expected, comparer);",
+ "\n if (expectedNotComputed.Any()){",
+ "\n foreach(var element in expectedNotComputed){",
+ "\n errors.Add(new BenchmarkTestResult(\"Extra expected variable for: Partition \" + element.Partition + \", \" + element.ToIdentityString()));",
+ "\n }",
+ "\n }",
+ "\n if (computedNotExpected.Any()){",
+ "\n foreach(var element in computedNotExpected){",
+ "\n errors.Add(new BenchmarkTestResult(\"Extra expected variable for: Partition \" + element.Partition + \", \" + element.ToIdentityString()));",
+ "\n }",
+ "\n }",
+ "\n foreach(var benchmarkVariable in expected){",
+ "\n var computedVariable = computed.FirstOrDefault(x => comparer.Equals(benchmarkVariable, x)) ?? null;",
+ "\n if (computedVariable == null) continue;",
+ "\n if (!comparerIfrs.Equals(benchmarkVariable, computedVariable)) errors.Add(new BenchmarkTestResult(\"Values do not match. Partition \" + benchmarkVariable.Partition + \", \" + benchmarkVariable.ToIdentityString(), ",
+ "\n benchmarkVariable.GetValues(), computedVariable.GetValues())); ",
"\n }",
- "\n",
"\n return errors;",
"\n}"
],
@@ -236,53 +248,145 @@
{
"cell_type": "code",
"source": [
- "var errorList = new List();",
- "\nforeach (var g in bmFiles.GroupBy(x => (ReportingNode: x.ReportingNode, Year: x.Year, Month: x.Month, Scenario : x.Scenario)))",
+ "public async Task> CheckIfrsVariablesValuesAsync(BenchmarkMetadata[] bmFiles, string[] excludedDataNodes, string[] includedDataNodes)",
"\n{",
- "\n var reportingNode = g.Key.ReportingNode;",
- "\n var year = g.Key.Year;",
- "\n var month = g.Key.Month;",
- "\n var scenario = g.Key.Scenario;",
+ "\n var errorList = new List();",
+ "\n foreach (var g in bmFiles.GroupBy(x => (ReportingNode: x.ReportingNode, Year: x.Year, Month: x.Month, Scenario : x.Scenario)))",
+ "\n {",
+ "\n var reportingNode = g.Key.ReportingNode;",
+ "\n var year = g.Key.Year;",
+ "\n var month = g.Key.Month;",
+ "\n var scenario = g.Key.Scenario;",
"\n ",
- "\n await DataSource.Partition.SetAsync(new {ReportingNode = reportingNode, Year = year, Month = month, Scenario = scenario});",
- "\n var partition = (await DataSource.Query().ToArrayAsync())",
- "\n .SingleOrDefault(x => x.ReportingNode == reportingNode && x.Year== year && x.Month == month && x.Scenario == scenario)?.Id ?? ",
- "\n throw new Exception(\"Partition not found.\");",
+ "\n await DataSource.Partition.SetAsync(new {ReportingNode = reportingNode, Year = year, Month = month, Scenario = scenario});",
+ "\n var partition = (await DataSource.Query().ToArrayAsync())",
+ "\n .SingleOrDefault(x => x.ReportingNode == reportingNode && x.Year == year && x.Month == month && x.Scenario == scenario)?.Id ?? ",
+ "\n throw new Exception(\"Partition not found.\");",
"\n ",
- "\n var computedVariablesByEstimateType = (await DataSource.Query()",
- "\n .Where(v => !excludedDataNodes.Contains(v.DataNode))",
+ "\n var computedVariablesByEstimateType = (await DataSource.Query()",
+ "\n .Where(v => excludedDataNodes != null ",
+ "\n ? !excludedDataNodes.Contains(v.DataNode) ",
+ "\n : true)",
+ "\n .Where(v => includedDataNodes != null ",
+ "\n ? includedDataNodes.Contains(v.DataNode) ",
+ "\n : true)",
"\n .ToArrayAsync())",
"\n .ToDictionaryGrouped(x => x.EstimateType, x => x.ToArray());",
"\n",
- "\n foreach (var bmfile in g)",
- "\n {",
- "\n var extension = System.IO.Path.GetExtension(bmfile.FileName);",
- "\n var stream = await Project.FileStorage.ReadAsync(bmfile.FileName);",
- "\n //Read Bm csv",
- "\n var bmDataTable = (await DataSetReader.ReadFromStream(stream).WithContentType(extension).ExecuteAsync()).DataSet;",
+ "\n foreach (var bmfile in g)",
+ "\n {",
+ "\n var extension = System.IO.Path.GetExtension(bmfile.FileName);",
+ "\n var stream = await Project.FileStorage.ReadAsync(bmfile.FileName);",
+ "\n //Read Bm csv",
+ "\n var bmDataTable = (await DataSetReader.ReadFromStream(stream).WithContentType(extension).ExecuteAsync()).DataSet;",
"\n",
- "\n var mainTab = bmDataTable.Tables[Main].Rows.First();",
- "\n if(!ValidateMainTab(mainTab, reportingNode, year, month))",
- "\n throw new Exception(\"Metadata and main tab of the Benchmark are different.\");",
+ "\n var mainTab = bmDataTable.Tables[Main].Rows.First();",
+ "\n if(!ValidateMainTab(mainTab, reportingNode, year, month))",
+ "\n throw new Exception(\"Metadata and main tab of the Benchmark are different.\");",
"\n",
- "\n var bmTableName = bmDataTable.Tables.Single(x => x.TableName != Main).TableName;",
- "\n var bmVariables = bmDataTable.Tables[bmTableName].Rows.Select(x => CreateVariable(x, partition));",
+ "\n var bmTableName = bmDataTable.Tables.Single(x => x.TableName != Main).TableName;",
+ "\n var bmVariables = bmDataTable.Tables[bmTableName].Rows.Select(x => CreateVariable(x, partition));",
"\n",
- "\n //Get the computed Data",
- "\n var computedVariables = computedVariablesByEstimateType.TryGetValue(bmTableName, out var ret) ? ret : Enumerable.Empty();",
+ "\n //Get the computed Data",
+ "\n var computedVariables = computedVariablesByEstimateType.TryGetValue(bmTableName, out var ret) ? ret : Enumerable.Empty();",
"\n",
- "\n if(!computedVariables.Any() && bmVariables.Any())",
- "\n errorList.Add(new BenchmarkTestResult(\"No variables are computed for EstimateType: \" + bmTableName, 0, 0));",
- "\n //CompareAgainstBm",
- "\n if (bmVariables.Any() && computedVariables.Any()) //TODO we are adding duplicates here",
- "\n errorList = errorList.Concat(CompareAgainstBm(errorList, bmVariables, computedVariables)).Distinct().ToList();",
+ "\n //CompareAgainstBm",
+ "\n if(!computedVariables.Any() && bmVariables.Any())",
+ "\n errorList.Add(new BenchmarkTestResult(\"No variables are computed for EstimateType: \" + bmTableName));",
+ "\n if(computedVariables.Any() && !bmVariables.Any())",
+ "\n errorList.Add(new BenchmarkTestResult(\"Empty benchmark provided for EstimateType: \" + bmTableName));",
+ "\n if(computedVariables.Any() && bmVariables.Any())",
+ "\n errorList = errorList.Concat(CompareAgainstBm(errorList, bmVariables, computedVariables)).Distinct().ToList();",
+ "\n }",
"\n }",
+ "\n return errorList;",
"\n}"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
+ {
+ "cell_type": "markdown",
+ "source": [
+ "## Projection 0 Test"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### BenchMark"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "var bmFiles = new BenchmarkMetadata[]{",
+ "\n //2020 Q4",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__A.csv\" , \"CH\", 2020, 12),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__AA.csv\" , \"CH\", 2020, 12),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__APA.csv\" , \"CH\", 2020, 12),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__BE.csv\" , \"CH\", 2020, 12),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__BEPA.csv\", \"CH\", 2020, 12),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__C.csv\" , \"CH\", 2020, 12),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__DA.csv\" , \"CH\", 2020, 12),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__F.csv\" , \"CH\", 2020, 12),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__OA.csv\" , \"CH\", 2020, 12),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12__RA.csv\" , \"CH\", 2020, 12),",
+ "\n // 2021 Q1",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__A.csv\" , \"CH\", 2021, 3),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__AA.csv\" , \"CH\", 2021, 3),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__APA.csv\" , \"CH\", 2021, 3),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__BE.csv\" , \"CH\", 2021, 3),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__BEPA.csv\" , \"CH\", 2021, 3),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__C.csv\" , \"CH\", 2021, 3),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__DA.csv\" , \"CH\", 2021, 3),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__F.csv\" , \"CH\", 2021, 3),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__L.csv\" , \"CH\", 2021, 3),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__LR.csv\" , \"CH\", 2021, 3),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__OA.csv\" , \"CH\", 2021, 3),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__RA.csv\" , \"CH\", 2021, 3),",
+ "\n // 2020 Q4",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_BE.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_BEPA.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_A.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_APA.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_DA.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_C.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_F.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_RA.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),",
+ "\n};"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### Test"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "excludedDataNodes = new string[]{\"DTP1.1\"};",
+ "\nincludedDataNodes = null;",
+ "\nvar errorList = await CheckIfrsVariablesValuesAsync(bmFiles, excludedDataNodes, includedDataNodes);"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
{
"cell_type": "code",
"source": [
@@ -291,6 +395,111 @@
"metadata": {},
"execution_count": 0,
"outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "## Projections Test"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### BenchMark"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "var bmFilesTestProjection = new BenchmarkMetadata[]{",
+ "\n // 2021 Q1",
+ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2021_3__BE_Projection_DTP.csv\" , \"CH\", 2021, 3)",
+ "\n};"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### Test"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "ProjectionCount = 5;",
+ "\nawait Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_Projection.csv\")",
+ "\n .WithFormat(ImportFormats.Cashflow)",
+ "\n .WithTarget(DataSource)",
+ "\n .WithActivityLog()",
+ "\n .ExecuteAsync();",
+ "\nawait Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3_Projection.csv\")",
+ "\n .WithFormat(ImportFormats.Cashflow)",
+ "\n .WithTarget(DataSource)",
+ "\n .WithActivityLog()",
+ "\n .ExecuteAsync();"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "excludedDataNodes = null;",
+ "\nincludedDataNodes = new string[]{\"DTP1.1\"};",
+ "\nvar projectionErrorList = await CheckIfrsVariablesValuesAsync(bmFilesTestProjection, excludedDataNodes, includedDataNodes);"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "projectionErrorList.Count().Should().Be(0);"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### Reset"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "ProjectionCount = 1;"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ ""
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
}
]
}
\ No newline at end of file
diff --git a/ifrs17/Constants/Consts.ipynb b/ifrs17/Constants/Consts.ipynb
index a2f4f66e..4beeab84 100644
--- a/ifrs17/Constants/Consts.ipynb
+++ b/ifrs17/Constants/Consts.ipynb
@@ -133,6 +133,15 @@
"execution_count": 0,
"outputs": []
},
+ {
+ "cell_type": "code",
+ "source": [
+ "public static int ProjectionCount = 1;"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
{
"cell_type": "markdown",
"source": [
@@ -430,10 +439,10 @@
"cell_type": "code",
"source": [
"public static class ParameterReportType{",
- "\n public const string DataNodeReport = nameof(DataNodeReport);",
- "\n public const string DataNodeStateReport = nameof(DataNodeStateReport);",
+ "\n public const string DataNode = nameof(DataNode);",
+ "\n public const string DataNodeState = nameof(DataNodeState);",
"\n public const string YieldCurves = nameof(YieldCurves);",
- "\n public const string SingleDataNodeReport = nameof(SingleDataNodeReport);",
+ "\n public const string SingleDataNodeParameters = nameof(SingleDataNodeParameters);",
"\n public const string InterDataNodeParameters = nameof(InterDataNodeParameters);",
"\n public const string PartnerRating = nameof(PartnerRating);",
"\n public const string PartnerDefaultRates = nameof(PartnerDefaultRates);",
diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb
index cf707188..a81bfbf3 100644
--- a/ifrs17/DataModel/DataStructure.ipynb
+++ b/ifrs17/DataModel/DataStructure.ipynb
@@ -1788,6 +1788,18 @@
"public record IfrsVariable : BaseDataRecord",
"\n{",
"\n public double Value { get; init; }",
+ "\n public double Value1 { get; init; }",
+ "\n public double Value2 { get; init; }",
+ "\n public double Value3 { get; init; }",
+ "\n public double Value4 { get; init; }",
+ "\n public double Value5 { get; init; }",
+ "\n public double Value6 { get; init; }",
+ "\n public double Value7 { get; init; }",
+ "\n public double Value8 { get; init; }",
+ "\n public double Value9 { get; init; }",
+ "\n public double Value10 { get; init; }",
+ "\n public double Value11 { get; init; }",
+ "\n public double Value12 { get; init; }",
"\n ",
"\n [NotVisible] ",
"\n [Dimension(typeof(EstimateType))]",
diff --git a/ifrs17/Import/1ImportScope-Identities.ipynb b/ifrs17/Import/1ImportScope-Identities.ipynb
index 65703f90..74ca3428 100644
--- a/ifrs17/Import/1ImportScope-Identities.ipynb
+++ b/ifrs17/Import/1ImportScope-Identities.ipynb
@@ -370,7 +370,7 @@
"\n AocTypes.RCU or AocTypes.CF or AocTypes.IA or AocTypes.YCU or AocTypes.CRU => OrderedParsedAocSteps.GetReferenceAocStepForCalculated(GetStorage().AocConfigurationByAocStep, identityAocStep),",
"\n AocTypes.EA => new AocStep(AocTypes.CF, Identity.Novelty),",
"\n AocTypes.AM or AocTypes.EOP => new AocStep(AocTypes.CL, Novelties.C),",
- "\n AocTypes.BOP => new AocStep(default, default), //BOP, C has DataType == Calculated. See ReferenceAocStep condition.",
+ "\n AocTypes.BOP => GetStorage().GetShift(Identity.ProjectionPeriod) >= MonthInAYear && Identity.Novelty == Novelties.I ? new AocStep(AocTypes.CL, Novelties.C) : new AocStep(default, default), //BOP, C has DataType == Calculated. See ReferenceAocStep condition.",
"\n _ => (AocStep)ApplicationMessage.Log(Error.NotSupportedAocStepReference, Identity.AocType),",
"\n };",
"\n }",
@@ -390,7 +390,7 @@
"cell_type": "markdown",
"source": [
"## Previous AoC Steps",
- "\nThe **PreviousAocSteps** scope computes and provides an other important piece of information for each [Identity](../DataModel/DataStructure#import-identity), i.e. for a certain [AoC Type](../DataModel/DataStructure#aoc-type) and [Novelty](../DataModel/DataStructure#novelty).",
+ "\nThe **PreviousAocSteps** scope computes and provides another important piece of information for each [Identity](../DataModel/DataStructure#import-identity), i.e. for a certain [AoC Type](../DataModel/DataStructure#aoc-type) and [Novelty](../DataModel/DataStructure#novelty).",
"\n",
"\nIt provides the list of all previous AoC Steps up to the **BOP** step, whereby a Combined novelty will branch into the InForce and New Business AoC Types.",
"\n",
diff --git a/ifrs17/Import/2ImportScope-PresentValue.ipynb b/ifrs17/Import/2ImportScope-PresentValue.ipynb
index e80eb964..bc2db357 100644
--- a/ifrs17/Import/2ImportScope-PresentValue.ipynb
+++ b/ifrs17/Import/2ImportScope-PresentValue.ipynb
@@ -156,7 +156,8 @@
"\n{",
"\n static ApplicabilityBuilder ScopeApplicabilityBuilder(ApplicabilityBuilder builder) =>",
"\n builder.ForScope(s => s.WithApplicability(x => x.Identity.AmountType == AmountTypes.CDR && x.Identity.Id.AocType == AocTypes.CF)",
- "\n .WithApplicability(x => x.Identity.AmountType == AmountTypes.CDR));",
+ "\n .WithApplicability(x => x.Identity.AmountType == AmountTypes.CDR)",
+ "\n .WithApplicability(x => x.GetStorage().GetShift(x.Identity.Id.ProjectionPeriod) >= MonthInAYear && x.Identity.Id.AocType == AocTypes.BOP && x.Identity.Id.Novelty == Novelties.I));",
"\n",
"\n AocStep referenceAocStep => GetScope(Identity.Id).Value;",
"\n double[] Values => GetStorage().GetValues(Identity.Id with {AocType = referenceAocStep.AocType, Novelty = referenceAocStep.Novelty}, Identity.AmountType, Identity.EstimateType, Identity.AccidentYear);",
@@ -184,6 +185,12 @@
"\n double[] NominalCashflow.Values => GetStorage().GetClaims()",
"\n .Select(claim => GetStorage().GetValues(Identity.Id with {AocType = referenceAocStep.AocType, Novelty = referenceAocStep.Novelty}, claim, Identity.EstimateType, Identity.AccidentYear))",
"\n .AggregateDoubleArray();",
+ "\n}",
+ "\n",
+ "\npublic interface ProjectionBopNominalCashflow : NominalCashflow",
+ "\n{ ",
+ "\n ImportIdentity subImportIdentity => Identity.Id with {AocType = AocTypes.CL, Novelty = Novelties.C};",
+ "\n double[] NominalCashflow.Values => GetStorage().GetValues(subImportIdentity, Identity.AmountType, Identity.EstimateType, Identity.AccidentYear);",
"\n}"
],
"metadata": {},
@@ -371,8 +378,8 @@
"source": [
"public interface IWithGetValueFromValues : IScope<(ImportIdentity Id, string AmountType, string EstimateType, int? AccidentYear), ImportStorage>",
"\n{",
- "\n private int shift => GetStorage().GetShift(0);//Identity.Id.ProjectionPeriod",
- "\n private int timeStep => GetStorage().GetTimeStep(0);//Identity.Id.ProjectionPeriod",
+ "\n private int shift => GetStorage().GetShift(Identity.Id.ProjectionPeriod);",
+ "\n private int timeStep => GetStorage().GetTimeStep(Identity.Id.ProjectionPeriod);",
"\n ",
"\n public double GetValueFromValues(double[] Values)",
"\n {",
@@ -877,8 +884,8 @@
"\n s.WithApplicability(x => x.GetStorage().ImportFormat != ImportFormats.Cashflow",
"\n || x.GetStorage().IsSecondaryScope(x.Identity.DataNode)));",
"\n",
- "\n private int shift => GetStorage().GetShift(0);//Identity.ProjectionPeriod",
- "\n private int timeStep => GetStorage().GetTimeStep(0);//Identity.ProjectionPeriod",
+ "\n private int shift => GetStorage().GetShift(Identity.ProjectionPeriod);",
+ "\n private int timeStep => GetStorage().GetTimeStep(Identity.ProjectionPeriod);",
"\n private double amortizedFactor => GetScope(Identity)",
"\n .MonthlyAmortizationFactors",
"\n .Skip(shift)",
diff --git a/ifrs17/Import/4ImportScope-TechnicalMargin.ipynb b/ifrs17/Import/4ImportScope-TechnicalMargin.ipynb
index 5edb792a..1b9b6d2f 100644
--- a/ifrs17/Import/4ImportScope-TechnicalMargin.ipynb
+++ b/ifrs17/Import/4ImportScope-TechnicalMargin.ipynb
@@ -263,8 +263,8 @@
"\n",
"\npublic interface TechnicalMarginForIA : TechnicalMargin",
"\n{",
- "\n private int timeStep => GetStorage().GetTimeStep(0);//Identity.Id.ProjectionPeriod",
- "\n private int shift => GetStorage().GetShift(0);//Identity.Id.ProjectionPeriod",
+ "\n private int timeStep => GetStorage().GetTimeStep(Identity.ProjectionPeriod);",
+ "\n private int shift => GetStorage().GetShift(Identity.ProjectionPeriod);",
"\n ",
"\n private double[] monthlyInterestFactor => GetScope(Identity, o => o.WithContext(EconomicBasis)).Interest;",
"\n ",
diff --git a/ifrs17/Import/6ImportScope-Compute.ipynb b/ifrs17/Import/6ImportScope-Compute.ipynb
index 0cd0f796..b13b0ffa 100644
--- a/ifrs17/Import/6ImportScope-Compute.ipynb
+++ b/ifrs17/Import/6ImportScope-Compute.ipynb
@@ -111,6 +111,32 @@
"execution_count": 0,
"outputs": []
},
+ {
+ "cell_type": "markdown",
+ "source": [
+ "# Chashflows with Projections"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "public interface ComputeIfrsVarsCashflowsWithProjection : IScope{",
+ "\n IEnumerable CalculatedIfrsVariables => Enumerable.Range(0,ProjectionCount)",
+ "\n .Select(x => GetScope(Identity with { ProjectionPeriod = x} )",
+ "\n .CalculatedIfrsVariables",
+ "\n .Select(y => AdjustProjection(y, x)))",
+ "\n .SelectMany(l => l)",
+ "\n .AggregateOver()",
+ "\n .Select(x => x with {Partition = GetStorage().TargetPartition});",
+ "\n}"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
{
"cell_type": "markdown",
"source": [
@@ -149,7 +175,7 @@
"\n{",
"\n IEnumerable CalculatedIfrsVariables => GetStorage().ImportFormat switch {",
"\n ImportFormats.Actual => GetScope(Identity).CalculatedIfrsVariables,",
- "\n ImportFormats.Cashflow => GetScope(Identity).CalculatedIfrsVariables,",
+ "\n ImportFormats.Cashflow => GetScope(Identity).CalculatedIfrsVariables,",
"\n ImportFormats.Opening => GetScope(Identity).CalculatedIfrsVariables,",
"\n };",
"\n}"
diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb
index 69084a9e..58885725 100644
--- a/ifrs17/Import/ImportStorage.ipynb
+++ b/ifrs17/Import/ImportStorage.ipynb
@@ -202,7 +202,7 @@
"\n ? interDataNodeParamByPeriod[CurrentPeriod].Select(param => param.DataNode == goc ? param.LinkedDataNode : param.DataNode).Where(goc => !primaryScopeFromParsedVariables.Contains(goc))",
"\n : Enumerable.Empty())",
"\n .ToHashSet();",
- "\n ",
+ "\n",
"\n var primaryScope = primaryScopeFromParsedVariables.Concat(primaryScopeFromLinkedReinsurance).ToHashSet();",
"\n var secondaryScope = InterDataNodeParametersByGoc",
"\n .Where(kvp => primaryScope.Contains(kvp.Key))",
@@ -315,8 +315,10 @@
"\n }",
"\n ",
"\n public YieldCurve GetYieldCurve(ImportIdentity id, string economicBasis) => (economicBasis, GetYieldCurvePeriod(id)) switch {",
- "\n (EconomicBases.C, PeriodType.BeginningOfPeriod) => CurrentYieldCurve[id.DataNode][PreviousPeriod],",
- "\n (EconomicBases.C, PeriodType.EndOfPeriod) => CurrentYieldCurve[id.DataNode][CurrentPeriod],",
+ "\n (EconomicBases.C, PeriodType.BeginningOfPeriod ) => GetShift(id.ProjectionPeriod) > 0 ",
+ "\n ? CurrentYieldCurve[id.DataNode][CurrentPeriod]",
+ "\n : CurrentYieldCurve[id.DataNode][PreviousPeriod],",
+ "\n (EconomicBases.C, PeriodType.EndOfPeriod) => CurrentYieldCurve[id.DataNode][CurrentPeriod], ",
"\n (EconomicBases.L, _ ) => LockedInYieldCurve[id.DataNode],",
"\n (_, PeriodType.NotApplicable) => (YieldCurve)ApplicationMessage.Log(Error.YieldCurvePeriodNotApplicable, id.AocType, id.Novelty),",
"\n (_, _) => (YieldCurve)ApplicationMessage.Log(Error.EconomicBasisNotFound, id.DataNode)",
@@ -340,8 +342,8 @@
"\n ",
"\n public double[] GetValues(ImportIdentity id, Func whereClause) => GetRawVariables(id.DataNode).Where(v => (v.AocType, v.Novelty) == id.AocStep && whereClause(v)).Aggregate()?.Values ?? Enumerable.Empty().ToArray();",
"\n public double GetValue(ImportIdentity id, Func whereClause) => GetIfrsVariables(id.DataNode).Where(v => (v.AocType, v.Novelty) == id.AocStep && whereClause(v)).Aggregate()?.Value ?? 0;",
- "\n ",
"\n public double[] GetValues(ImportIdentity id, string amountType, string estimateType, int? accidentYear) => GetValues(id, v => v.AccidentYear == accidentYear && v.AmountType == amountType && v.EstimateType == estimateType);",
+ "\n",
"\n public double GetValue(ImportIdentity id, string amountType, string estimateType, int? accidentYear) => GetValue(id, v => v.AccidentYear == accidentYear && v.AmountType == amountType && v.EstimateType == estimateType);",
"\n public double GetValue(ImportIdentity id, string amountType, string estimateType, string economicBasis, int? accidentYear) => GetValue(id, v => v.AccidentYear == accidentYear && v.AmountType == amountType && v.EstimateType == estimateType && v.EconomicBasis == economicBasis);",
"\n ",
diff --git a/ifrs17/Report/ParameterReportMutableScopeInteractive.ipynb b/ifrs17/Report/ParameterReportMutableScopeInteractive.ipynb
index 199703ff..199e3776 100644
--- a/ifrs17/Report/ParameterReportMutableScopeInteractive.ipynb
+++ b/ifrs17/Report/ParameterReportMutableScopeInteractive.ipynb
@@ -177,10 +177,10 @@
"\n",
"\n async Task ToReport() => ReportType switch",
"\n {",
- "\n ParameterReportType.DataNodeReport => await GetDataNodeReport(), ",
- "\n ParameterReportType.DataNodeStateReport => await GetDataNodeStatesReport(), ",
+ "\n ParameterReportType.DataNode => await GetDataNodeReport(), ",
+ "\n ParameterReportType.DataNodeState => await GetDataNodeStatesReport(), ",
"\n ParameterReportType.YieldCurves => await GetYieldCurvesReport(), ",
- "\n ParameterReportType.SingleDataNodeReport => await GetSingleDataNodeReport(), ",
+ "\n ParameterReportType.SingleDataNodeParameters => await GetSingleDataNodeReport(), ",
"\n ParameterReportType.InterDataNodeParameters => await GetInterDataNodeParametersReport(), ",
"\n ParameterReportType.PartnerRating => await GetPartnerRatingReport(), ",
"\n ParameterReportType.PartnerDefaultRates => await GetDefaultRatesReport(),",
diff --git a/ifrs17/Report/ParameterReportsQueries.ipynb b/ifrs17/Report/ParameterReportsQueries.ipynb
index 7e401112..13a2b8cb 100644
--- a/ifrs17/Report/ParameterReportsQueries.ipynb
+++ b/ifrs17/Report/ParameterReportsQueries.ipynb
@@ -130,7 +130,14 @@
"cell_type": "code",
"source": [
"public record SingleDataNodeReportParameter : ReportParameter {",
+ "\n",
"\n public double PremiumAllocation { get; init; }",
+ "\n",
+ "\n [Dimension(typeof(CashFlowPeriodicity))]",
+ "\n public CashFlowPeriodicity CashFlowPeriodicity { get; init; }",
+ "\n ",
+ "\n [Dimension(typeof(InterpolationMethod))]",
+ "\n public InterpolationMethod InterpolationMethod { get; init; } ",
"\n}"
],
"metadata": {},
@@ -303,7 +310,10 @@
"\n Year = y.Value.Year,",
"\n Month = y.Value.Month,",
"\n Scenario = y.Value.Scenario,",
- "\n PremiumAllocation = y.Value.PremiumAllocation}",
+ "\n PremiumAllocation = y.Value.PremiumAllocation,",
+ "\n CashFlowPeriodicity = y.Value.CashFlowPeriodicity,",
+ "\n InterpolationMethod = y.Value.InterpolationMethod",
+ "\n }",
"\n ))",
"\n .ToArray();"
],
diff --git a/ifrs17/Test/AocStructureTest.ipynb b/ifrs17/Test/AocStructureTest.ipynb
index c3fbbd6b..59236fb0 100644
--- a/ifrs17/Test/AocStructureTest.ipynb
+++ b/ifrs17/Test/AocStructureTest.ipynb
@@ -28,8 +28,16 @@
{
"cell_type": "code",
"source": [
- "#!import \"../Import/Importers\"",
- "\n#!import \"TestData\""
+ "#!import \"../Import/Importers\""
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "#!import \"TestData\""
],
"metadata": {},
"execution_count": 0,
diff --git a/ifrs17/Test/EqualityComparerTest.ipynb b/ifrs17/Test/EqualityComparerTest.ipynb
index 0c567485..1faccfb1 100644
--- a/ifrs17/Test/EqualityComparerTest.ipynb
+++ b/ifrs17/Test/EqualityComparerTest.ipynb
@@ -139,6 +139,88 @@
"execution_count": 0,
"outputs": []
},
+ {
+ "cell_type": "markdown",
+ "source": [
+ "# Ifrs Variable"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "var ifrsComparer = IfrsVariableComparer.Instance();"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "var iv1 = new IfrsVariable() {",
+ "\n AmountType = \"CL\", ",
+ "\n AccidentYear = 2021, ",
+ "\n Novelty = \"N\", ",
+ "\n DataNode = \"GR1\", ",
+ "\n AocType = \"EOP\",",
+ "\n EstimateType = \"PL\",",
+ "\n Value = 67.5, ",
+ "\n Value1 = 57.0, ",
+ "\n Value2 = 33.44, ",
+ "\n Value3 = 30.12, ",
+ "\n Value4 = 12.1, ",
+ "\n Value5 = 0.0d",
+ "\n};",
+ "\n",
+ "\nvar iv2 = new IfrsVariable() {",
+ "\n AmountType = \"CL\", ",
+ "\n AccidentYear = 2021, ",
+ "\n Novelty = \"N\", ",
+ "\n DataNode = \"GR1\", ",
+ "\n AocType = \"EOP\",",
+ "\n EstimateType = \"PL\",",
+ "\n Value = 67.5, ",
+ "\n Value1 = 57.0, ",
+ "\n Value2 = 33.44, ",
+ "\n Value3 = 30.12, ",
+ "\n Value4 = 12.1, ",
+ "\n Value5 = 5.03",
+ "\n};"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "ifrsComparer.Equals(iv1, iv1).Should().BeTrue()"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "ifrsComparer.Equals(iv1, iv2).Should().BeFalse()"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "ifrsComparer.Equals(iv1, iv1 with {Value7 = 0.1}).Should().BeFalse()"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
+ },
{
"cell_type": "code",
"source": [
diff --git a/ifrs17/Utils/EqualityComparers.ipynb b/ifrs17/Utils/EqualityComparers.ipynb
index 95c8b455..7323fce0 100644
--- a/ifrs17/Utils/EqualityComparers.ipynb
+++ b/ifrs17/Utils/EqualityComparers.ipynb
@@ -88,21 +88,35 @@
{
"cell_type": "code",
"source": [
- "class IfrsVariableComparer: IEqualityComparer",
+ "using System.Reflection;",
+ "\nclass IfrsVariableComparer: IEqualityComparer",
"\n{",
"\n private bool IgnoreValue;",
- "\n private IfrsVariableComparer(bool ignoreValue)",
+ "\n private double precision;",
+ "\n private IfrsVariableComparer(bool ignoreValue, double precision)",
"\n {",
"\n IgnoreValue = ignoreValue;",
+ "\n this.precision = precision;",
+ "\n }",
+ "\n",
+ "\n // At this point it is cumbersome and invokes reflections. Will be simplified when we switch to the arrays - A.K.",
+ "\n private bool CompareValues(IfrsVariable x, IfrsVariable y){",
+ "\n var values = Enumerable.Range(0, 12).Select(x => x == 0 ? \"Value\" : \"Value\" + x.ToString());",
+ "\n foreach (var v in values){",
+ "\n var val1 = (double)x.GetType().GetProperty(v).GetValue(x, null);",
+ "\n var val2 = (double)y.GetType().GetProperty(v).GetValue(y, null);",
+ "\n if (Math.Abs(val1 - val2) > precision) return false;",
+ "\n }",
+ "\n return true;",
"\n }",
"\n",
"\n public bool Equals(IfrsVariable x, IfrsVariable y) =>",
"\n x.AccidentYear == y.AccidentYear && x.AmountType == y.AmountType && x.DataNode == y.DataNode && x.AocType == y.AocType && ",
- "\n x.Novelty == y.Novelty && x.EstimateType == y.EstimateType && x.EconomicBasis == y.EconomicBasis && (IgnoreValue ? true : Math.Abs(x.Value - y.Value) < Precision); ",
+ "\n x.Novelty == y.Novelty && x.EstimateType == y.EstimateType && x.EconomicBasis == y.EconomicBasis && (IgnoreValue ? true : CompareValues(x, y)); ",
"\n",
"\n public int GetHashCode(IfrsVariable v) => 0;",
"\n",
- "\n public static IfrsVariableComparer Instance(bool ignoreValue = false) => new IfrsVariableComparer(ignoreValue);",
+ "\n public static IfrsVariableComparer Instance(bool ignoreValue = false, double precision = Precision) => new IfrsVariableComparer(ignoreValue, precision);",
"\n}"
],
"metadata": {},
diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb
index 968763ce..41e1ae34 100644
--- a/ifrs17/Utils/ImportCalculationMethods.ipynb
+++ b/ifrs17/Utils/ImportCalculationMethods.ipynb
@@ -363,6 +363,38 @@
"metadata": {},
"execution_count": 0,
"outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "public static IfrsVariable AdjustProjection(IfrsVariable iv, int projectionPeriod)",
+ "\n => new IfrsVariable{ ",
+ "\n DataNode = iv.DataNode,",
+ "\n AocType = iv.AocType,",
+ "\n Novelty = iv.Novelty,",
+ "\n Partition = iv.Partition,",
+ "\n Value = projectionPeriod == 0 ? iv.Value : 0.0d,",
+ "\n Value1 = projectionPeriod == 1 ? iv.Value : 0.0d,",
+ "\n Value2 = projectionPeriod == 2 ? iv.Value : 0.0d,",
+ "\n Value3 = projectionPeriod == 3 ? iv.Value : 0.0d,",
+ "\n Value4 = projectionPeriod == 4 ? iv.Value : 0.0d,",
+ "\n Value5 = projectionPeriod == 5 ? iv.Value : 0.0d,",
+ "\n Value6 = projectionPeriod == 6 ? iv.Value : 0.0d,",
+ "\n Value7 = projectionPeriod == 7 ? iv.Value : 0.0d,",
+ "\n Value8 = projectionPeriod == 8 ? iv.Value : 0.0d,",
+ "\n Value9 = projectionPeriod == 9 ? iv.Value : 0.0d,",
+ "\n Value10 = projectionPeriod == 10 ? iv.Value : 0.0d,",
+ "\n Value11 = projectionPeriod == 11 ? iv.Value : 0.0d,",
+ "\n Value12 = projectionPeriod == 12 ? iv.Value : 0.0d,",
+ "\n EstimateType = iv.EstimateType, ",
+ "\n AccidentYear = iv.AccidentYear,",
+ "\n AmountType = iv.AmountType,",
+ "\n EconomicBasis = iv.EconomicBasis",
+ "\n };"
+ ],
+ "metadata": {},
+ "execution_count": 0,
+ "outputs": []
}
]
}
\ No newline at end of file