Episode 4 - Transcript
Episode 4 - Transcript
hey guys and welcome back to the data analyst portfolio project Series in this episode we're going to take the data
that we have worked on so far in our previous episode and build a interactive marketing analytics dashboard using
powerbi if you haven't watched the previous episodes where we covered the introduction data extraction and
cleaning with SQL and sentiment analysis with python make sure to check those out first you can find all the links and
information in the description below let's start pulling some of the data into powerbi and create our data model
measures and build a dashboard together okay so here you guys can see the dashboard that we are going to make
Dashboard Overview
together and just a quick walk through we have a overview page with some numbers conversion data social media
Data customer reviews and some graphs to support that um a detail page on
conversion details social media details customer review details now of course
before we can make any of this we need a data model we need to get these tables
into porbi we have got to make some calculations so we're going to do that
um but we'll take it step by step I'll I'll take you guys through it now remember as you follow along if you
wanted to use different colors different um different graphs different stuff please please feel free there's uh
there's no set you know rigid stuff here I'm just I'm just taking you guys through how how I've done it and and
feel free to to change it up a little bit um let's move this one out of the
way and then we can continue on this one the first thing we have to do is get some data into parbi so we'll go to get
Loading Data
data and then we will go to SQL Server now we're going to pull some data from the same SQL Server that we have worked
on in the previous episode um so my was
this is the name of my um uh my server and you are going to use
the name of your server so I'll just go portfolio project
marketing keting Analytics so that is the server name that is the database
name for reference sake let me show you guys in in SQL Server management Studio
database name server name the ones that you have been doing your queries on top
of we'll click okay um it might ask you to authenticate here just use the same
authentication type that you have used when you go onto your SQL Server most likely you have used Windows
authentication so so just do that um it's going to show these tables so I'm
just going to check them off and show them to you guys before um what they
look like before and after we we we we use the SQL statements that we have created um not going to f fetch the
geography data because if you remember we we get that by combining geography with customers so we'll take all care
take care of all that here in powerbi I'll check those off and I'm going to load those um they're going to be now
loaded in the porbi as is just as the table was in in SQL Ser management
Studio before we did any SQL uh SQL uh queries on top of those so it's going to
fetch those rows in you'll see we get some tables here on the right side we have in the model view you can see that
it has fetched some tables and auto created some relationships we're going to break those later and then fix this
up a little bit um but we'll go to transform data and let me pull that down
one second there we are um um we'll start off with the customer Journey table um I
have the statement up here I'm just going to go and get the SQL statement for that so I will copy um that one and
you know what just to again show you guys this is the statement I just you
know just copy the statement that I need um from for for that table and you can
see here on the right side there's a source and a navigation applied steps um
so I'm doing this just to show you guys before you can see the table it it it isn't it isn't fixed it we haven't
applied our Transformations yet so you can see the NES are there and there's there's other things that you know that
you'll see in the different tables that we'll fix you can see the nulls there the The Columns that we did in cment
analysis are not here um customers is not combined with geography um in the engagement you know
some of the the naming here isn't correct we haven't filtered out newsletter um view clicks combined isn't
split yet so so there are things we need to do um let's start with the customer Journey table so I'm going to remove
this this navigation step um which uh which means that we only have left the
actual query from the database I'm going to go here and then you can see now here I can now go to Advanced options and
then I can paste the statements that we have for this table so when I click okay
it's going to fetch the table again but now it's going to fetch it with the c equal changes that we had in our query
so you can see now the duration is uh is filled out where it was missing and then
you know the it looks you know the the the the Transformations have been applied so that's great we can change
visit dat up here we can change to date if you want you can see there's uh long
decimals you know if you if you uh set this to a fixed decimal number or uh or
if you want to round it to a whole number up to you I'm just going to leave as this it doesn't really make a big difference but w
customer Journey table so the last thing I'm going to do I'm going to go over here I'm going to rename it to fact
customer Journey great we have our first fact table then I'm going to go back up I
have it up here on my screen I'm going to copy the the statement for the the reviews uh I'll copy that I'll go to
customer views I'll remove the navigation click here advanced and I'll
I'll paste the SQL statement there and then it's going to fetch that table and
it's going to fix some of the the places where the review text had double spaces I'll change the review date to date we
have that great let's go to customers you can see no geography
information um let me just do this SQL statement for the customer joint with
the geography data let's go to source Advanced options same thing just copy
paste that you can see now we have the joined the the join table here no dates
nothing that I need to worry about here that's good um before I forget let's rename this one to fact customer
reviews for the sake of showing you guys if I click customers there I can also do it over here dim
customer and then we have we can move that one down so we have the facts and them together um engagement data whe
my statement for that um let me find it Rel products this
is customer Journey customer views um let me
[Music] see did I open it I don't think I've opened it give me one second guys let me
fix this real quick let me see let me see where is
that statement it should open any moment now there we
are this is our engagement data let me get that um remove the navigation step and
then we'll paste this one great now we have that let's just
make sure the ID content ID campaign product okay text this is not a text so
we'll change that to a whole number um clicks we'll change that to a whole
number engagement date we'll change that to a date great we'll change the name to
fact engagement data perfect and then we have at last but not
least we should have our products table let me see if I can find that
statement there we are I'll do the same thing oh oh that
was the wrong one let me get that step back in you can see that I noticed here I removed the wrong Steps From the wrong
table um dim product and then we'll remove the
navigation and we'll change it to advanc and then copy paste the statement for
the products so now we have the different facts the the different
customers um that is great um before I forget we also o need to uh to get some
data from the the spreadsheet or the CSV file that we have um that we created with our
sentiment analysis let me just make sure that I can uh I can find that file so we'll go
to new source CSV and I'll go one
up and then you can see here's the CSV for that one we'll pull that one in um
um it can it understands it's a a comma um separated
table so we'll get that back in there we can drag it up here fact customer reviews with sentiment here the the
spaces have not been removed so I'm going to click this one and this is just an example of you can also do
Transformations and stuff in powerbi but it's best to do it uh on SQL side or in
a transformation tool depending on you know where you work and how things are but but it is
possible to do a lot of stuff here also um I'm going to just click a double
space and then replace it with one space okay and it's going to add that
step there you can see here on the on the right side it adds steps as you do
Transformations um last thing if we hit click sorry close and apply and now you
can see on the right side the table names are going to change and we're going to get the the results from the
Connecting Tables
changes that we have made into PBI when we want to when we want to work on
things um before we can start with the the the calculations um we also need to
go to the model view um let me just delete this ones um because I want to show you guys
how to do this um from the beginning and so that it makes sense for you guys so we'll delete this
let's just do that it is possible to turn off so it doesn't do this automatically for you
for you it's it's in the options um look it up I'm not going to show you guys
right now but we'll take the the customer table the products table and we'll put the dimensions on
top and we'll have these fact tables at the bottom and then we can start to
create relationships so you can see we have customer ID customer ID we'll grab this one and drop I get down there and
now this is important the the the relationship it's a single way and it's
a one to many for for each one entry in the customer's table there are many
entries in the fact table because one customer can have created different rows
in the fact table so it's a one to many so I'll click save on that you can see it's a one number Direction
many um same with customer ID one too
many and then we have do we have custom ID in this one no we don't here we have
custom ID so we'll drag it there same thing one too many then we have product ID let's find
that take the product ID and we'll put it there one too many on that
one then it's a same here one too many on that one um okay so product ID we have in all
tables which means we can connect this Dimension to all of our facts all of our calculations can be filtered on products
is basically what this means um product ID okay
great so um what we are missing though is let me see if I can find it is we
need a date table um so I'm going to uh
show you guys how to do that there is a script for that which will generate a
table for you so what we'll do is we will do a new
table and you can see now it it up here you can add the name so we'll just call it
calendar and then I'm going to paste the script um I'll pause it a little bit if
you guys want to see what the script looks like sorry um or else I'll I'll also make sure I add it in the in the on
GitHub in one of the files there so you guys can also just copy paste it but just to explain what what it does it it
creates a table um where it takes a range of dates which is defined up here
and then it's going to format all those ranges into different types so we have um dat that's in integer year month um
year month number year month short day of week etc etc etc it's going to create
a bunch of columns which you can use to to connect to these tables and then you
have a a date dimension table also so I'll hit enter on
that see we got a calendar here now we have a date we'll take that date let me
find and we'll connect it to visit date same thing there's one date in the
calendar uh table which can connect be connected to many rows with the same date one to many um date to review
date date to engagement date
and at last but not least we have date to review date so now
we have a data model now you can see that we have X number of tables up here which is filtering down on our facts and
the next step is we're going to go back to the report View and we are going to create some calculations so that we can
Next Episode
porbi that's it for our episode on building a marketing analytics dashboard with powerbi in the next episode we're
going to focus on presenting some of the insights using PowerPoint where you'll learn more about how to effectively
communicate your findings to stakeholders make sure to like subscribe and hit the notification Bell so you don't miss any of
series if you have any questions or thoughts then leave a comment below and I will get back to you guys there other
than that thank you guys for watching and I'll see you guys in the next episode