Upload
amit-sharma
View
220
Download
0
Embed Size (px)
Citation preview
8/12/2019 Lab Guide on Calculating Percent Difference in Tableau
1/13
www.bispsolutions.comwww.bisptrainigs.com www.hyperionguru.com Page 1
Getting Started with Tableau
Description:
BISP is committed to provide BEST learning material to the beginners and advance learners. Inthe same series, we have prepared a complete end-to end Hands-on Beginners Guide for TableauThe document focuses on steps involved in creating Calculating Percent Difference AcrossDimensions using Tableau .Join our professional training program and learn from experts.
History:
Version Description Change Author Publish Date
0.1 Initial Draft SurbhiSahu 21stFeb 2014
0.1 Review#1 Sumit Goyal 29thFeb 2014
8/12/2019 Lab Guide on Calculating Percent Difference in Tableau
2/13
www.bispsolutions.comwww.bisptrainigs.com www.hyperionguru.com Page 2
Contents
Calculating Percent Difference Across Dimensions ........................................................................ 3
Data Source as Access ................................................................................................................... 3
Create a view with .................................................................................................................... 11
Add more Dimensions .............................................................................................................. 12
8/12/2019 Lab Guide on Calculating Percent Difference in Tableau
3/13
www.bispsolutions.comwww.bisptrainigs.com www.hyperionguru.com Page 3
Calculating Percent Difference Across Dimensions"What is the rate of change in sales from last year to this year?" We can make these more complexcomparisons using Table Calculations. Table Calculations are computations we apply to thevalues in the entire table, and they are often dependent on the table structure itself.
Data Source as Access
Most database applications store their information in multiple tables , for accessing theinformation of the whole table we have require to access multiple tables.
Suppose we wants to import these tables in our tableau worksheet
In this data model OrderDetail is fact table and Product,OrderHeader and country+ are thedimension tables . And Salescountrycode ,ordercode and productTypeCode is the primary key ofthe table 'Country' ,'Fact_Order' and 'ProductType' table.
Step 1)First choose the data source through which we want to
connect as here Microsoft Access is selected.
8/12/2019 Lab Guide on Calculating Percent Difference in Tableau
4/13
www.bispsolutions.comwww.bisptrainigs.com www.hyperionguru.com Page 4
Step 2)Then browse for the
location of the access file
then click on open.
Step 3)This will explore all the
tables so first select a single
table, which will be fact table
Step 4)Thencheck the Multiple Tables option.
By using this option we can import
multiple table in our tableau workbook .
8/12/2019 Lab Guide on Calculating Percent Difference in Tableau
5/13
www.bispsolutions.comwww.bisptrainigs.com www.hyperionguru.com Page 5
Step 5)Click on Add Table, this will
explore all the table except the
OrderDetailwhich has already
being selected.
Step 6) Then select the table product
here all the fields of product will
explore, we can remove any field bydeselecting from Table Fields. For
create join click on the Joinoption.
Step 7) Select the common field from both table and create join between them by pressing Addbutton After click on the Add Tablebutton the join statement will be created between theproductnumber of the product and productnumber of the orderdetail table. In the table product
productnumber is the primary key but in orderdetail table I will act as a foreign key.
8/12/2019 Lab Guide on Calculating Percent Difference in Tableau
6/13
www.bispsolutions.comwww.bisptrainigs.com www.hyperionguru.com Page 6
Step 8)Here three joins are available Inner join ,Left join andRight join.
8/12/2019 Lab Guide on Calculating Percent Difference in Tableau
7/13
www.bispsolutions.comwww.bisptrainigs.com www.hyperionguru.com Page 7
Step 10) Then the product table
will be add with orderdetail table. To
add more table click on Add Table
Button.
Step 11) This will explore all the table ,select the table orderheader for import .
Step 12) Now create the
join between the tables
Oderdetail and order header
viaordercode as a
common field.
8/12/2019 Lab Guide on Calculating Percent Difference in Tableau
8/13
www.bispsolutions.comwww.bisptrainigs.com www.hyperionguru.com Page 8
Step 13) Now the table orderheader
will added in relation ship with
orderdetail For adding more
table click on the button
Add Table.
Step 14 ) This will
explore all the table,select the table
whichwe want to
import so choose
the table
country_salesbranch
and create the join
using
salesbranchcode
which is similar inboth of the table.
Then create a join
by using Add
button.
8/12/2019 Lab Guide on Calculating Percent Difference in Tableau
9/13
www.bispsolutions.comwww.bisptrainigs.com www.hyperionguru.com Page 9
Step 15) Here the three tables
Orderdetail
, country_salesbranch
Orderheader and product will
Added in the connection.
Step 16)This is the query
executing implicitly in tableau.
8/12/2019 Lab Guide on Calculating Percent Difference in Tableau
10/13
www.bispsolutions.comwww.bisptrainigs.com www.hyperionguru.com Page 10
Step 17)Tableau ask for the connection
choose the connection Connect live.
Step 18) Now all the table imported in Tableau and Dimensionand Measure will be automatically separate by tableau itself.
8/12/2019 Lab Guide on Calculating Percent Difference in Tableau
11/13
www.bispsolutions.comwww.bisptrainigs.com www.hyperionguru.com Page 11
Create a view with
Step 19)
From the Dimensions pane, drag Region to the Columns shelf.
Step 20)
From the Measures pane, drag Sales to the Columns shelf.
Step 21)
On the Columns shelf, right-click Sales and select Quick Table Calculation > Percent Difference.
Step 22)
Right-click Sales again and select Edit Table Calculation.
8/12/2019 Lab Guide on Calculating Percent Difference in Tableau
12/13
www.bispsolutions.comwww.bisptrainigs.com www.hyperionguru.com Page 12
Step 23)Select First in the Display the current value as a percentage option in table Calculation dialog box
Now the view shows the percent difference from the North Region. We can see that the sales in theSouth are 22% lower than sales in the North.
Add more Dimensions
Now consider a more complex comparison in which we want to see how products have sold ineach region.
Step 24)
From the Dimensions pane, drag Product -Category to the Rows shelf.
We can see the percent difference from sales in the region for each product category. The eastregion shows zero values because it is the "First" value that all other regions are compared to.
8/12/2019 Lab Guide on Calculating Percent Difference in Tableau
13/13
www.bispsolutions.comwww.bisptrainigs.com www.hyperionguru.com Page 13
Step 25)
Heres thefinal chart prepared which gives the comparison on product category sales region wise.