'BigQuery - Count Unique Events Within 7 Days of Date

Fiddle

What I hope to achieve is a query which will count how many unique campaigns exist within 7 days of the current campaign (including itself). In the fiddle I've manually added a column to show what the output should be, but how would I generate the column Sent_Within_7_Days using the Send_Date and Campaign columns?

I've tried using a mix of a window statement mixed and case statement but no dice.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source