User Tools

Site Tools


advanced_transformations:renaming_medium

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

advanced_transformations:renaming_medium [2021/09/01 09:33] (current)
windsor_ai created
Line 1: Line 1:
 +====== 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.
 +
 +{{:advanced_transformations:medium_for_snapchat_not_matching.png?1000|}}
 +
 +
 +1. For this we need to rename the column so we click "Explore data"
 +
 +{{:advanced_transformations:2021-09-01_11-17.png?1000|}}
 +
 +2. Then we click "Edit dataset"
 +{{:advanced_transformations:2021-09-01_11-21.png?1000|}}
 +
 +3. Then we click "Calculated Columns" and edit the case statement for Medium
 +
 +{{:advanced_transformations:2021-09-01_11-25.png?1000|}}
 +
 +In this case we add the rule for snapchat:
 +
 +<code>WHEN source='snapchat' THEN 'paid_social' </code>
 +
 +So the whole Expressions looks like:
 +<code>
 +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
 +</code>
 +
 +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:2021-09-01_11-31.png?1000|}}
  
advanced_transformations/renaming_medium.txt ยท Last modified: 2021/09/01 09:33 by windsor_ai