Friday, 27 October 2023

Execution of Filters in Tableau

Tableau Follows the below sequence(Precedence) while performing multiple filters.


1)  Extract Filters

2) Data Base Filters

3) Context Filters

4) Dimension Filters

5) Measure Filters

6) Table Calculation Filters


If we use Context Filters on any of the Dimension then it execute first then other filters those exist in the current visualization, i.e. 

Context Filter is independent & this one execute first then followed by the sequence which specified above.

Thursday, 15 June 2023

Connecting to the Database - Tableau

 Defining relationships among the tables and applying filter.

a. Open the Tableau Software by double click on Tableau Software Icon.
b. Connect to the Data Base,
c. Drag required tables in to right panel like the below figure. In this Example Orders, People, Return tables are selected for reporting.
d. Tableau Engine defines the Relationships automatically. Although we can also define our own relationships.(IT IS EQUALENT TO V-LOOKUP INEXCEL)




e. And we can apply the filter before we connect to the work area.
Click on Filters which is located on top right side.
 f. Click on add, in the following example We are applying filter on field “ Market” & select “Central” & “West”.
Central” & “West” markets only available to the report since we applied Data source filters.
g. After apply the filter, click on go to work sheet.
h. Drag Market, Product fields onto row shelf, sales onto column shelf.

Modifying Data source filters:
1) Right click on Data source.

2) Now we can modify filter here as we want. In this example we are adding one more filter on “Product Line” column.
--------------------- -----------------------
File Extensions in the Tableau

Workbooks (.twb) – Tableau workbook files have the .twb file extension and are marked with the workbook icon. Workbooks hold one or more worksheets and dashboards.

• Bookmarks(.tbm) – Tableau bookmark files have the .tbm file extension and are marked with the bookmark icon. Bookmarks contain a single worksheet and are an easy way to quickly share your work.

• Packaged Workbooks (.twbx) – Tableau packaged workbooks have the .twbx file extension and are marked with the packaged workbook icon. Packaged workbooks contain a workbook along with any supporting local file data sources and background images. This format is the best way to package your work for sharing with others who don’t have access to the data.

• Data Extract Files (.tde) – Tableau data extract files have the .tde file extension and are marked with the extract icon. Extract files are a local copy of a subset or entire data source that you can use to share data, work offline, and improve database performance.

• Data Connection Files(.tds) – Tableau data connection files have the .tds file extension and are marked with the data connection icon. Data connection files are shortcuts for quickly connecting to data sources that you use often.



Performance Improvement in Tableau


To improve performance of the Tableau Dashboards we can implement the following approaches.


. Push complex calculation to the Database.

. Use materialized views in the Database.

. Create indexes in the Database.

. Use extracts along with the filter out unwanted data.

. For each filter a separate query is created by Tableau, so use less number of filters.

. Data cleansing at database level is better than at Tableau.

. Boolean Data type are faster than String & Date calculations, if possible use Booleans in the calculations .

. If we want to show multiple measure values then use parameters to dynamically select the

        measure values, it improves the performance over showing all measures at a time.

. Adding context filters to the workbook will degrade performance,

        since if any change takes place in the database, it will update the views in the tableau by
        computing the calculations again can lead to reduce the performance of Dashboard.

. Enable show relevant values for Quick Filters.

. If we are creating very complex calculations, First create sub calculations then call them into main calculations.

. Applying filters on multiple sheets generate multiple queries, so apply wherever it is required.

. Use Continuous date filters improves performance over Discrete Date filters.

. Remove unused databases, fields, sheets, dashboards, Filters, Calculations.

. Grouping functionality loads the entire data, for performance points of view Use Case statements or sets instead of groups.

. Native Database drivers than ODBC.

. Avoid using Custom SQL.

. Case is faster than if then else.

. Convert the Date field from raw string to the string or number.

. Limit the number of filters showing on the view for space constraint and for performance improvement.

. Reduce the number of marks on the views.

. Turn off Automatic updates, like update filter values, Pass Auto Updates.

. Better to use Include filter than exclude. And use continuous data filters rather than discrete.

Wednesday, 14 June 2023

Creating different kind of basic Visualizations in Tableau

We use charts to convey the message in a simple, understandable and visual way.

There are several kinds of charts offered by Tableau. Charts are used to convey more message in a simple way in less time.

Text_Table:

These kinds of charts are being used for the data like a table, it includes Zero or more Dimensions & Zero or more Measures.

Steps:

1) Drag Column [Ship Mode] onto the Column shelf.

2) Drag Column [Customer Name] onto the Row shelf.

