WhiteRider wrote:Generally you want your column expression to be of the form "sum(if[ <expression>, 1, 0 ])" when you're counting the number of times a situation occurred.
By this WhiteRider meant something like:
sum(if[substring(cash_hand_summary.str_aggressors_p from 2 for 1)::int != substring(cash_hand_summary.str_actors_p from 1 for 1)::int AND lookup_actions_p.action LIKE 'C%' , 1, 0])
This as written will add 1 each time the expression is true and 0 each time it is false. Though I think you want more than this - as it is all you're checking is that the first aggressor wasn't the first actor (so there were some limpers), and your first action was to call. Nothing is specified about whether you face a raise (or limp), or anything else for that matter.