This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with clean_ads as ( | |
| select | |
| *, | |
| row_number() over (partition by ad_id, date order by timestamp desc) as row_id | |
| from `neksu-496015.homework.marketing_data_session` | |
| ), | |
| monthly_metrics as ( | |
| select | |
| date_trunc(date, month) as campaign_month, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with clean_ads as ( | |
| select | |
| *, | |
| row_number() over (partition by ad_id, date order by timestamp desc) as row_id | |
| from `neksu-496015.homework.marketing_data_session` | |
| ), | |
| max_metrics as ( | |
| select | |
| source, |