[英]How to write calculated field formula in AWS QuickSight using ifelse
我正在嘗試編寫一個公式,根據日期計算折扣成本。
2019 年 5 月之后產生的任何成本的貼現率為 7%,之前的任何成本為 6%。
這就是我的公式,但它說語法不正確。 任何幫助將非常感激。
ifelse(month >= 5 AND year >= 2019), then {unblended_cost} - ({unblended_cost} * 0.07), else {unblended_cost} - ({unblended_cost} * 0.06))
請嘗試以下操作,如果您遇到其他錯誤,請告訴我
ifelse(
month >= 5 AND year >= 2019,
{unblended_cost} - ({unblended_cost} * 0.07),
{unblended_cost} - ({unblended_cost} * 0.06)
)
本質上ifelse
可以被認為是單個 function, then
和else
關鍵字是無關的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.