Hi
I got a data source with campaign data. Every row represents data from one day for one campaign, e.g.:
Date | Campaign | Impressions
===============================
01/23/2019 | Campaign 1 | 1200
01/23/2019 | Campaign 2 | 80
01/24/2019 | Campaign 2 | 210
What I really need is the campaign impressions grouped by weeks to display it within different klips of my dashboard. With the example above it would something like:
Week | Campaign | Impressions
===============================
2019-04 | Campaign 1 | 1200
2019-04 | Campaign 2 | 290
I tried to create a modelled data source based on the original data source that groups the campaigns on a weekly basis but couldn't achieve it. That's what I tried so far:
- Create a new column for a "grouping key" consisting of the week of year and campaign name (e.g. "2019-03-Campaign 1"):
CONCAT(DATE_CONVERT(@Sheet1,A:A;,"dd-MMM-yy","YYYY-ww"),"-",@Sheet1,B:B;) - Group campaign column by this newly created key:
GROUPBY( CONCAT(DATE_CONVERT(@Sheet1,A:A;,"dd-MMM-yy","YYYY-ww"),"-",@Sheet1,B:B;), @Sheet1,B:B;, "first(values)" ) - Group impressions column by this newly created key:
GROUPBY( CONCAT(DATE_CONVERT(@Sheet1,A:A;,"dd-MMM-yy","YYYY-ww"),"-",@Sheet1,B:B;), @Sheet1,C:C;, "sum(values)" )
Can someone help me with getting a modelled data source that groups campaigns by week of year? Perhaps there's another solution than a data source but I'd really like to re-use the data because I need it in multiple klips.
An additional question: can I sort a modelled data source by a specific column?
I didn't find any possibility so far...
Thanks a lot!