Formula
# how ISIC Industry Sections (left) map to Company Categories (right) isicMap = A: "R" B: "R" C: "M" D: "I" E: "I" F: "I" G: "W" H: "I" I: "O" J: "S" K: "F" L: "I" M: "S" N: "O" O: "O" P: "H" Q: "H" R: "O" S: "O" T: "O" U: "O" # how SIC Divisions (left) map to Company Categories (right) sicMap = E: "I" I: "O" # how Alliance for Corporate Transparency sectors (left) map to Company Categories (right) actMap = "Infrastructure": "I" "Hospitality & Recreation": "O" "Services": "O" # translate lists using maps mappedCodes = (answer, answerMap) -> return unless isKnown answer codes = answer.map (a) -> answerMap[a] codes = codes.filter Boolean return codes if codes.length mappedCodes(isic, isicMap) || mappedCodes(sic, sicMap) || mappedCodes(act, actMap) || "Unknown"