我正试图通过使用Excel Power Query创建一个老化桶分析。
到目前为止,我已经创建了一个列来计算每条记录的年龄。我目前正在进行的步骤是将每个记录分类到年龄桶中;31-60天逾期";等等。这是通过使用具有以下公式的自定义列来完成的:
=if [Payment Due Date] >180 then "over 180 days due" else if [Payment Due Date] <= 180 and [Payment Due Date] > 150 then "151-180 days overdue" else if [Payment Due Date] <= 150 and [Payment Due Date] > 120 then "121-150 days overdue" else if [Payment Due Date] <= 120 and [Payment Due Date] > 90 then "91-120 days overdue" else if [Payment Due Date] <= 90 and [Payment Due Date] > 60 then "61-90 days overdue" else if [Payment Due Date] <= 60 and [Payment Due Date] > 30 then "31-60 days overdue" else if [Payment Due Date] <= 30 and [Payment Due Date] > 0 then "1-30 days overdue" else if [Payment Due Date]<= 0 and [Payment Due Date] > -30 then "1-30 days overdue" else if [Payment Due Date] <= -30 and[Payment Due Date] and [Payment Due Date] > -60 then "31-60 days overdue" else if [Payment Due Date] <= -60 and [Payment Due Date] > -90 then "61-90 days overdue" else if [Payment Due Date] <= -90 and [Payment Due Date] > -120 then "91-120 days overdue" else if [Payment Due Date] <= -120 and [Payment Due Date] > -150 then "121-150 days overdue" else if [Payment Due Date] <= -150 and [Payment Due Date] > -180 then "151-180 days overdue" else if [Payment Due Date] <= -180 then "over 180 days overdue" else 0
但我得到以下错误:Expression.Error: *We cannot apply operator < to types Number and Date. Details: Operator=< Left=180 Right=5/3/2021*
这里有一些图片供你评估错误消息自定义列公式视图
=if[逾期天数]>180,然后";逾期180天以上";否则,如果[逾期天数]<=180和[逾期天数]>150那么"逾期151-180天">
else if[逾期天数]<=150和[最后到期日]>120然后"逾期121-150天">
else if[逾期天数]<=120和[逾期天数]>90那么"91-120天逾期">
else if[逾期天数]<=90和[逾期天数]60"逾期61-90天">
else if[逾期天数]<=60和[逾期天数]>30然后"31-60天逾期">
else if[逾期天数]<=30和[逾期天数]>0,则";1-逾期30天">
else if[逾期天数]<=0和[逾期天数]>-30然后";1-30天到期">
else if[逾期天数]<=-30和[逾期天数]>-60那么";31-60天到期">
else if[逾期天数]<=-60和[逾期天数]>-90那么";61-90天到期";否则,如果[逾期天数]<=-90和[逾期天数]>-120那么";91-120天到期">
else if[逾期天数]<=-120和[逾期天数]>-150那么";121-150天到期">
否则,如果[逾期天数>日期]<=-150和[逾期天数]>-180那么";151-180天到期";否则,如果[逾期天数]<=-180,然后";超过180天到期">
其他0