101
0/304
Loading content...
Your insurance analytics warehouse stores one row per policy in a table named Insurance:
You need a one-row summary metric for 2016 called tiv_2016.
Include only policies that satisfy BOTH filters:
Return exactly one column:
Additional rules:
Solve this in both:
Insurance:
| pid | tiv_2015 | tiv_2016 | lat | lon |
|-----|----------|----------|------|------|
| 1 | 10.00 | 5.00 | 10.0 | 10.0 |
| 2 | 20.00 | 20.00 | 20.0 | 20.0 |
| 3 | 10.00 | 30.00 | 20.0 | 20.0 |
| 4 | 10.00 | 40.00 | 40.0 | 40.0 |[
{"tiv_2016":45.0}
]Rows 1 and 4 pass both conditions. Row 2 fails shared-2015, and row 3 fails unique-location. Total is 45.00.
Insurance:
| pid | tiv_2015 | tiv_2016 | lat | lon |
|-----|----------|----------|-----|-----|
| 10 | 50.00 | 12.25 | 1.0 | 1.0 |
| 11 | 60.00 | 22.00 | 2.0 | 2.0 |
| 12 | 70.00 | 18.75 | 3.0 | 3.0 |[
{"tiv_2016":0.0}
]No tiv_2015 value repeats, so no row qualifies. Return 0.00.
Insurance:
| pid | tiv_2015 | tiv_2016 | lat | lon |
|-----|----------|----------|-----|-----|
| 21 | 30.00 | 10.00 | 5.0 | 5.0 |
| 22 | 30.00 | 15.00 | 5.0 | 5.0 |
| 23 | 30.00 | 25.00 | 6.0 | 6.0 |
| 24 | 40.00 | 35.00 | 7.0 | 7.0 |
| 25 | 40.00 | 45.00 | 8.0 | 8.0 |[
{"tiv_2016":105.0}
]Rows 23, 24, and 25 pass both rules, giving 25 + 35 + 45 = 105.00.
Constraints