嗨,我需要一个晶体或IF公式的帮助,我似乎无法开始工作,这就是我认为应该如何编写公式:
If {'GPD_Data_'.Deal No}= [0000,9452] and
{'GPD_Data_'.Saving Accepted ?} <> ["1-Accepted","Unknown"]
then 0
else {'GPD_Data_'.% Charges in GBP}
or if {'GPD_Data_'.Deal No}= [9281] and
{'GPD_Data_'.Saving Accepted ?} = ["13-Itinerary Changed,6-Cancelled"]
then 10
else {'GPD_Data_'.% Charges in GBP}
OR IF部分之前的公式工作正常,但在此之后无法获得另一个功能,有人能指出我正确的方向吗?
答案 0 :(得分:0)
我认为问题在于没有OR IF。你可以说OR并添加第二个条件,但是,因为你需要另一个其他你可能需要使用elseif或内部if。
我无法对此进行测试,但尝试添加一些缩进格式和代码,如下所示:
If {'GPD_Data_'.Deal No} = [0000,9452] and {'GPD_Data_'.Saving Accepted ?} <> ["1-Accepted","Unknown"] then
0
else
if {'GPD_Data_'.% Charges in GBP}
or ( {'GPD_Data_'.Deal No}= [9281] and {'GPD_Data_'.Saving Accepted ?} = ["13-Itinerary Changed,6-Cancelled"] ) then
10
else
{'GPD_Data_'.% Charges in GBP}
希望这有效。
答案 1 :(得分:0)
和卡洛斯一样,我认为这个问题至少部分是由or if
之后使用else
引起的,尽管我认为还存在其他一些问题。试试这个:
If {'GPD_Data_'.Deal No} in [0000,9452] and
{'GPD_Data_'.Saving Accepted ?} not in ["1-Accepted","Unknown"]
then 0
else if {'GPD_Data_'.Deal No}= 9281 and
{'GPD_Data_'.Saving Accepted ?} in ["13-Itinerary Changed","6-Cancelled"]
then 10
else {'GPD_Data_'.% Charges in GBP}
答案 2 :(得分:0)
使用括号:
If {'GPD_Data_'.Deal No} = [0000,9452] and {'GPD_Data_'.Saving Accepted ?} <> ["1-Accepted","Unknown"] Then
0
Else (
If {'GPD_Data_'.% Charges in GBP} OR ( {'GPD_Data_'.Deal No}= [9281] AND {'GPD_Data_'.Saving Accepted ?} = ["13-Itinerary Changed,6-Cancelled"] ) Then
10
Else
{'GPD_Data_'.% Charges in GBP}
)