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 |
Solved! Go to Solution.
Hi,
Thanks a lot for your efforts. Could you please tell me how to apply the Min & Max Date logic based on the State?
For e.g. For 0000040321/001913 it should give me Max Date for State 8 i.e. 28-03-2020. Currently it's giving me the first Date(18-03-2020). If State is 2 then it should give minimum date in column "State 2". If State is 4 then put Maximum date in column "State 4".
So for States 2, and 8 you want the Minimum date, but for State 4 you want the Maximum date, is that right? If that's the case, they split out your Data to the states you want to have Min\Max dates, then join then back together, and create the table. I've updated the workflow...
Thanks a lot. 🙂