Hi Team,
Could you please assist on below mentioned query - Thanks in advance.
Orginal Data set :
Id | DATE | Price |
1217246 | 11/14/2022 | 20.08 |
1217246 | 11/13/2022 | 19.95 |
1217246 | 11/10/2022 | 19.43 |
1217246 | 11/9/2022 | 18.43 |
1217246 | 11/8/2022 | 18.56 |
1217246 | 11/7/2022 | 18.51 |
1217225 | 11/14/2022 | 56.3 |
1217225 | 11/13/2022 | 55.5 |
1217225 | 11/10/2022 | 54 |
1217225 | 11/9/2022 | 55.7 |
1217225 | 11/8/2022 | 56.5 |
1217225 | 11/7/2022 | 57.3 |
1217202 | 11/14/2022 | 11.22 |
1217202 | 11/13/2022 | 10.89 |
1217202 | 11/10/2022 | 10.62 |
1217202 | 11/9/2022 | 10.97 |
1217202 | 11/8/2022 | 11.71 |
1217202 | 11/7/2022 | 11.88 |
Required Solution :
id | 11/14/2022 | 11/13/2022 | 11/10/2022 | 11/9/2022 | 11/8/2022 | 11/7/2022 |
1217246 | 20.08 | 19.95 | 19.43 | 18.43 | 18.56 | 18.51 |
1217225 | 56.3 | 55.5 | 54 | 55.7 | 56.5 | 57.3 |
1217202 | 11.22 | 10.89 | 10.62 | 10.97 | 11.71 | 11.88 |
Here's how you can do this whilst easily maintaining the order of fields and rows:
As standard, Cross-Tab will cause fields to be sorted in alphabetical order and so we can get around this by just assigning an ascending integer to each which we then just swap out for the original header that corresponds to it when we come to the final few steps.