Average if channel type statement beast mode
I am trying to create a summary number that takes an average of one customer type and compares it to another.
My code currently looks like
(CASE when `Channel` = 'RET' then SUM(`ordercases`)),' | '
(CASE when `Channel` = 'FSV' then SUM(`ordercases`))
I am having trouble with the syntax. Has anyone had any experience with this?
Update I figured out the code to get it to work
(SUM(CASE when `Channel`='RET' then `ordercases`end)),' | ',
(SUM(CASE when `Channel`='FSV' then `ordercases`end))
Would it be possible to put a custom calculation at the beginning and get it to work too?
The equation I would like to put in front would be sum(case pick)/ sum(order cases) so basically getting an overall average