Hi guys,
I hope you are able to help me with the following situation.
Example:
Customer ID1 — Customer ID2 — Status — ..
ABC — DEF — ACTIVE
ABC — GHI — ACTIVE
LMN — OPQ — ACTIVE
LMN — RST — INACTIVE
Basically I have two IDs per customer, I now want to get a COUNT of "active per customer" but ONLY when Status = ACTIVE. My approach was the following:
COUNT(
CASE WHEN `customerstatus` = 'Active' then `jigen_id`
END
)
But I don't get the results I was hoping for.
The results I'm hoping to achieve:
Customer ID1 = ABC shows Count = 2
Customer ID1 = LMN shows Count = 1
If there is any other solution to show me customers with more than one active, I'll take it as well. Doesn't have to be a count/case filter.
Thanks in advance,
cheers