Hi guys! I might have a silly question, but can’t fina an answer…
I have data in csv file similar like this:
date | ad_network_id | ads_impressions| ads_revenue | ecpm
----------------------------------------------------------------
2021-12-20 | 10 | 2343 | 543.15 | 5.4
2021-12-20 | 10 | 3453 | 343.12 | 3.1
2021-12-20 | 10 | 12543 | 353.9 | 8.1
date is timestamp
ad_network_id is long
and then we have metrics:
ads_impressions as longSum
ads_revenue as doubleSum
My problem is ecpm… how ecpm can be a metric if I want it to be weighted by impressions?
Like: ecpm = ecpm*ads_impressios/total_impressions
After rollup I want my data to look like this:
__time | ad_network_id | ads_impressions| ads_revenue | ecpm
----------------------------------------------------------------
2021-12-20 | 10 | 18339 | 1240.17 | 6.8136
In this example ecpm formula:
ecpm = 5.4*2343/18339 + 3.1*3453 /18339 + 8.1*12543 /18339
How can I make this kinda metric rollup? Any advice would be appreciated
Thank you