Get startedGet started for free

Sets

1. Sets

Welcome back! Now we’re going to create a set. Remember sets are a way to define a subset of the data. It segments data into two: those in the set and those out of the set. To do this, we’ll drag START TIME to the rows and configure it by discrete month. So we have a list of January through June. I’m going to control click January to March, when it’s more cold and windy. This icon represents sets and i can click it to create a set. Once I do this, I get a popup where I can name the set I created. I’ll call it weather. The weather set is now on the Data pane with the set icon to the left of it. And, here we see the IN and Out separation by dragging it into our viz. I can change these names by editing the alias. I’ll call the IN set “Cold & Windy” and the Out set as “Humid & Warm”. This will keep it from coming up as IN and Out which is not informative. And now I can use the Weather set as I wish in my visualization. For example, in this bar chart of the top 15 stations, I can add it to color to see the difference between my two weather types. We can also modify the title on the legend by going to edit title. And I can also edit the members of my set, by right clicking on it. Here I can remove a month, by clicking the red x. I can put i back in the set by going to my original table, selecting that month I just removed. And this time when I click the SET icon, it gives me the option to add to any existing set, including the weather set I created. And now, it’s back! To finish off the chapter, we’ve added an external weather dataset. You can access it here on the top under “Weather Data”. Note how you can toggle to see the fields in your different datasources , in our case the Divvy data and the weather data. In a new sheet, let’s create a viz that uses fields from both data sources. Let’s use the entire view. I’ll add start time to columns and configure it as discrete months. From the weather data source, I’ll drag Temp Avg to Rows. When I do this, I get a warning that i can’t add a Weather field because there is no relationship defined between my two data sources. To fix this, I have to click at least one link icon. What that means is I have to define a linking field. In our case, we want to display the actual weather for the months we have in our Divvy dataset. Hence, we’ll use Months as our linking field. To do this, we simply press this link icon to the right and now we’ll be able to use fields from the Weather source. I’ll change the aggregation from sum to average and display this as a bar chart. Now I have the average temperature for each month in our Divvy dataset. I’ll continue this viz by adding trip count to rows and implementing a dual axis chart. I’m going to keep the temperature average as a bar chart, but have the trip count represented as a line. Now for some finishing touches. I’ll change the opacity of the bar chart to 40% within the color card to better see the line. I’m also going to add my Weather set to Color to denote the different weather conditions. For clarity, I’ll label the bars with the average temperature. Again, I’ll have to change the aggregation from sum to average. And I can configure the color of my labels to automatically “Match the Mark Color” in this dropdown. If I change the colors of the bars, it automatically changes the color of the labels. I’ll do the same for the line graph and add trip count as a label. Again, I’ll change the label color to match the mark color. And now, I have a clearly labelled and colored graph that uses two data sources! Alright, let’s get to some exercises!

2. Let's practice!