A beast mode where sum is greater than X

kivlind
kivlind Contributor

Trying to create a Beast Mode where I count distinct customers who have spent more than $100. The issue is I need to sum the revenue amounts because customer spend amounts cross many rows, so looking at just one row won't do it. 

 

Something like:

 

COUNT(DISTINCT
(CASE

when sum(`revenue` > 100) then `customernbr`
-- else 0
End)
)

 

Statement works without the 'sum', but I need to look at multiple rows of data to see where customers have in aggregate spent more than $100.

 

Hopefully this makes a lick of sense. 

 

Regards,
DK

Comments