Program 3
Program 3
Aim:
Creating a View - formatting charts, adding filters, creating calculated fields and
defining parameters.
Data Visualization
We can perform various visualization operations on data in Tableau. Some of them are bar cart,
histogram, bubble chart, heat map etc.
Bar chart:
Bar charts can be created in 3 variations in Tableau: Horizontal bars, stacked bars, side-by-side
bars.
Horizontal bars can be created by selecting that type of chart from Show Me menu on right
hand side of Canvas. The type of chart in box on right hand side represents horizontal bar graph.
In similar to above, stacked bar graph can be created and the result is shown below.
Side-by-side bar chart can be created in following way.
Bubble chart:
Heat map:
Filters:
In Tableau, filters are powerful tools used to control the data that is displayed in your
visualizations.
General Filter:
Drag category and sub category as Column and sales as rows and swap it . Then select city a
color card.
Wildcard Filter:
Drag sub category as Row and Sales as Column then drag sub category to filter shelf and
click wildcard option and click starts with and enter the letter A then click OK.
Condition filter:
Select Row as Sales, Column as Category and Sub category and drag product name to filter
shelf then condition by field select quantity and average and click load select the option less
than 1000 and click ok.
Top Filter:
Drag row as subcategory and column as sales and drag the sub category the select top and
specify the number and click ok.
Or the above operation can be done by creating a calculated field as shown below. To
create a calculated field, click on the down arrow button beside search tab above Tables
panel, drag a field to that calculated field window.
Then click on apply and results are shown below:
In the same way we can apply any aggregate or statistical function on data with the help
of calculated fields.
Parameters:
Parameters in Tableau are dynamic values that can replace a constant value in
calculations, filters, or reference lines. They allow users to input or select values,
providing a more interactive experience. Here’s how to define and use parameters in
Tableau:
Creating a Parameter
Open the Parameter Dialog:
o Right-click in the Data pane and select Create Parameter.
Define the Parameter:
o Name: Give your parameter a descriptive name.
o Data Type: Choose the data type (e.g., Integer, Float, String, Date).
o Current Value: Set the default value that will be used when the parameter
is first created.
o Allowable Values: Decide how users will interact with the parameter:
All: Any value is allowed.
List: Provide a specific list of values for users to choose from.
Range: Set a minimum and maximum value with an increment
(step size).
Click OK: Save the parameter.
Using the Parameter:
In Filters:
You can filter your data based on the parameter. For instance, create a
filter to show only sales greater than the parameter value.
Select Column as Sum(sales) and Rows as Sub Category. Then arrange it in descending
order. Then drag sub category in filters card.
For changing the value In filters click top then select creating a new parameter name the
parameter as TOP N, give the minimum and maximum values then apply OK.
Right side can adjust the parameter value. Click and Type In the values also.
In Sets:
Right click the sub category create set give the name of the set then Top select By Field and
click TOP N then click ok set is created.
Then Right click the parameters select show parameters. You can adjust the parameter
control. Put the set in Color card.