Hi community,
I wanted to ask you for help. My data will have 2 lines for each ID with a unique name and I will need to dynamically check which column has changed(for the same ID) and create a new column with a comment section.
If the column will change we need to use below mapping table to identify which comment add this comment to my output. I can add only one comment so I need to choose the one with the highest priority.
| Column with Difference | Comment | Priority |
| Trade Date | Trade Date | 1 |
| Product | PD | 2 |
| Price | Pricing | 3 |
| Cost | Cost | 4 |
The truth is I have 16 different comments that I can put so I want to make this dynamic instead of using the formula.
This is the initial input file:
| Id | Trade Date | Product | Price | Cost |
| ID 1 | 01.01.2020 | ABC | 123 | 222 |
| ID 1 | 01.01.2020 | XYZ | 123 | 222 |
| ID 2 | 01.01.2020 | ABC | 111 | 123 |
| ID 2 | 01.05.2020 | ABC | 111 | 123 |
This is the output:
| Id | Trade Date | Product | Price | Cost | Comment |
| ID 1 | 01.01.2020 | ABC | 123 | 222 | PD |
| ID 1 | 01.01.2020 | XYZ | 123 | 222 | PD |
| ID 2 | 01.01.2020 | ABC | 111 | 123 | Trade Date |
| ID 2 | 01.05.2020 | ABC | 111 | 123 | Trade Date |
| ID 3 | 01.06.2020 | ACD | 122 | 132 | Trade Date |
| ID 3 | 01.08.2020 | WRE | 424 | 787 | Trade Date |
Any ideas what would be the best approach for this problem?