I want to get count of values in a column based on a condition for another column:
Example:
Count(Distinct 'visitor_id' ) where visitor_called = 'Y'
The above give me a syntax error.
Trying with 'Case':
(CASE
WHEN `visitor_called` = 'Y' then COUNT(DISTINCT `visitor_id`)
else '0'
END
)
This returns me overall counf for distinct visitor ID but not for condition specified.
Any help would be appreciated.