0

我正在尝试通过使用 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* 这里有一些图片供您评估 错误消息 自定义列公式视图

4

1 回答 1

0

=if [Days Past Due Date] >180 则“逾期超过 180 天” else if [Days Past Due Date] <= 180 且 [Days Past Due Date] > 150 则“逾期 151-180 天”
else if [Days Past到期日] <= 150 且 [DaysPast Due Date] > 120 则“逾期 121-150 天”
,否则如果 [Days Past Due Date] <= 120 且 [Days Past Due Date] > 90 则“逾期 91-120 天”
else if [Days Past Due Date] <= 90 and [Days Past Due Date] 60 then "61-90 days overdue"
else if [Days Past Due Date] <= 60 and [Days Past Due Date] > 30 then "31 -60 天逾期”
,否则如果 [逾期天数] <= 30 且 [逾期天数] > 0,则“逾期 1-30 天”
,否则如果 [逾期天数] <= 0 且 [逾期天数] ] >-30 然后“1-30 天到期”
else if [Days Past Due Date] <= -30 and [Days Past Due Date] > -60 then "31-60 days due"
else if [Days Past Due Date] <= -60 and [Days Past Due Date] > -90 然后“61-90 天到期” else if [Days Past Due Date] <= -90 和 [Days Past Due Date] > -120 然后“91-120 天到期”
else if [Days Past Due Date] <= -120 和 [Days> Past Due Date] > -150 然后 "121-150 days due"
else if [Days Past Due > Date] <= -150 and [Days Past Due Date] > -180 then "151-180 days到期” else if [Days Past Due Date] <= -180 then “超过 180 天到期”
else 0

于 2021-06-22T11:46:11.723 回答