Hi all - I’m new the community. I’m sure this is something simple, but I’m getting stuck.
I have a table calculation I’m trying to run to calculate the conversion rate of Opportunities to Closed/Won opportunities grouped by Created Week.
In SQL this would be done like so:
SELECT
COUNT(DISTINCT CASE WHEN StageName = ‘Closed/Won’ Then Opp.ID ELSE NULL) / COUNT(DISTINCT Opp.ID) AS ‘Opp to Won %’
FROM
Salesforce_Opportunity AS OPP
GROUP BY
Opp.CreatedWeek
But in trying to figure out how to do this in table calculations, I’m getting stuck with figuring out how to do the “CASE WHEN” in a way that doesn’t require me to add the StageName field to the layout (which would be ok, but it throws off the calculation for the CreatedWeek).
Can anyone help, please?
Thanks,
Wyatt