Skip to main content

Result Examples

Use Cases

Retrieve Percentile of Balance Sheet

For each timestep retrieve the 5%, 30%, 70% and 95% percentile of the Balance Sheet's NET_WORTH row and TOTAL column (BS@NET_WORTH@TOTAL). The projected values will be that matched NET_WORTH, and possibly other values of the "matched" lives based on the specified percentiles.

Query

[
[
{ "dataset": "data", "name": "5th percentile", "aggregate": "timestepId" },
{ },
{ "percentile": { "$pct": [ "BS@NET_WORTH@TOTAL", 5 ] } }
],
[
{ "dataset": "data", "name": "30th percentile", "aggregate": "timestepId" },
{ },
{ "percentile": { "$pct": [ "BS@NET_WORTH@TOTAL", 30 ] } }
],
[
{ "dataset": "data", "name": "70th percentile", "aggregate": "timestepId" },
{ },
{ "percentile": {"$pct": [ "BS@NET_WORTH@TOTAL", 70 ] } }
],
[
{ "dataset": "data", "name": "95th percentile", "aggregate": "timestepId" },
{ },
{ "percentile": { "$pct": [ "BS@NET_WORTH@TOTAL", 95 ] } }
]
]

Results

[
{ "name": "5th percentile",
"results": [
{ "timestepId": 1, "data": { "percentile": 0.0} },
{ "timestepId": 2, "data": { "percentile": 1098.606 } },
{ "timestepId": 3, "data": { "percentile": 0.0 } } ]
},
{ "name": "30th percentile",
"results": [
{ "timestepId": 1, "data": { "percentile": 262.689 } },
{ "timestepId": 2, "data": { "percentile": 1098.606 } },
{ "timestepId": 3, "data": { "percentile": 549.303 } } ]
},
{ "name": "70th percentile",
"results": [
{ "timestepId": 1, "data": { "percentile": 1708.634 } },
{ "timestepId": 2, "data": { "percentile": 2469.7 } },
{ "timestepId": 3, "data": { "percentile": 2469.7 } } ]
},
{ "name": "95th percentile",
"results": [
{ "timestepId": 1, "data": { "percentile": 2891.89 } },
{ "timestepId": 2, "data": { "percentile": 2469.7 } },
{ "timestepId": 3, "data": { "percentile": 2469.7 } } ]
}
]

Retrieve Overall Goals Achievability

Overall Goal Achievability is represented as the result of the division of lives that the goal was achieved divided by the lives alive.

Query

[
[
{ "dataset": "goal", "aggregate": "goalId", "name": "Total Achieved", "gather": "after" },
{ "achieved": 1 },
{ "totalAchieved": { "$count": 1 } }
],
[
{ "dataset": "goal", "aggregate": "goalId", "name": "Total Alive", "gather": "after" },
{ "GP@primaryAlive": 1 },
{ "totalAlive": { "$count": 1 } }
]
]

Results

[
{
"name": "Total Achieved",
"results": [ { "goalId": "AAA", "data": { "totalAchieved": 4 } },
{ "goalId": "CCC", "data": { "totalAchieved": 1 } },
{ "goalId": "BBB", "data": { "totalAchieved": 3 } } ]
},
{
"name": "Total Alive",
"results": [ { "goalId": "AAA", "data": { "totalAlive": 4 } },
{ "goalId": "CCC", "data": { "totalAlive": 1 } },
{ "goalId": "BBB", "data": { "totalAlive": 1 } } ]
}
]

Retrieve Goal Achievability Inside Bands

Bands are defined as the area of probabilities enclosed between the array of percentiles passed as parameters.

For example in this use case there are 2 bands. One band that encloses the lives whose total net worth lies between the 30% and 50% percentile of total net worths across all lives and a second band with percentiles ranging from 50% to 95%.

Query

[
[
{ "dataset": "goal", "aggregate": "goalId", "name": "Total Achieved", "gather": "after",
"bands": { "cell": "BS@NET_WORTH@TOTAL", "percentiles": [ 30, 50, 95 ] } },
{ "achieved": 1 },
{ "totalAchieved": { "$count": 1}}
],
[
{ "dataset": "goal", "aggregate": "goalId", "name": "Total Alive", "gather": "after",
"bands": { "cell": "BS@NET_WORTH@TOTAL", "percentiles": [ 30, 50, 95 ] } },
{ "GP@primaryAlive": 1 },
{ "totalAlive": { "$count": 1}}
]
]

Results

