As discussed, I have listed and numbered the business rules, it is worth creating this in a sequenced query from 1 to 10. Please note the & conditions in rules 4 and 9:
1. If any HIGH CRITICAL station is RED, then group = RED.
2. If greater than or equal to 50% of the HIGH CRITICAL stations are AMBER (and no less than 2) then Group = RED
3. If greater than or equal to 70% of MEDIUM CRITICAL stations are RED 9 (and no less than 3) then Group = RED
4. If less than 50% of HIGH CRITICAL stations are AMBER & greater than or equal to 70% of MEDIUM CRITICAL stations are AMBER then Group = RED
5. If any HIGH CRITICAL station is AMBER, then Group = AMBER
6. If any MEDIUM CRITICAL station is RED, then Group = AMBER
7. If greater than or equal to 50% of MEDIUM CRITICAL stations are AMBER (and no less than 3), then Group = AMBER
8. If greater than or equal to 70% of LOW CRITICAL stations are RED (and no less than 2), then Group = AMBER
9. If less than 50% of MEDIUM CRITICAL stations are AMBER & greater than or equal to 70% of LOW CRITICAL stations are AMBER then Group = AMBER
10. All other conditions that do not fit into the above scenarios, the Group = GREEN
Thanks for your help.
Regards,
shameen
Bookmarks