I am trying to find which packages each customer has subscribed to and display it in a table form with customers and the packages they have subscribed to (see table 2). In this scenario, a customer has to buy a specific set of items in order to subscribe to a package (0 means not purchased, 1 means purchased). There are 3 packages, X, Y, and Z. To subscribe to package X, the customer must at least purchase item 1 AND item 2. To subscribe to package Y, the customer must at least purchase item 3. To subscribe to package Z, the customer must at least purchase item 4 AND item 5. Currently each package is represented as a calculated field, where 0 represents not subscribed and 1 represents subscribed. I am given a table like this:
| Customer | Item | Purchased? |
|---|---|---|
| A | Item 1 | 1 |
| Item 2 | 0 | |
| Item 3 | 1 | |
| Item 4 | 0 | |
| Item 5 | 1 | |
| B | Item 1 | 1 |
| Item 2 | 1 | |
| Item 3 | 1 | |
| Item 4 | 1 | |
| Item 5 | 0 | |
| C | Item 1 | 0 |
| Item 2 | 1 | |
| Item 3 | 0 | |
| Item 4 | 1 | |
| Item 5 | 1 | |
| D | Item 1 | 1 |
| Item 2 | 1 | |
| Item 3 | 1 | |
| Item 4 | 1 | |
| Item 5 | 1 |
How would I use this data to produce a table like this?
| Customer | Package |
|---|---|
| A | Y |
| C | X, Y |
| B | Z |
| D | X, Y, Z |