1

谁能帮助我在 Informatica PowerCenter 中的表达式转换中编写以下案例语句?

Case      When STATUS_REASON_CODE in ( 'BI Complete' , 'BI Updated', 'BI Complete') and Outcome__c is null and BI_Outcome__c is null then 'PA Required'
              when STATUS_REASON_CODE in ( 'BI Complete' , 'BI Updated', 'BI Complete') and Outcome__c is null 
                                      Then Decode (BI_Outcome__c, 'PA Appeal Pending', 'PA Appeal Required','PA Pending','PA Required',BI_Outcome__c)
                when  STATUS_REASON_CODE in ('PA Appeal Approved', 'PA Approved') and Outcome__c is null  Then 'Approved'
                  when  STATUS_REASON_CODE in('PA Appeal Denied', 'PA Denied') and Outcome__c is null  Then 'Denied'
                  when Outcome__c='PA Pending' then 'PA Required'
                  When Outcome__c='PA Appeal Pending' then 'PA Appeal Required'
                   when  STATUS_REASON_CODE in ('PA Appeal Approved', 'PA Approved') and Outcome__c is null  Then 'Approved'
                  when  STATUS_REASON_CODE in('PA Appeal Denied', 'PA Denied') and Outcome__c is null  Then 'Denied'
         else Outcome__c end
4

2 回答 2

1

我根本看不到任何问题。在我看来,这似乎是嵌套的 if-else 语句。您可以使用以下指南实现自己 -

 IIF ( IN(STATUS_REASON_CODE,'BI Complete' , 'BI Updated', 'BI Complete' ) AND and Outcome__c is null and BI_Outcome__c is null, 'PA Required',
  IIF (STATUS_REASON_CODE in ( 'BI Complete' , 'BI Updated', 'BI Complete') and Outcome__c is null , 
   IIF(BI_Outcome__c = 'PA Appeal Pending', 'PA Appeal Required', 
    IIF(BI_Outcome__c = 'PA Pending','PA Required',BI_Outcome__c)...

当然,这并不完整,您需要完成它。这看起来很复杂,但并非不可能。

于 2019-12-27T11:58:08.500 回答
0

嵌套 IIF 是一种选择 - 为了便于阅读,我更喜欢使用 DECODE,例如:

DECODE(True,
    Condition_1, Value_1,
    Condition_2, Value_2,
    ....
Default)

因此,在您的情况下,这将像这样开始:

DECODE(True,
    IN(STATUS_REASON_CODE,'BI Complete' , 'BI Updated', 'BI Complete' ) AND and Outcome__c is null and BI_Outcome__c is null, 'PA Required',
    STATUS_REASON_CODE in ( 'BI Complete' , 'BI Updated', 'BI Complete') and Outcome__c is null, ....
    ...
    )
于 2019-12-31T15:30:05.793 回答