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
8 changes: 4 additions & 4 deletions ifrs17-template/Files/DataNodes/DataNodes_CH.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DT5,DT5 Simple Import,USD,ANN,BBA,Default,
DT10,DT10 PPA,USD,ANN,PAA,Default,
,,,,,,
@@GroupOfInsuranceContract,,,,,,
SystemName,DisplayName,InsurancePortfolio,AnnualCohort,LiabilityType,Profitability,
SystemName,DisplayName,InsurancePortfolio,AnnualCohort,LiabilityType,Profitability,YieldCurveName
GicComplex,Gic test discounting,DT,2020,LRC,P,
DT1.1,DT1.1 OCI LRC PA 0.8,DT1,2020,LRC,P,
DT1.2,DT1.2 OCI LIC,DT1,2020,LIC,P,
Expand All @@ -25,9 +25,9 @@ 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,
DT10.1,DT10.1 PAA,DT10,2020,LIC,P
DT10.2,DT10.1 PAA,DT10,2020,LRC,P
DTP1.1,DTP1.1 Projection,DT1,2020,LRC,P,NoDiscount
DT10.1,DT10.1 PAA,DT10,2020,LIC,P,
DT10.2,DT10.1 PAA,DT10,2020,LRC,P,
,,,,,,
@@ReinsurancePortfolio,,,,,,
SystemName,DisplayName,ContractualCurrency,LineOfBusiness,ValuationApproach,OciType,
Expand Down
14 changes: 7 additions & 7 deletions ifrs17-template/Files/Parameters/YieldCurve_2020_1.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@@Main
Year,Month
2020,1
@@YieldCurve
Currency,Values0,Values1,Values2,Values3
USD,0.002,0.002,0.002,0.002

@@Main,,,,,
Year,Month,,,,
2020,1,,,,
@@YieldCurve,,,,,
Currency,Name,Values0,Values1,Values2,Values3
USD,,0.002,0.002,0.002,0.002
USD,NoDiscount,0,,,
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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,10
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,P,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,P,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
DTP1.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,100,0,0,100,0,0,100,0
DTP1.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25
DTP1.1,CU,P,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3
DTP1.1,,RA,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5

Large diffs are not rendered by default.

