Forum Discussion
Saxon10
4 years agoPost Prodigy
Switch multiple condition for multiple columns
I have 5 columns are A,B,C,D and type. Those 5 columns are contain number and text or number or text. If column A&B and C&D are matched then return "Ok" and if column A&B and C&D are not matched ...
- 4 years ago
Saxon10 Give this a try
Result2 = VAR AB = [A] & [B] VAR CD = [C] & [D] RETURN SWITCH ( TRUE(), AB = CD, "OK", [TYPE] = "TT","XX", [TYPE] = "AA","X1", [TYPE] = "BB","X2", [TYPE] = "PR","X3", (ISBLANK ( AB ) || AB = "" ) && ( ISBLANK ( CD ) || CD = "" ), BLANK (), (ISBLANK ( AB ) || AB = "" ) || ( ISBLANK ( CD ) || CD = "" ), "A1", "NO" )All my results match your deisred result column.
jdbuchanan71
4 years agoSuper User
Saxon10 Give this a try
Result2 =
VAR AB = [A] & [B]
VAR CD = [C] & [D]
RETURN
SWITCH (
TRUE(),
AB = CD, "OK",
[TYPE] = "TT","XX",
[TYPE] = "AA","X1",
[TYPE] = "BB","X2",
[TYPE] = "PR","X3",
(ISBLANK ( AB ) || AB = "" ) && ( ISBLANK ( CD ) || CD = "" ), BLANK (),
(ISBLANK ( AB ) || AB = "" ) || ( ISBLANK ( CD ) || CD = "" ), "A1",
"NO"
)
All my results match your deisred result column.
Saxon10
4 years agoPost Prodigy
Thank you so much for your help and solution.