You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AWS Quicksight使用ifelse函数合并日期列结果异常及报错问题

日期列合并IFELSE公式错误修复方案

错误原因分析

  • 第一个公式ifelse(RewardPaidDate = null,rewarddate, RewardPaidDate)失效原因:null是数据库/BI工具中的特殊未知值,无法用=运算符直接判断相等,RewardPaidDate = null的返回结果恒为未知,因此逻辑永远走不到取rewarddate的分支,只会原样返回RewardPaidDate,空值自然会保留。
  • 第二个公式ifelse(RewardPaidDate = '',rewarddate, RewardPaidDate)报错原因:RewardPaidDate是日期类型字段,''属于字符串类型,两种不同数据类型的值直接比较触发了类型不匹配错误。

正确写法

使用专门的空值判断函数校验RewardPaidDate是否为空即可,通用写法如下:

ifelse(isNull(RewardPaidDate), rewarddate, RewardPaidDate)

如果你的工具中isNull不生效,可尝试替换为isnull、IS NULL语法,SQL原生写法参考:

IF(RewardPaidDate IS NULL, rewarddate, RewardPaidDate) AS RewardSentDate

内容的提问来源于stack exchange,提问作者tidy2021

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.23 22:15:07