Unioned data
1. Unioned data
In this video, we’ll cover one method of combining data sets in Tableau and how to handle calculations across both those data sets. Let’s start by opening one of the two data sets, paid search data. Now let’s add another data set, paid social data, to our workbook. Here under ‘connections’, we can see both are included. But how do we combine them into one? If we drag paid social next to paid search, we can see that a connection is formed - but Tableau isn’t sure how these two data sets relate to one another. So below, we specify what two fields are related, as well as how they’re related. In this case, our data sets contain a number of fields that are equal, such as ad group, landing page, spend, and date. We need to specify that in the case of each field that the two data sets share. Depending on how your data is stored - a union like this one in Tableau may be a common way of combining data sets at your company. Every field that the two sets share needs to be specified in the data source pane. We notice that we now have two separate tables on the left: one from our paid search data and the other from paid social. Also - in the case of our paid social data, the second table we added, fields that are shared between both paid search and paid social, such as ad group and spend, have a parenthetical note to specify when they’re from the paid social data set. Let’s try building a calculated field across both tables in the unioned data set. If I look at spend for paid search and spend for paid social, I see the two values separately: But can I build a field, Total Spend, that uses both of them? Let’s try: Yes - the union has worked - and we can see that our new ‘total spend’ field has correctly added spend from both paid search and paid social. What about in the case of qualitative fields like Ad Group? In the case of paid search we see the keyword, match type, and whether the ad was desktop or mobile: while for paid social, ad group only consists of whether the ad was desktop or mobile: To combine these string fields, we can use an IFNULL function, instructing Tableau to use one Ad Group field, and switch to the other if the first is null: We can see if the field works correctly by dragging it into the sheet and adding both spend fields from their respective tables: And we can see that both paid search and paid social ad groups show up in our table. Ok! Now that you’re more familiar with working with unioned data, let’s progress to our final set of exercises and see how they’re used in calculating the LTV/CAC ratio.2. Let's practice!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.