I’m trying to insert a field filter to the following query so that I can filter by Name. It looks like the variable in this instance does not work on the joined table “salesforce.user d”. I’ve tried multiple options but I can’t make it work. For context, the “Name” field is coming from the “salesforce.user d” table.
Would love to know if anybody has any clue on how to make it work?
b.name AS “Account Name”,
b.company_tier_c AS “Company Tier”,
b.account_mrr_c “Current Account MRR”,
b.last_contract_end_date_c AS “Contract End Date”,
DATEDIFF(days,b.last_contract_end_date_c, CURRENT_DATE) AS “Days Before Contract Ending”,
c.balance/100 as “Available Content Balance”,
FROM salesforce.account_team_member a
LEFT JOIN salesforce.account b
LEFT JOIN contently_public.brand_profiles c
LEFT JOIN salesforce.user d
AND b.type = ‘Brand / Division’
AND a.team_member_role = ‘Account Manager’
Looking forward to your help,