[
{
"name": "Total Achieved",
"results": [ { "goalId": "AAA",
"data": { "totalAchieved": 4,
"bands": { "1": { "totalAchieved": 3 },
"2": { "totalAchieved": 1 }
}
}
},
{ "goalId": "CCC",
"data": { "totalAchieved": 1,
"bands": { "1": { "totalAchieved": 1 },
"2": { "totalAchieved": 0 }
}
}
},
{ "goalId": "BBB",
"data": { "totalAchieved": 3,
"bands": { "1": { "totalAchieved": 1 },
"2": { "totalAchieved": 2 }
}
}
}
]
},
{
"name": "Total Alive",
"results": [ { "goalId": "AAA",
"data": { "totalAlive": 4,
"bands": { "1": { "totalAlive": 2 },
"2": { "totalAlive": 1 }
}
}
},
{ "goalId": "CCC",
"data": { "totalAlive": 1,
"bands": { "1": { "totalAlive": 0 },
"2": { "totalAlive": 1 }
}
}
},
{ "goalId": "BBB",
"data": { "totalAlive": 1,
"bands": { "1": { "totalAlive": 0 },
"2": { "totalAlive": 1 }
}
}
}
]
}
]

By Primary Person or Partner alive

The GP@eitherAlive property defines either the Primary member of the household or the Partner of the Primary being alive or not.

Query

[
[
{ "dataset": "goal", "aggregate": "goalId", "name": "Total Achieved", "gather": "after",
"bands": { "cell": "BS@NET_WORTH@TOTAL", "percentiles": [ 30, 50, 95 ] } },
{ "achieved": 1 },
{ "totalAchieved": { "$count": 1}}
],
[
{ "dataset": "goal", "aggregate": "goalId", "name": "Total Alive", "gather": "after",
"bands": { "cell": "BS@NET_WORTH@TOTAL", "percentiles": [ 30, 50, 95 ] } },
{ "GP@eitherAlive": 1 },
{ "totalAlive": { "$count": 1 } }
]
]

Results

[
{
"name": "Total Achieved",
"results": [
{
"goalId": "AAA",
"data": {
"totalAchieved": 473,
"bands": {
"1": {
"totalAchieved": 237
},
"2": {
"totalAchieved": 236
}
}
}
}
]
},
{
"name": "Total Alive",
"results": [
{
"goalId": "AAA",
"data": {
"totalAlive": 473,
"bands": {
"1": {
"totalAlive": 237
},
"2": {
"totalAlive": 236
}
}
}
}
]
}
]

Retrieve Probability of 'Will I have Money?'

For each year, the probability of "Will I have money?". This is defined as the number of lives that the BS@NET_WORTH@TOTAL is > 0 divided by the lives alive.

Query

[
[
{ "dataset": "data", "name": "Positive networth", "aggregate": "timestepId" },
{ "BS@NET_WORTH@TOTAL": { "$gt" : 0.0 } },
{ "total": { "$count": 1 } }
],
[
{ "dataset": "data", "name": "Total lives alive", "aggregate": "timestepId" },
{ "GP@primaryAlive": 1 },
{ "totalAlive": { "$count": 1 } }
]
]

Results

[
{
"name": "Positive networth",
"results": [ { "timestepId": 1, "data": { "total": 3 } },
{ "timestepId": 2, "data": { "total": 4 } },
{ "timestepId": 3, "data": { "total": 3 } }
]
},
{
"name": "Total lives alive",
"results": [ { "timestepId": 1, "data": { "totalAlive": 4 } },
{ "timestepId": 2, "data": { "totalAlive": 3 } },
{ "timestepId": 3, "data": { "totalAlive": 1 } }
]
}
]

Return Balance Sheet or General Properties

For a given life and a range of timesteps return Balance Sheet or General properties.

Query

[ 
{ "dataset": "data" },
{ "timestepId": { "$in": [ 1, 2 ] }, "lifeId": 1 },
{ "lifeId": 1, "timestepId": 1, "BS@NET_WORTH@TOTAL": 1, "GP@primaryAlive": 1 }
]

Results

[
{
"results": [ { "lifeId": 1, "timestepId": 1,
"data": { "GP@primaryAlive": 1, "BS@NET_WORTH@TOTAL": 525.378 }
},
{ "lifeId": 1, "timestepId": 2,
"data": { "GP@primaryAlive": 1, "BS@NET_WORTH@TOTAL": 1098.606 }
}
]
}
]

Retrieve Maximum Net Worth

Find the maximum net worth total value per life.

Query

[
{ "dataset": "data", "name": "Max value", "aggregate": "lifeId" },
{ },
{ "maxValue": {"$max": "BS@NET_WORTH@TOTAL"}, "lifeId": 1, "timestepId": 1 }
]

Results

[
{
"name": "Max value",
"results": [ { "lifeId": 1, "timestepId": 2, "data": { "maxValue": 1098.606 } },
{ "lifeId": 2, "timestepId": 1, "data": { "maxValue": 2891.89 } },
{ "lifeId": 3, "timestepId": 2, "data": { "maxValue": 2469.7 } },
{ "lifeId": 4, "timestepId": 2, "data": { "maxValue": 1098.606 } }
]
}
]

Retrieve Primary Alive

For a given timestep, find the Primary member of the household being alive across all lives.

Query

[ { "dataset": "data" }, { "timestepId": 1 }, { "lifeId": 1, "GP@primaryAlive": 1 } ]