3) Drag Column [Sales] onto the Text shelf.

4) Select Text Table, from Show Me canvas.


—-------------- —---------------- —------------------ —-------------------- 

Highlight_Table:


1) These kinds of charts are being used to show the data like a table, it includes Dimensions & Measures. We can highlight the data based on colors.

2) In a glance we can identify which are having more weightage and which are having less weightage in terms of specified measure.

3) It is an Advanced CrossTab view, it has color legend & Size Legend.

4) We can place one or more dimensions and only one measure

Steps:

1) Drag Column [Ship Mode] onto the Column shelf.

2) Drag Column [Segment] onto the Row shelf.

3) Drag Column [Sales] onto the Text shelf.

4) Select Highlight Table, from Show Me canvas.


—-------------- —---------------- —------------------ —-------------------- 

Heat Maps:


These kinds of charts are being used to show the data like a table and compare different values of the dimension, it includes Dimensions & Measures. We can highlight the data based on colors.

The main difference between Heat Map & Highlight tables is that Heat map has one option that Cell size is controlled by measure value. We can use different measures to represent color and size.

Steps:

1) Drag Column [Ship Mode] onto the Column shelf.

2) Drag Column [Region] onto the Row shelf.

3) Drag Column [Sales] onto the Text shelf.

4) Select Heat Map, from Show Me canvas.

—-------------- —---------------- —------------------ —-------------------- 

Line Charts

Line charts are used to show the trends over a period of time. Here we are using the Time Dimension as 'Discrete'.

Steps:

1) Select [Order Date Updated] &[Sales] using the control button and select Line Chart from Show Me canvas.

2) Right click on [Order Date Updated] on the columns shelf, then select 'Discrete'.




Line charts are used to show the trends over a period of time. Here we use the Date field as 'Continuous'.

Steps:

1) Select [Order Date Updated] &[Sales] using the control button and select Line Chart from Show Me canvas.

2) Right click on [Order Date Updated] on the columns shelf, then select 'Continuous'.

3) Drag [Segment] onto the Detail shelf, now the View shows Year wise Sales further breakdown by Segments.

—-------------- —---------------- —------------------ —-------------------- 

Area Charts:

Area charts are similar to Line charts, we use them to show the trends over a period of time. Here it occupies the space by color. Here we use the Date field as 'Discrete'.

Steps:

1) Select [Order Date Updated] &[Sales] using the control button and select Area Chart from Show Me canvas.

2) Right click on [Order Date Updated] on the columns shelf, then select 'Discrete'.


Area charts are similar to Line charts, we use them to show the trends over a period of time. Here it occupies the space by color. Here we use the Date field as 'Continuous'.

Steps:

1) Select [Order Date Updated] &[Sales] using the control button and select Area Chart from Show Me canvas.

2) Right click on [Order Date Updated] on the columns shelf, then select 'Continuous'.

3) Drag [Region] onto the Color shelf, now the View shows Year wise Sales further breakdown by Regions.




—-------------- —---------------- —------------------ —-------------------- 

Circle Views:

Circle Views are one kind of chart, we use One More Dimensions and One More measures.

Steps:

1) Select [Category] &[Sales] using the control button and select Circle View from Show Me canvas.

2) Drag [Region] onto the Colors shelf.



-------------- —---------------- —------------------ —-------------------- 

Side by Side Circle View


Circle Views are one kind of chart, we use One More Dimensions and One More measures.

Steps:

1) Select [Region] &[Sales] using the control button and select Circle View from Show Me canvas.

2) Drag [Category],[Order Date Updated] onto the Column shelf.

3) Now this view Shows the sales of Category and further divide into Year wise.

4) Easy to compare the Each Category Sales YoY. 



—-------------- —---------------- —------------------ —-------------------- 

Tree Maps

Tree Maps are used to Show the Summary Data by one Dimension then further drill down by another Dimension. It used to show hierarchical relationship related data on the views.

Steps:

1) Select [Region] &[Sales] using the control button and select Tree Map from Show Me canvas.

2) Segment onto the Detail Shelf to drill the Regions data Segment wise.

3) Drag [Sales], [Region] onto the Label shelf.

4) Apply Formatting on the work area.




—-------------- —---------------- —------------------ —-------------------- 

Bar graphs

We use Bar graphs to compare a measure among the members of a dimension.

In this example, We are comparing each Region's Sales over several years.

Bars are visualized in a horizontal way.


Steps:

1) Drag Columns [Region], [Order Data Updated] onto the Rows shelf, [Sales] onto the Column shelf.

