Hello All,
I have a file where each customer has different dates. There are other columns having Aging status with amount.
We are trying to represent for each customer the date of disconnect status in transpose/crosstab, and the os amount for each disconnect date has to be taken from the aging column. If the number of days are 219, the aging amount for the disconnect date will be from 180-365 days column.
Cust | Port | Date1 | Status | DateCutOff | Days | 30-60 days | 60-90 days | 90-120 days | 120-180 days | 180-365 days | Above 365 days |
1148 | TG | 23-Feb-17 | Disc | 30-09-2017 | 219 | 8689.01 | 3548.95 | 4306.75 | 21395.46 | 2574.47 | 0 |
1148 | TG | 26-Jul-17 | Disc | 30-09-2017 | 66 | 8689.01 | 3548.95 | 4306.75 | 21395.46 | 2574.47 | 0 |
1148 | TG | 03-Aug-17 | Disc | 30-09-2017 | 58 | 8689.01 | 3548.95 | 4306.75 | 21395.46 | 2574.47 | 0 |
1148 | TG | 01-Sep-17 | Disc | 30-09-2017 | 29 | 8689.01 | 3548.95 | 4306.75 | 21395.46 | 2574.47 | 0 |
67600 | TG | 21-Jun-17 | Disc | 30-09-2017 | 101 | 972.98 | 1863.95 | 3241.61 | 3104.24 | 1050.87 | 1.97 |
67600 | TG | 08-Jul-17 | Disc | 30-09-2017 | 84 | 972.98 | 1863.95 | 3241.61 | 3104.24 | 1050.87 | 1.97 |
67787 | TA | 02-Aug-17 | Disc | 30-09-2017 | 59 | 400 | 890 | 767 | 267 | 456 | 312 |
Output
Cust | Disc1 | Os/ amount | Disc2 | Os/ amount | Disc3 | Os/ amount | Disc4 | Os/ amount | Disc5 | Os/ amount | Disc6 | Os/ amount |
1148 | 23-Feb-17 | 2574.47 | 26-Jul-17 | 3548.95 | 03-Aug-17 | 8689.01 | 01-Sep-17 | 8689.01 | ||||
67600 | 21-Jun-17 | 3241.61 | 08-Jul-17 | 1863.95 | ||||||||
67787 | 02-Aug-17 | 400 |
Attached the sample data. Please help.