Hello, I’m basically calculating a column based on a string that can have a small variance , thus the use of OR statement. the issue I have is that this formula might grow overtime and I want to make sure I can simplify it with perhaps the use of a variable or nested statements , something that could make this future proof or at least less convoluted.
here’s a little sample and thanks btw!
POD# =
SWITCH(TRUE(),
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 01"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod01")))),"OPOD 01",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 2"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod2")))),"OPOD 02",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 3"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod3")))),"OPOD 03",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 4"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod4")))),"OPOD 04",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 5"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod5")))),"OPOD 05",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 6"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod6")))),"OPOD 06",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 7"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod7")))),"OPOD 07",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 8"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod8")))),"OPOD 08",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 9"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod9")))),"OPOD 09",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 10"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod10")))),"OPOD 10",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 11"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod11")))),"OPOD 11",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 12"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod12")))),"OPOD 12",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 13"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod13")))),"OPOD 13",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 14"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod14")))),"OPOD 14",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 15"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod15")))),"OPOD 15",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 16"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod16")))),"OPOD 16",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 17"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod17")))),"OPOD 17",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 18"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod18")))),"OPOD 18",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 19"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod19")))),"OPOD 19",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod 20"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"opod20")))),"OPOD 20",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod 1"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod1")))),"MPOD 01",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod 2"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod2")))),"MPOD 02",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod 3"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod3")))),"MPOD 03",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod 4"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod4")))),"MPOD 04",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod 5"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod5")))),"MPOD 05",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod 6"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod6")))),"MPOD 06",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod 7"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod7")))),"MPOD 07",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod 8"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod8")))),"MPOD 08",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod 9"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod9")))),"MPOD 09",
CALCULATE(OR(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod 10"),(CONTAINSSTRING(SELECTEDVALUE(PODs[POD]),"mpod10")))),"MPOD 10",
"Other")