2) Select Horizontal Bar chart from Show Me canvas.

3) Drag Column [Region] onto the Colors Shelf.

4) Apply Formatting on the work area.



—-

We use Bar graphs to compare a measure among the members of a dimension.

In this example, We are splitting each Region by years.

Steps:

1) Drag Columns [Region] ,[Order Date Updated] on to Column shelf, [Sales] on to Rows shelf.

2) Select Stacked Bar chart from Show Me canvas.

3) Drag Column [Order Date Updated] onto the Colors Shelf.

4) Apply Formatting on the work area.



We use Bar graphs to compare a measure among the members of a dimension.

In this example, We are comparing each Region's Sales over several years.

Bars are visualized in a vertical way.

Steps:

1) Drag Columns [Region] ,[Order Date Updated] on to Column shelf, [Sales] on to Rows shelf.

2) Select Bar chart from Show Me canvas.

3) Drag Column [Order Date Updated] onto the Colors Shelf.

4) Apply Formatting on the work area.



Scatter Plots:

Scatter Plots are used to show the co-relationship between two measure values.

Further we can drill down by using dimensions.

Steps:

1) Select [Profit] &[Sales] using the control button and select Scatter Plot from Show Me canvas.

2) Drag [Region] onto the Color shelf, now the View shows Year wise Sales & Profit.

3) It shows co-relationship between [Profit] &[Sales] further broken down by [Region] wise.




Bubble Charts:

We can measure for bubble size, we can use a dimension to apply different colors on different dimension members. It is one of the good looking visualizations. We use it in text mining as well.

Steps:

1) Select [Profit] &[Sales] using the control button and select Scatter Plot from Show Me canvas.

2) Drag [Region] onto the Color shelf, now the View shows Year wise Sales & Profit.



Pie charts:

We use Pie charts to show the contribution of each member of a specific dimension in specific measure.

In this example, We are getting each region's contribution or proportion in the Sales measure.

Steps:

1) Select [Region] &[Sales] using the control button and select Pie Plot from Show Me canvas.

2) Drag [Region] onto the Label shelf, now the View shows Region wise Sales.



—-------------------- 

Steps:

1) Select [Region] &[Sales] using the control button and select Pie Plot from Show Me canvas.

2) Drag [Region] onto the Label shelf, now the View shows Region wise Sales.

3) Drag [Category] onto the Column shelf, now the View shows Category wise Sales, Each category is further divided into different regions.

—--------- —-------------- —------------------------

Maps:

These kinds of maps are used to show the Geographical data on the global maps with symbols, color depends on the dimension we placed in the colors shelf.

Steps:

1) Open Tableau Software, connect to the Sample Database.

2) By using mouse hold fields [State], [Sales] then select Symbol Maps from Show Me canvas. We can change symbols from Mark cards.

3) Apply formatting to the maps.

4) Drag [State], [Sales] onto the Labels shelf, [Region] onto Colors shelf.



These kinds of maps are used to show the Geographical data on the global maps with filled color, color thickness depends on measure value.

Steps:

1) Open Tableau Software, connect to the Sample Database.

2) By using mouse hold fields [State], [Sales] then select Filled Maps from Show Me canvas.

3) Apply formatting to the maps.

4) Drag [State] , [Sales] onto the Labels shelf.



—--------------------- 

Example of advanced maps.


Steps:

1) Open Tableau Software, connect to the Sample Database.

2) By using mouse hold fields [State], [Sales] then select Symbol Maps from Show Me canvas. We can change symbols from Mark cards, here selecting PIE charts

3) Apply formatting to the maps.

4) Drag [State], [Sales] onto the Labels shelf, [Region] onto Colors shelf.

5) We can show the [% of Sales] by [Category] within each [State] by using Table Calculations.






Now Category has been used to apply the color palette.





---------------

Dual Axis:
Showing 1 Measure values on top on another Measure Values, it means override the Measure Values.
Main Usage is comparing two KPI's for any Dimension.

EX: BUZ User Wants to see Sales, Profits of Regions in the Single Report.

1) Drag the Regions on to Rows shelf, Sales & Profit fields onto Columns Shelf.
2) To differentiate measures, apply different colors for both Measures.
3) Right click on Second measure in the work Area, then click on "Dual Axis".
4) Now Report will show two measure values in single pane.
Have to Keep 1st Max Value KPI then Less Value KPI.

Synchronize Axis:
To follow the Same Scale for both Measures.





ttps://public.tableau.com/app/profile/kumar.tableau/viz/CahrtTypes-BasicandAdvanced/Sheet39