Exclude Statement for Query
I have a database that contains data by session:
Fall I 2010
Fall II 2010
Spring I 2010
Spring II 2011
Summer 2011
Fall I 2011
I have no trouble writing a query in order to collect all of the data by session and then of course grouping it by say website or market and I even know how to write a query to create a formula such as "clicks/impressions" = CTR. It's all great.
EXCEPT....I want to be able to group the first five listed above to give myself totals and to give myself an accurate CTR. I know this sounds slightly confusing, BUT...in order to get an accurate CTR I have to take TOTAL CLICKS / TOTAL IMPRESSIONS. Which is easy if I eliminate the "Session" field from the query. My problem is that I want to get one chart that totals up the clicks for the first five sessions and divides it by the total impressions for the first five sessions. Then I want another chart that takes the 6th session and gives me the total clicks divided by the total impressions.
Is there a way to do this? My problem is that if I place the session as a field in the query, and then I try to filter my CTR is instead a SUM or AVE of the five CTR's (each session).
I didn't know if it was possible to write a Query that "excludes" any session values. Ideally I could create a SQL query that doesn't place "session" as a field, but instead I could write the query to not calculate the information in any rows with a particular "session" in them.
Any help you can offer would be greatly appreciated.
Thanks,
Jamie