MySQL - Creating new column via LEFT JOIN

keeeirs10
keeeirs10 ⚪️
edited January 12 in Dataflows

Hello!

I am having trouble creating a new column (Dummy) to identify rows that I need to remove from my output in MYSQL dataflow (Beginner at using Domo). The query is valid, but when the output is produced, the column "Dummy" does not appear in the dataset. See below.

SELECT

A.`Posting Title`,

A.`Weekly Reporting Date`,

A.`Weekly Report Stage`,

A.`Funnel Stage`,

A.`Candidate Link`,

A.`Origin`,

A.`Department`,

A.`Days in Stage`,

A.`Days to Hire`,

A.`Days to Archive`,

A.`Offer Acceptance Date`,

A.`Candidate Journey Start Date`,

A.`Event Date`,

A.`Previous Event Date`,

A.`Previous Opportunity Stage`,

A.`Candidate Name`,

A.`Hiring Manager`,

A.`Posting Created Date`, 

A.`Owner`,

A.`Posting Country`,

A.`Posting Location`,

A.`Team`,

A.`Posting Status`,

A.`Archive Reason`,

A.`Candidate Email`,

Bad.`Dummy`

FROM `lever_weekly_khtest` AS A

LEFT JOIN (SELECT `Candidate Name`,

      "Remove" AS Dummy

      FROM `lever_inactive_report`

      WHERE `Candidate Name` IS NOT NULL) AS Bad

      ON A.`Candidate Name` = Bad.`Candidate Name`

      WHERE Bad.`Dummy` IS NULL;


Thank you! :)

Best Answer

  • keeeirs10
    keeeirs10 ⚪️
    Answer ✓

    UPDATE: I am in fact a Dummy because I was selecting the wrong transformed dataset in my output. All is well, and the column is now appearing!

Answers

  • GrantSmith
    GrantSmith Indiana 🥷

    Hi @keeeirs10

    Is this query being done in your output section or as a transform?

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • Thanks for the input Grant! See above for the solution lol.