Hi Team,
I am new in Alteryx. Please find the attached excel. I have two sheets: one is data and other one is State. and want to do transform the data like output. In raw data, I don't have all the states from 1 to 20 but I want to display all the States as a column and then want to put respective date on State column against Order No/Line item.
Logic : For one Order No/Line item we should have one row only. If same Order No/Line item is repeating then and State is 8 then we should put maximum Date in Column "State 8". If State is 2 then we should put minimum date in column "State 2". If State is 4 then we should put Maximum date in column "State 4".
Thanks for looking into this. I appreciate your help.
Thanks,
Sagar Kharpude
Data
| Date | Order No/Line item | Code | State |
| 18-03-2020 | 0000040321/001911 | 8 | State 8 |
| 18-03-2020 | 0000040321/001912 | 8 | State 8 |
| 18-03-2020 | 0000040321/001913 | 8 | State 8 |
| 18-03-2020 | 0000040307/000601 | 8 | State 8 |
| 28-03-2020 | 0000040321/001913 | 8 | State 8 |
| 15-03-2020 | SS0044544452002 | 2 | State 2 |
| 18-03-2020 | SS0044544452002 | 2 | State 2 |
| 18-03-2020 | SS0044544452001 | 8 | State 8 |
| 21-03-2020 | SS0044544452002 | 8 | State 8 |
| 18-03-2020 | 0000040012/000301 | 4 | State 4 |
| 21-03-2020 | 0000040012/000301 | 4 | State 4 |
State:
| State |
| State 1 |
| State 2 |
| State 3 |
| State 4 |
| State 5 |
| State 6 |
| State 7 |
| State 8 |
| State 9 |
| State 10 |
| State 11 |
| State 12 |
| State 13 |
| State 14 |
| State 15 |
| State 16 |
| State 17 |
| State 18 |
| State 19 |
| State 20 |
Expected Output:
| Order No/Line item | State 1 | State 2 | State 3 | State 4 | State 5 | State 6 | State 7 | State 8 | State 9 | State 10 | State 11 | State 12 | State 13 | State 14 | State 15 | State 16 | State 17 | State 18 | State 19 | State 20 |
| 0000040321/001911 | | | | | | | | 18-03-2020 | | | | | | | | | | | | |
| 0000040321/001912 | | | | | | | | 18-03-2020 | | | | | | | | | | | | |
| 0000040321/001913 | | | | | | | | 28-03-2020 | | | | | | | | | | | | |
| 0000040307/000601 | | | | | | | | 18-03-2020 | | | | | | | | | | | | |
| SS0044544452002 | | 15-03-2020 | | | | | | 21-03-2020 | | | | | | | | | | | | |
| SS0044544452001 | | | | | | | | 18-03-2020 | | | | | | | | | | | | |
| 0000040012/000301 | | | | 21-03-2020 | | | | | | | | | | | | | | | | |