Skip to playerSkip to main contentSkip to footer
  • 5/9/2025
Transcript
00:00So now we're going to go through the solution walkthrough for the Connecting to Data homework.
00:04First up, we need to connect to our data source.
00:07So let's go ahead and choose Connect to Data.
00:09We're going to go down to a text file.
00:12We'll navigate to our homework number one Connecting to Data data source,
00:16and we'll choose one of our World Happiness data sources.
00:20For now, we'll click on 2020 and choose Open.
00:23Next up, we're going to want to union all of those data sources that we saw in the folder together.
00:28So we'll go over to Multiple Files, and we're going to choose Wildcard Union.
00:34We're going to want to search in our homework one Connecting to Data directory.
00:37We don't need to include subfolders because there are none.
00:41We're going to include our files, and we could do a matching pattern here,
00:46or we could just choose all of our files by choosing blank.
00:50Now, it depends where you've saved the file to,
00:52but if you're going to do a matching pattern, you could choose World Happiness,
00:57and put an asterisk at the end, hit Enter, and it will include all of our files.
01:03We're going to go ahead and hit Apply so that all of our files are unioned in,
01:07and you'll know that that worked based on our file paths being added down at the bottom.
01:12This is a new column that we can use to filter our data later on.
01:16Next, we're going to go to our Data Sample and Customize that.
01:21For this option, we're going to go ahead and choose Use All Data,
01:24because we want to use all of the data inside our flow.
01:27We don't want to do any sampling.
01:30Now, our data is small enough that this won't matter much,
01:32but if we were using a larger data set, you may not want to use this option.
01:37Next, we're going to limit the number of fields that we're bringing in,
01:40because we do have quite a bit over here on the right-hand side.
01:43We have 43 fields available, so we're going to cut that down.
01:48Let's go ahead and deselect all of our fields
01:50and just add those that we need for the rest of the flow.
01:54We're going to click on Country, Region, Happiness Rank, Happiness Score, Overall Rank.
02:02There we go.
02:03Then we're going to want Ladder Score and File Paths.
02:07Again, we want File Paths so that we can determine which data source we're pulling from,
02:12and we can use this year to parse that out as a separate field later.
02:17Next up, we're going to change a data type.
02:20So instead of Happiness Rank being a number whole,
02:23we're going to change that over to be a string value,
02:26and then we're going to go ahead and change our Overall Rank field to be named something else.
02:31Let's go ahead and change it to Overall Happiness Rank.
02:38And we've done that just by double-clicking inside our Name field
02:41and hitting Enter once we've renamed.
02:44Next, we're going to apply a filter on this data source.
02:48So we're going to hit Filter Values at the top.
02:50So we're going to go ahead and filter out any data that is less than 7.
02:55We want to find the happiest places,
02:58so we're going to apply this filter to only choose those that have a 7 out of 10 or greater.
03:04So to do this, we'll just type in Happiness Score, hit Enter.
03:09We're going to say greater than 7.
03:12So now this is a Boolean field.
03:14It's only going to filter to the true values and include those in the flow going forward,
03:19and that will only be those for the Happiness Score that is greater than 7.
03:24Let's go ahead and hit Save,
03:27and our calculation will be applied to filter our data down.
03:30Next, we're going to refresh our data just in case we had anything added to our directory.
03:36We're going to do that by going up top and just choosing Refresh Data.
03:41You'll notice that we don't have the same drop-down that we saw before in our prior lesson,
03:45and that's because we only have one source here available.
03:48So just to recap, we've completed all of our changes.
03:51We've removed fields, changed our data types, renamed our fields, applied filters,
03:58done a wildcard union, and chose not to sample our data.
04:04All right, that's looking good.
04:06Hopefully you had fun in this homework.
04:09Next up is our section on examining and filtering our data.
04:13We'll see you next time.
04:14We'll see you next time.
04:15We'll see you next time.
04:16We'll see you next time.
04:17We'll see you next time.
04:18We'll see you next time.
04:19We'll see you next time.
04:20We'll see you next time.
04:21We'll see you next time.
04:22We'll see you next time.
04:23We'll see you next time.
04:24We'll see you next time.
04:25We'll see you next time.
04:26We'll see you next time.
04:27We'll see you next time.
04:28We'll see you next time.
04:29We'll see you next time.
04:30We'll see you next time.
04:31We'll see you next time.
04:32We'll see you next time.
04:33We'll see you next time.
04:34We'll see you next time.
04:35We'll see you next time.
04:36We'll see you next time.