Results

[
{
"results": [ { "lifeId": 1, "data": { "GP@primaryAlive": 1 } },
{ "lifeId": 2, "data": { "GP@primaryAlive": 1 } },
{ "lifeId": 3, "data": { "GP@primaryAlive": 0 } },
{ "lifeId": 4, "data": { "GP@primaryAlive": 0 } }
]
}
]

Retrieve Primary Health Status

For one timestep, find the health status of the Primary member of the household across all lives.

Query

[ { "dataset": "data" }, { "timestepId": 23 }, { "lifeId": 1, "GP@PRIMARY_HEALTH_STATUS": 1 } ]

Results

[
{
"results": [ { "lifeId": 1, "data": { "GP@PRIMARY_HEALTH_STATUS": 7 } },
{ "lifeId": 2, "data": { "GP@PRIMARY_HEALTH_STATUS": 7 } },
{ "lifeId": 3, "data": { "GP@PRIMARY_HEALTH_STATUS": 7 } },
{ "lifeId": 4, "data": { "GP@PRIMARY_HEALTH_STATUS": 4 } }
]
}
]

Retrieve insurance payout and premium amount

For a certain life, find the insurance payout and the premium amount.

Query

[ { "dataset": "data" }, 
{ "lifeId": 23 },
{
"timestepId": 1,
"IS@EXPENSE_NON_DISCRECTIONARY_INSURANCE_PREMIUMS_PRIMARY@CASH_MOVEMENTS" : 1,
"IS@EXPENSE_NON_DISCRECTIONARY_INSURANCE_PREMIUMS_PARTNER@CASH_MOVEMENTS" : 1,
"IS@INCOME_UNEARNED_INSURANCE_PAYOUT@NET_CASH_FLOW" : 1
}
]

Results

[
{
"results": [
{ "timestepId": 1,
"data": {
"IS@EXPENSE_NON_DISCRECTIONARY_INSURANCE_PREMIUMS_PARTNER@CASH_MOVEMENTS": 0,
"IS@EXPENSE_NON_DISCRECTIONARY_INSURANCE_PREMIUMS_PRIMARY@CASH_MOVEMENTS": 0,
"IS@INCOME_UNEARNED_INSURANCE_PAYOUT@NET_CASH_FLOW": 0
}
},
{ "timestepId": 2,
"data": {
"IS@EXPENSE_NON_DISCRECTIONARY_INSURANCE_PREMIUMS_PARTNER@CASH_MOVEMENTS": 0,
"IS@EXPENSE_NON_DISCRECTIONARY_INSURANCE_PREMIUMS_PRIMARY@CASH_MOVEMENTS": 0,
"IS@INCOME_UNEARNED_INSURANCE_PAYOUT@NET_CASH_FLOW": 0
}
},
{ "timestepId": 3,
"data": {
"IS@EXPENSE_NON_DISCRECTIONARY_INSURANCE_PREMIUMS_PARTNER@CASH_MOVEMENTS": 0,
"IS@EXPENSE_NON_DISCRECTIONARY_INSURANCE_PREMIUMS_PRIMARY@CASH_MOVEMENTS": 0,
"IS@INCOME_UNEARNED_INSURANCE_PAYOUT@NET_CASH_FLOW": 0
}
}
]
}
]

Retrieve actuarial data

Across all lives find the relevant actuarial data for a given timestep.

Mortality

Query

[
{ "dataset": "data" },
{ "timestepId": 40 },
{ "GP@primaryAlive": 1, "GP@partnerAlive": 1 }
]

Results

[
{
"results": [
{
"data": {
"GP@primaryAlive": 1
"GP@partnerAlive": 0
}
},
{
"data": {
"GP@primaryAlive": 1
"GP@partnerAlive": 0
}
}
]
}
]

Critical illness

Query

[ 
{ "dataset": "data" },
{ "timestepId": 20, "GP@PRIMARY_HEALTH_STATUS": 0 },
{ "GP@PRIMARY_HEALTH_STATUS": 1 }
]

Results

[
{
"results": [
{
"lifeId": 1,
"timestepId": 1,
"data": {
"GP@PRIMARY_HEALTH_STATUS": 8
}
},
{
"lifeId": 2,
"timestepId": 1,
"data": {
"GP@PRIMARY_HEALTH_STATUS": 6
}
}
]
}
]

Disability

Query

[ 
{ "dataset": "data" },
{ "timestepId": 20, "GP@PRIMARY_HEALTH_STATUS": 3 },
{ "GP@PRIMARY_HEALTH_STATUS": 1 }
]

Results

[
{
"results": [
{
"lifeId": 1,
"timestepId": 1,
"data": {
"GP@PRIMARY_HEALTH_STATUS": 8
}
},
{
"lifeId": 2,
"timestepId": 1,
"data": {
"GP@PRIMARY_HEALTH_STATUS": 6
}
}
]
}
]