116 changes: 78 additions & 38 deletions ifrs17-template/Test/Data/ExportIfrsVariable.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,35 @@
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"## Extra Imports"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"source": [
"ProjectionCount = 5;",
"\nvar activity1 = await Import.FromFile(\"../../Files/TransactionalData/NominalCashflows_CH_2020_12_Projection.csv\")",
"\n .WithFormat(ImportFormats.Cashflow)",
"\n .WithTarget(DataSource)",
"\n .WithActivityLog()",
"\n .ExecuteAsync();",
"\nvar activity2 = await Import.FromFile(\"../../Files/TransactionalData/NominalCashflows_CH_2021_3_Projection.csv\")",
"\n .WithFormat(ImportFormats.Cashflow)",
"\n .WithTarget(DataSource)",
"\n .WithActivityLog()",
"\n .ExecuteAsync();",
"\nProjectionCount = 1;"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
Expand Down Expand Up @@ -123,7 +152,7 @@
{
"cell_type": "code",
"source": [
"var args = exportScope[2];",
"var args = new ImportArgs (\"CH\", 2021, 3, (Periodicity)default, null, null);",
"\nargs"
],
"metadata": {},
Expand All @@ -135,8 +164,9 @@
"source": [
"await DataSource.Partition.SetAsync<PartitionByReportingNodeAndPeriod>(new {ReportingNode = args.ReportingNode, Year = args.Year, Month = args.Month, Scenario = args.Scenario});",
"\nvar ifrsVariables = (await DataSource.Query<IfrsVariable>().ToArrayAsync())",
"\n .Where(x => x.DataNode == \"DTP1.1\") //Extra Filter",
"\n .Select(v => v with {Values = v.Values.Select(x => Math.Round(x, roundingDigits)).ToArray()})",
"\n .OrderBy(v => v.DataNode).ThenBy(v => v.AccidentYear).ThenBy(v => v.EstimateType).ThenBy(v => v.EconomicBasis).ThenBy(v => v.AmountType).ThenBy(v => v.Novelty)",
"\n .OrderBy(v => v.DataNode).ThenBy(v => v.AccidentYear).ThenBy(v => v.EstimateType).ThenBy(v => v.EconomicBasis).ThenBy(v => v.AmountType).ThenBy(v => (v.AocType, v.Novelty))",
"\n .ThenBy(v => v.AocType)",
"\n .ToArray();"
],
Expand Down Expand Up @@ -165,7 +195,7 @@
{
"cell_type": "code",
"source": [
"const string fileNamePrefix = \"SimpleValue\";"
"string fileNamePrefix = \"SimpleValue\";"
],
"metadata": {},
"execution_count": 0,
Expand All @@ -174,22 +204,22 @@
{
"cell_type": "code",
"source": [
"await Export.ToCsv(fileNamePrefix + \"_\" + args.ReportingNode + \"_\" + args.Year.ToString() + \"_\" + args.Month.ToString() + \"_\" + args.Scenario)",
"\n .WithTable<ImportArgs>(tableConfig => tableConfig",
"\n .AtBeginning()",
"\n .WithName(Main)",
"\n .WithSource(source => args.RepeatOnce().AsQueryable())",
"\n .WithColumn(x => x.Periodicity, x => x.Delete())",
"\n .WithColumn(x => x.ImportFormat, x => x.Delete())",
"\n )",
"\n .WithTable<IfrsVariable>(tableConfig => tableConfig",
"\n .WithSource(source => ifrsVariables.AsQueryable())",
"\n .WithName(fileNamePrefix)",
"\n .WithColumn(x => x.Partition, x => x.Delete())",
"\n .WithColumn(x => x.Id, x => x.Delete())",
"\n )",
"\n .WithSource(DataSource)",
"\n .ExecuteAsync() "
"// await Export.ToCsv(fileNamePrefix + \"_\" + args.ReportingNode + \"_\" + args.Year.ToString() + \"_\" + args.Month.ToString() + \"_\" + args.Scenario)",
"\n// .WithTable<ImportArgs>(tableConfig => tableConfig",
"\n// .AtBeginning()",
"\n// .WithName(Main)",
"\n// .WithSource(source => args.RepeatOnce().AsQueryable())",
"\n// .WithColumn(x => x.Periodicity, x => x.Delete())",
"\n// .WithColumn(x => x.ImportFormat, x => x.Delete())",
"\n// )",
"\n// .WithTable<IfrsVariable>(tableConfig => tableConfig",
"\n// .WithSource(source => ifrsVariables.AsQueryable())",
"\n// .WithName(fileNamePrefix)",
"\n// .WithColumn(x => x.Partition, x => x.Delete())",
"\n// .WithColumn(x => x.Id, x => x.Delete())",
"\n// )",
"\n// .WithSource(DataSource)",
"\n// .ExecuteAsync() "
],
"metadata": {},
"execution_count": 0,
Expand All @@ -207,7 +237,16 @@
{
"cell_type": "code",
"source": [
"const string benchmarkFileNamePrefix = \"BM\";"
"string benchmarkFileNamePrefix = \"BM\";"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"source": [
"string benchmarkFileNameSuffix = \"Projection_DTP\";"
],
"metadata": {},
"execution_count": 0,
Expand All @@ -216,7 +255,7 @@
{
"cell_type": "code",
"source": [
"var estimateType = \"RA\";"
"var estimateType = EstimateTypes.BE;"
],
"metadata": {},
"execution_count": 0,
Expand All @@ -225,22 +264,23 @@
{
"cell_type": "code",
"source": [
"await Export.ToCsv(benchmarkFileNamePrefix + \"_\" + args.ReportingNode +\"_\" + args.Year.ToString() + \"_\" + args.Month.ToString() + \"_\" + args.Scenario + \"_\" + estimateType)",
"\n .WithTable<ImportArgs>(tableConfig => tableConfig",
"\n .AtBeginning()",
"\n .WithName(Main)",
"\n .WithSource(source => args.RepeatOnce().AsQueryable())",
"\n .WithColumn(x => x.Periodicity, x => x.Delete())",
"\n .WithColumn(x => x.ImportFormat, x => x.Delete())",
"\n )",
"\n .WithTable<IfrsVariable>(tableConfig => tableConfig",
"\n .WithSource(source => ifrsVariables.Where(x => x.EstimateType == estimateType).AsQueryable())",
"\n .WithName(estimateType)",
"\n .WithColumn(x => x.Partition, x => x.Delete())",
"\n .WithColumn(x => x.Id, x => x.Delete())",
"\n )",
"\n .WithSource(DataSource)",
"\n .ExecuteAsync() "
"var filename = benchmarkFileNamePrefix + \"_\" + args.ReportingNode +\"_\" + args.Year.ToString() + \"_\" + args.Month.ToString() + \"_\" + args.Scenario + \"_\" + estimateType + (string.IsNullOrWhiteSpace(benchmarkFileNameSuffix) ? string.Empty : \"_\" + benchmarkFileNameSuffix);",
"\nawait Export.ToCsv(filename)",
"\n .WithTable<ImportArgs>(tableConfig => tableConfig",
"\n .AtBeginning()",
"\n .WithName(Main)",
"\n .WithSource(source => args.RepeatOnce().AsQueryable())",
"\n .WithColumn(x => x.Periodicity, x => x.Delete())",
"\n .WithColumn(x => x.ImportFormat, x => x.Delete())",
"\n )",
"\n .WithTable<IfrsVariable>(tableConfig => tableConfig",
"\n .WithSource(source => ifrsVariables.Where(x => x.EstimateType == estimateType).AsQueryable())",
"\n .WithName(estimateType)",
"\n .WithColumn(x => x.Partition, x => x.Delete())",
"\n .WithColumn(x => x.Id, x => x.Delete())",
"\n )",
"\n .WithSource(DataSource)",
"\n .ExecuteAsync() "
],
"metadata": {},
"execution_count": 0,
Expand All @@ -249,7 +289,7 @@
{
"cell_type": "code",
"source": [
""
"ifrsVariables"
],
"metadata": {},
"execution_count": 0,
Expand Down
Loading