User Tools

Site Tools


advanced_transformations:renaming_medium

How to rename medium or other columns

Sometimes the medium column needs to be renamed because the revenue and the spend do not match. Here we see an example for snapcht.

1. For this we need to rename the column so we click “Explore data”

2. Then we click “Edit dataset”

3. Then we click “Calculated Columns” and edit the case statement for Medium

In this case we add the rule for snapchat:

WHEN source='snapchat' THEN 'paid_social' 

So the whole Expressions looks like:

Case when (source='facebook' and (medium='cpc' OR medium='Unknown')) THEN 'paid_social' 
WHEN source='criteo' THEN 'retargeting' 
WHEN (medium='Unknown' AND totalcost > 0) THEN 'cpc'
WHEN source='snapchat' THEN 'paid_social' 
ELSE medium END

4. Then we save and re-run the query and make sure its not coming from cache and then we have spend and revenue for snapchat on the same row and a multi-touch attributed ROAS.

advanced_transformations/renaming_medium.txt · Last modified: 2021/09/01 09:33 by windsor_ai