I currently have a dataset that is formatted:
Company | Clients | Date | Type | Amt |
---|---|---|---|---|
comp1 | client1, client2, client3 | 01/02/22 | visa | $1500 |
comp2 | client1 | amex | $600 | |
comp3 | client3, client4, client5, client1 | 02/23/22 | check | $4000 |
comp4 | client6, client7, client8 | check | $1800 |
And I would like to end up with a dataset formatted for each client transaction:
Client | Date | Type | Amt | Company | Expense type |
---|---|---|---|---|---|
client1 | 01/02/22 | visa | $500 | comp1 | Company |
client2 | 01/02/22 | visa | $500 | comp1 | Company |
client3 | 01/02/22 | visa | $500 | comp1 | Company |
client1 | amex | $600 | comp2 | Company | |
client3 | 02/23/22 | check | $1000 | comp3 | Company |
client4 | 02/23/22 | check | $1000 | comp3 | Company |
client5 | 02/23/22 | check | $1000 | comp3 | Company |
client1 | 02/23/22 | check | $1000 | comp3 | Company |
client6 | check | $600 | comp4 | Company | |
client7 | check | $600 | comp4 | Company | |
client8 | check | $600 | comp4 | Company |