I have a table with purchase orders, and all POs could have several entries with different items associated.
| PO | PN | Status |
|---|---|---|
| 1 | A | Open |
| 1 | B | progress |
| 1 | C | Delivered |
| 2 | A | Open |
| 3 | A | Delivered |
| 3 | A | Delivered |
From this master data Table, I would like to create a overview table, with just one entry per PO and only one Status information, according certain criteria.
Criteria example:
- if one item is in PROGRESS or DELIVERED set PO status as PROGRESS
- if one item is in OPEN (But don't exist PROGRESS) set PO Status as OPEN.
- if all item is in PROGRESS or DELIVERED or OPEN set PO Status as PROGRESS or DELIVERED or OPEN accordingly.
OVERVIEW TABLE Example:
| PO | Status |
|---|---|
| 1 | PROGRESS |
| 2 | OPEN |
| 3 | Delivered |