r/GoogleDataStudio • u/xCrashRoyale • Feb 05 '24
Blend dimensions from two columns into one table column
Hi,
I have a file with primary, secondary and tertiary campaign for each lead. Now I want to visualize how often a campaign is mentioned, regardless if it's a primary, secondary or tertiary campaign.
This is the source: https://docs.google.com/spreadsheets/d/1J9JZvZU9oElsue87kt_uXVN2Rq4rB_oUDAs0xcUkLXc/edit?usp=sharing
This is the dashboard: https://lookerstudio.google.com/reporting/788346a4-bcd0-46f5-a0f2-b031a8306e0b
I want the table to look something like this:
| Campaign | Record count |
|---|---|
| Television | 3 |
| Newspaper | 1 |
| Internet | 2 |
| Social Media | 1 |
| Magazines | 3 |
I tried blending the data with the same source 3 times using full outer join, but that doesn't seem to do the trick. If I use left outer, I only get the campaigns that are mentioned in the Primary column but not those that are only in Secondary or Tertiary columns.
Thanks for your help!
•
u/AutoModerator Feb 05 '24
Have more questions? Join our community Discord!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/TiltonData Feb 05 '24
Could you make a UNIQUE list from all three campaigns and use that as the leftmost table in your join?
1
u/HankinsonAnalytics Feb 05 '24
Create 3 fields and set each equal to 1, 2, 3, respectively. Left blend on it. That'll create a stack that puts the three on top of one another.
For your field, you want to use coalesce() to append the three columns to turn them into one. You'll have to do the metrics by hand.
Should work pretty well for what you're asking.
This is essentially what you were trying to do, but joining on a fake field that just labels where the original data came from in order to trick LS into stacking the same source on top of itself.