Exp 3 & Exp 4

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 27

Exp 3:

Aim:

Tableau Calculations, Overview of SUM, AVR, and Aggregate features,


Creating custom calculations and fields

Solution :
Tableau offers a powerful set of calculation tools that allow you to manipulate,
transform, and analyze your data in various ways. Here's an overview of some key
concepts related to Tableau calculations, including SUM, AVG (average), and
aggregate functions, as well as creating custom calculations and fields

SUM and AVG (Average) Functions

SUM Function
The SUM function in Tableau calculates the total sum of a numeric field. You can use it
to find the sum of values in a column or as part of a more complex calculation. To use
SUM, simply drag and drop a numeric field into the "SUM" shelf, or you can create a
calculated field using the SUM function.
AVG (Average) Function
The AVG function calculates the average (mean) value of a numeric field. Like SUM,
you can use it by dragging a numeric field into the "AVG" shelf or creating a calculated
field with the AVG function.
Aggregate Functions:
Tableau provides a range of aggregate functions that allow you to perform calculations
on groups of data. Common aggregate functions include SUM, AVG, COUNT, MIN
(minimum value), and MAX (maximum value). These functions are particularly useful
when you want to analyze data at different levels of granularity (e.g., by category,
region, or time period).
Creating Custom Calculations
Tableau allows you to create custom calculations using calculated fields. Here's how to
create a custom calculation:

1. Create a New Calculated Field


In the Data Source Pane, right-click on your data source and select "Create Calculated
Field".
Alternatively, you can create a calculated field by right-clicking on a shelf in your
worksheet and choosing "Create Calculated Field".

2. Enter Your Calculation:


In the calculated field editor, you can use functions, operators, and field references to
define your calculation.
For example, you can create a calculated field to calculate profit margin as
(SUM([Profit]) / SUM([Sales])) * 100.

3. Name and Save the Calculated Field:


Give your calculated field a meaningful name.
Click the "OK" or "Apply" button to save the calculated field.

4. Use the Calculated Field in Your Worksheet:


You can now use the calculated field like any other field in your worksheet. Drag it to the
Rows or Columns shelf, use it in filters, or create visualizations based on it.
Exp 4:

Aim:

Applying new data calculations to your visualizations,


Formatting Visualizations, Formatting Tools and Menus, Formatting
specific parts of the view.

Solution :

Applying New Data Calculations to Visualizations

1. Drag and Drop Calculated Fields:


To apply your newly created calculated fields to a visualization, simply drag and drop
them onto the appropriate shelves in your worksheet. For example, you can drag a
calculated field to the Rows or Columns shelf, use it in filters, or place it on the Marks
card to control the appearance of marks.
2. Filter with Calculated Fields:
Create filters using calculated fields to control which data points are displayed in your
visualization. You can use calculated fields to filter by specific criteria, such as a
calculated date range or a custom ranking.
Formatting Visualizations
Tableau provides a wide range of formatting options to make your visualizations more
appealing and informative:

1. Format Pane:
On the left side of the Tableau interface, you'll find the Format pane. It allows you to
format various aspects of your visualization, such as fonts, colors, lines, shading, and
borders. Simply select the element you want to format and use the options in the
Format pane to make changes.
2. Marks Card:
The Marks card, located above your visualization, offers formatting options specific to
the type of marks you're using (e.g., color, size, label). Click on the Marks card to
access these options and modify how your data is represented.
3. Axis and Gridlines:
You can format axis labels, titles, and gridlines to improve the readability of your
visualization. Right-click on an axis or gridline to access formatting options.
4. Legends and Color Scales:
Customize legends and color scales to provide context for your visualizations. You can
change colors, labels, and the position of legends to match your data.
Formatting Tools and Menus
Tableau provides several formatting tools and menus to help you refine the appearance
of your visualizations:

1. Format Menu:
The Format menu at the top of the Tableau interface provides access to various
formatting options, including font styles, shading, borders, alignment, and more. You
can use this menu to format text, labels, and other elements.

2. Worksheet Menu:
In the Worksheet menu, you'll find options to format the entire worksheet, including
background color, borders, and worksheet title. You can also adjust the worksheet size.
3. Dashboard Menu:
If you're working with dashboards, the Dashboard menu allows you to format the entire
dashboard layout, including background, size, and title.
Formatting Specific Parts of the View
Tableau lets you format specific elements of your visualization:

1. Annotations:
You can add annotations to your visualizations to highlight important points or provide
additional context. Format these annotations using the options available when you right-
click on an annotation.
2. Tooltips:
Customize tooltips to display relevant information when users hover over data points.
You can format tooltips to show or hide specific fields and control their appearance.
3. Headers and Titles:
Format headers, titles, and subtitles for clarity and consistency. Use the Format pane or
the Format menu to adjust text formatting, alignment, and shading.

You might also like