• Thanks alot for the input it works but I just noticed that I want to only get the percentages for the Clicks and Conversions and ignore the unsubs and Opens, so for

    ,[% Click] = 100.*COUNT(CASE WHEN [f_action_id]=2 THEN 1 END)/COUNT(*)

    ,[% Conversion] = 100.*COUNT(CASE WHEN [f_action_id]=5 THEN 1 END)/COUNT(*)

    I want to do something like:

    ,[% Click] = 100.*COUNT(CASE WHEN [f_action_id]=2 THEN 1 END)/COUNT( where f_action_id = 2 and 5)

    ,[% Conversion] = 100.*COUNT(CASE WHEN [f_action_id]=5 THEN 1 END)/COUNT(where f_action_id = 2 and 5)

    so the number being divided only includes the count for clicks and conversions

    Can you help me with this?