SQL case when using multiple fields with same value
I'm trying to build a pivot table that will aggregate year to date revenue and funding against each of our key accounts. The problem is that the key account name could be in the ultimate parent, customer or opportunity funder field in the report depending on the relationship it has to each opportunity.
I've used a spare column to write the following formula:
CASE WHEN "- Opportunity Custom Attributes".TEXT_20 = 'KEY ACCT NAME 1' OR "- Opportunity Custom Attributes".TEXT_14 = 'KEY ACCT NAME 1' OR Account."Parent Account" = 'KEY ACCT NAME 1' THEN 'KEY ACCT NAME 1' ELSE NULL END