如果和Contains Statement合并

时间:2013-12-18 22:27:23

标签: tableau

我有一个记录成功或失败的维度。我想从这个字符串中创建每个(成功和失败计数)的度量。我尝试创建一个计算字段但不确定发生了什么:(IF CONTAINS ([RESULT], "success") THEN "Success" ELSE "" END)。以下是示例数据:

Failure-2DispIn90Or0-Transfer   206
Failure-AcctOverDue-Transfer    625
Success-AppointConfirmMenu  738
Success-ApptFoundReview 1384
Success-Balance Playback    330
Success-BalanceDown 352
Success-FAQ Copy Playback   164
Success-FileAClaimMenu  570
Success-General FAQ Playback    388
Success-GetDispatchByContract Module    15247
Success-Move to Balance Menu    1830
Failure-ValidateContractEntry-Balance-Transfer  162
Failure-ValidateContractEntry-Claims Status-Hang Up 73
Failure-ValidateContractEntry-Claims Status-Normal  22
Failure-ValidateContractEntry-Claims Status-Transfer    170
Failure-ValidateContractEntry-Contract Status-Transfer  131
Failure-ValidateContractEntry-Schedule a Repair-Hang Up 441
Failure-ValidateContractEntry-Schedule a Repair-Transfer    1236
Failure-ValidatePhone Entry-Balance-Hang Up 208

1 个答案:

答案 0 :(得分:2)

您可以选择以下内容:

成功/失败:

IF STARTSWITH([Result],"Successs") = true THEN
    "Success"
ELSEIF STARTSWITH([Result],"Failure") = true THEN
    "Failure"
ELSE
    Null 
END

按新计算字段为标记着色。