Nested UPDATE statement not populating column

I am trying to update a dataflow with MySQL. I have a report being  pulled into DOMO from Salesforce and I altered it as follows:

 

  1. connected Salesforce report to DOMO
  2. Used ETL to filter the data into five buckets. (Marketing Channels)
  3. Created a new column: 'Sub Channel' - value: NULL
  4. Output as its own ETL dataflow

I am using SQL to update the Sub Channel Column based on which marketing channel each lead belong with. From there I want to update the Sub Channel column based on the campaign. 

 

My code is as follows:


DOMO code.PNG

 

I had it working previously, but now I can't remember why it is not working anymore. I tried setting the Sub Channel column to empty string and NULL, but neither populate the column with values.

Comments

  • I try to avoid nesting case statements if I can.  

     

    Have you tried something like this instead?

     

    CASE 

        WHEN `Marketing Channel` = '1. Event' AND `Primary Campaign`='TS-2018 HIMSS' THEN 'HIMSS'

        WHEN `Marketing Channel` = '1. Event' AND `Primary Campaign`='TS-2018 MGMA' THEN 'MGMA'

    ... etc.