Tableau Basics
Tableau Basics Interview with follow-up questions
1. Can you explain the difference between dimensions and measures in Tableau?
In Tableau, dimensions and measures are the two fundamental field types, and understanding the distinction is essential for building correct visualizations.
Dimensions are qualitative, categorical fields that define the structure of your view. They slice and dice the data, creating the headers and partitions for your chart. Examples include Customer Name, Region, Product Category, and Order Date. Dimensions are displayed in blue in the Data pane and are not aggregated by default — each value creates a separate mark or group.
Measures are quantitative, numerical fields that Tableau aggregates. When you place a measure in a view, Tableau applies a default aggregation (usually SUM for sales figures, AVG for rates, COUNT for IDs). Examples include Sales, Profit, Quantity, and Discount. Measures appear in green in the Data pane.
Key behavioral differences:
| Dimensions | Measures | |
|---|---|---|
| Data type | Usually string, date, or boolean | Usually number |
| Default role | Slices data into categories | Gets aggregated (SUM, AVG, etc.) |
| Shelf behavior | Creates headers on Rows/Columns | Creates axes on Rows/Columns |
| Encoding | Encodes to Color, Shape, Detail | Encodes to Size, axis position |
Important nuance: these are roles, not data types. Tableau allows you to convert a field — for example, treating a numerical Zip Code as a dimension so it is not summed, or treating a date as a continuous measure to plot on a timeline axis. Right-clicking a field and selecting "Convert to Dimension" or "Convert to Measure" changes how Tableau treats it in the view.
Interviewers often follow up by asking about discrete vs. continuous (which controls whether a field creates headers/color chips or an axis/gradient) — these are orthogonal to the dimension/measure distinction.
Follow-up 1
What happens when you convert a measure to a dimension?
When you convert a measure to a dimension in Tableau, it changes how the field is treated and displayed. The numerical values of the measure will be treated as discrete categories or groups, similar to dimensions. This can be useful when you want to analyze the measure data in a categorical manner, such as grouping sales amounts into different ranges or bins.
Follow-up 2
How does Tableau handle these two differently?
Tableau treats dimensions and measures differently in terms of how they are displayed and how they can be used in visualizations. Dimensions are displayed as discrete fields, meaning they are shown as separate categories or groups. Measures, on the other hand, are displayed as continuous fields, meaning they are shown as numerical values that can be aggregated or used in calculations. Tableau provides different options and functionalities for dimensions and measures, such as sorting, filtering, and aggregating.
Follow-up 3
Can you give an example of when you might use each?
An example of using a dimension in Tableau could be analyzing sales data by different product categories. The product category would be the dimension, and you could use it to group and compare sales figures for different categories. On the other hand, an example of using a measure in Tableau could be calculating the average sales per month. The sales amount would be the measure, and you could use it to perform calculations and create visualizations based on the average sales.
Follow-up 4
How do dimensions and measures affect the visualization of data in Tableau?
Dimensions and measures play a crucial role in the visualization of data in Tableau. Dimensions determine the structure and organization of the visualization, as they define the categorical aspects of the data. Measures, on the other hand, provide the numerical values that are used to create the visual representations, such as bars, lines, or pie charts. By combining dimensions and measures, you can create meaningful and insightful visualizations that help in understanding the data and identifying patterns or trends.
2. What are sets in Tableau and how are they used?
Sets in Tableau are custom, binary subsets of data that classify members as either "In" or "Out" of the set based on conditions you define. They are created from dimension fields and are one of Tableau's most flexible segmentation tools.
Types of sets:
- Fixed sets: Members are manually selected — you right-click a dimension, choose "Create Set," and hand-pick values. The set membership does not change as the data changes.
- Computed sets: Membership is defined by a condition (e.g., customers whose total sales exceed $10,000) or by a top/bottom N rule (e.g., top 10 products by profit). These recalculate dynamically as the underlying data changes.
- Combined sets: Two sets based on the same dimension can be combined using union, intersection, or difference logic to create more complex segmentations.
How sets are used:
- In/Out highlighting: Drag a set to the Color shelf to visually distinguish set members from non-members in any chart.
- Filtering: Drop a set on the Filters shelf and choose to show only "In" members, focusing the view on a specific segment.
- Set actions (introduced in Tableau 2018.3): Allow dashboard interactivity to dynamically update set membership based on user selections, enabling "select and compare" patterns.
- In calculations: Reference a set in a calculated field using
[Set Name]— it returns TRUE for "In" members and FALSE for "Out" members, enabling conditional logic. - Combined with LOD expressions: Sets can scope calculations to a defined group, enabling sophisticated cohort analysis.
A common interview scenario: use a computed set to identify top N customers and a set action to let the user define their own selection interactively.
Follow-up 1
Can you give an example of when you might use a set?
Sure! Let's say you have a dataset of sales transactions and you want to analyze the performance of your top customers. You can create a set based on a condition like 'Customers with total sales greater than $10,000'. This set will then allow you to focus on the data points that meet this criteria and perform specific analysis or create visualizations for this subset of customers.
Follow-up 2
How do sets differ from groups in Tableau?
Sets and groups in Tableau serve similar purposes of grouping data, but they have some key differences. Sets are based on specific conditions or criteria, while groups are created by manually selecting data points. Sets are dynamic and can change as the underlying data changes, while groups are static and do not update automatically. Sets can be used in calculations and filters, while groups cannot be used in calculations.
Follow-up 3
What are the advantages of using sets?
There are several advantages of using sets in Tableau:
- Sets allow you to focus on specific subsets of data, making it easier to analyze and visualize specific groups of interest.
- Sets can be used in calculations, allowing you to perform calculations on specific subsets of data.
- Sets can be used in filters, enabling you to create dynamic filters that update as the underlying data changes.
- Sets can be used in combination with other Tableau features like parameters and actions to create interactive dashboards and visualizations.
Follow-up 4
Can you combine sets in Tableau? If so, how?
Yes, you can combine sets in Tableau using set operations like union, intersection, and exclusion.
- Union: This operation combines the data points that are present in either of the sets.
- Intersection: This operation combines the data points that are common to both sets.
- Exclusion: This operation combines the data points that are present in one set but not in the other.
To combine sets, you can right-click on a set and select 'Combine Sets' from the context menu. This will open the Set Combine dialog where you can choose the set operation and select the sets to combine.
3. Can you explain the concept of hierarchies in Tableau?
In Tableau, a hierarchy is a structured grouping of related dimensions in a parent-child arrangement, allowing users to drill down to finer levels of detail or roll up to broader summaries directly in the view.
Creating a hierarchy: In the Data pane, drag one dimension field on top of another to create a hierarchy, then add additional levels by dragging more fields into it. You can also right-click a field and select "Hierarchy > Create Hierarchy." Fields are reordered within the hierarchy by dragging them up or down.
Example: A standard date hierarchy might be:
- Year → Quarter → Month → Week → Day
A geography hierarchy might be:
- Country → State/Province → City → Postal Code
How hierarchies work in views: When a dimension from a hierarchy is placed on a shelf, Tableau displays expand (+) and collapse (−) icons in the column or row headers. Clicking the + icon drills down to the next level of the hierarchy, adding it automatically to the shelf. Clicking − collapses back up. This enables exploratory analysis without manually dragging fields.
Date hierarchies: Tableau automatically creates a date hierarchy for any date field, letting users step from Year down to Day with a single click. Users can also right-click a date to choose a specific date part or date value.
Interactivity note: On dashboards, hierarchy drill-down persists at the sheet level. For more dynamic cross-sheet drill-down behavior, parameter actions or filter actions are often used alongside hierarchies.
Hierarchies are especially useful for executive dashboards where stakeholders want to start at a summary level and drill into specifics on demand.
Follow-up 1
How do you create a hierarchy in Tableau?
To create a hierarchy in Tableau, you can follow these steps:
- Select the fields you want to include in the hierarchy.
- Right-click on one of the selected fields and choose 'Create Hierarchy'.
- Give the hierarchy a name.
- Click 'OK' to create the hierarchy.
Once the hierarchy is created, you can use it in your visualizations to drill down or roll up data.
Follow-up 2
Can you give an example of when you might use a hierarchy?
Hierarchies are useful in situations where you want to analyze data at different levels of detail. For example, if you have sales data for different regions and cities, you can create a hierarchy of 'Country' > 'Region' > 'City'. This allows you to analyze sales at the country level, drill down to the region level, and further drill down to the city level. Hierarchies make it easier to navigate and explore data in a structured way.
Follow-up 3
What is the impact of hierarchies on data visualization?
Hierarchies have a significant impact on data visualization. They allow you to easily create drill-down or roll-up visualizations, where you can explore data at different levels of detail. For example, you can create a bar chart that shows sales by country, and then drill down to show sales by region or city by simply interacting with the hierarchy. Hierarchies also help in organizing and presenting data in a structured manner, making it easier for users to understand and analyze the information.
Follow-up 4
How can you modify or remove a hierarchy?
To modify a hierarchy in Tableau, you can right-click on the hierarchy in the 'Data' pane and choose 'Edit Hierarchy'. This allows you to add or remove fields from the hierarchy, change the order of fields, or rename the hierarchy.
To remove a hierarchy, you can right-click on the hierarchy in the 'Data' pane and choose 'Remove'. This will remove the hierarchy from your workbook, but the individual fields will still be available for use in other visualizations.
4. What are the different data types supported by Tableau?
Tableau recognizes and works with the following core data types:
- String: Text values — names, descriptions, categories, IDs stored as text.
- Number (whole): Integer values with no decimal places.
- Number (decimal): Floating-point numeric values.
- Date: Calendar date values (year, month, day) without a time component.
- Date & Time: Timestamp values that include both date and time.
- Boolean: True/False (or 1/0) logical values.
- Geographic / Spatial: Latitude/longitude coordinates or geometry types (point, line, polygon) used for map visualizations. Spatial files (.shp, .kml, .geojson, .topojson) load as geometry fields.
Tableau also assigns a role (dimension or measure) alongside the data type, and these can be changed independently. For example, a numeric postal code should be converted to a dimension so Tableau treats it as a category rather than summing it.
Type conversion: Tableau provides type-conversion functions in calculated fields — STR(), INT(), FLOAT(), DATE(), DATETIME() — for cases where the inferred type does not match the intended use.
Automatic type detection: When connecting to a file or database, Tableau infers data types from the source. It is good practice to review the inferred types in the Data Source tab (look for the icon above each column) and correct any misidentified fields — for example, a date stored as a string in the source will need to be converted using DATEPARSE() or DATE().
Follow-up 1
How can you change the data type of a field in Tableau?
To change the data type of a field in Tableau, you can follow these steps:
- Right-click on the field in the Data pane.
- Select "Change Data Type" from the context menu.
- Choose the desired data type from the available options.
- Click "OK" to apply the changes.
Note that changing the data type of a field may affect how Tableau interprets and displays the data in visualizations.
Follow-up 2
What happens when you try to perform operations on incompatible data types?
When you try to perform operations on incompatible data types, Tableau may return an error or produce unexpected results. For example, if you try to add a string and a number together, Tableau will not be able to perform the operation and may return an error message. It is important to ensure that the data types of the fields you are working with are compatible to avoid such issues.
Follow-up 3
How does Tableau handle different data types?
Tableau automatically assigns a default data type to each field based on the data source. However, you can manually change the data type if needed. When working with different data types, Tableau performs type casting and conversion to ensure compatibility. For example, if you have a string field and want to perform a mathematical operation on it, Tableau will attempt to convert the string to a number before performing the operation.
Follow-up 4
Can you give an example of when you might need to change a data type?
One example of when you might need to change a data type is when you have a field containing dates stored as strings. By changing the data type of the field to a date, you can take advantage of Tableau's built-in date functions and perform date-based analysis. This allows you to easily filter, group, and aggregate the data based on dates, and create visualizations that show trends over time.
5. How do filters work in Tableau?
Filters in Tableau control which data is included in a view, and they execute in a specific order of operations — understanding this order is a common interview topic.
Filter types and execution order (from first to last):
- Extract filters: Applied when creating a Hyper extract, permanently restricting which rows are stored. Reduces extract size and improves performance.
- Data source filters: Applied at the data source level, restricting data for all worksheets using that source. Useful for row-level security and excluding irrelevant data globally.
- Context filters: The highest-priority filter within a worksheet. Putting a field in context creates a temporary table from the filtered data, and all subsequent filters, top N calculations, and LOD expressions run against that smaller dataset. Critical for making Top N filters behave correctly.
- Dimension filters: Standard categorical filters on dimension fields.
- Measure filters: Applied after aggregation — they filter based on the aggregated value (e.g., show only regions where SUM(Sales) > 100,000).
- Table calculation filters: The last to execute; they filter after all table calculations have been computed, so the filtered values are still used in the calculation.
Filter interface options: Filters can be shown as interactive controls on dashboards — single-value lists, multi-select checkboxes, dropdowns, sliders (for range filters on measures), or relative date filters.
Quick filters vs. filter actions: Quick filters are UI controls tied to a field. Filter actions are dashboard-level interactions where selecting marks in one sheet filters data in another sheet, providing a seamless drill-through experience.
Performance tip: Avoid placing high-cardinality dimensions as interactive quick filters without context filters or extract pre-filtering, as they can generate expensive queries on each user interaction.
Follow-up 1
What are the different types of filters in Tableau?
Tableau offers several types of filters:
Dimension filters: These filters are used to filter data based on the values of dimensions. For example, you can filter data to only show sales from a specific region or category.
Measure filters: These filters are used to filter data based on the values of measures. For example, you can filter data to only show sales that are above a certain threshold.
Top filters: These filters are used to filter data based on the top or bottom values of a measure. For example, you can filter data to only show the top 10 products by sales.
Quick filters: These filters are interactive filters that allow users to easily change the filter criteria directly in the visualization.
Context filters: These filters are used to create a temporary subset of data that can be used for further analysis. They are typically used to improve performance when working with large datasets.
Follow-up 2
Can you give an example of when you might use each type of filter?
Sure!
Dimension filters: Let's say you have a sales dataset and you want to analyze sales by region. You can use a dimension filter to only show data for a specific region, such as 'West'.
Measure filters: Continuing with the sales dataset, you can use a measure filter to only show sales that are above a certain threshold, such as $1,000.
Top filters: If you want to identify the top 10 products by sales, you can use a top filter to only show the products with the highest sales.
Quick filters: Quick filters are useful when you want to allow users to interactively change the filter criteria. For example, you can use a quick filter to let users select a specific category of products to analyze.
Context filters: Context filters are typically used when you have a large dataset and want to improve performance. For example, you can use a context filter to create a temporary subset of data for a specific region, and then perform further analysis on that subset.
Follow-up 3
How do filters affect the visualization of data?
Filters can have a significant impact on the visualization of data. When you apply a filter, Tableau will only show the data that meets the filter criteria, while hiding the rest of the data. This can help you focus on specific subsets of data and uncover insights that may not be apparent when looking at the entire dataset. Filters can also be used to create interactive visualizations, allowing users to dynamically change the filter criteria and explore the data from different perspectives.
Follow-up 4
What is the difference between a quick filter and a normal filter?
The main difference between a quick filter and a normal filter in Tableau is the level of interactivity and ease of use.
Quick filters: Quick filters are interactive filters that allow users to easily change the filter criteria directly in the visualization. They provide a user-friendly interface, such as drop-down menus or sliders, that users can use to select or adjust the filter values. Quick filters are designed to provide a quick and intuitive way for users to explore the data and analyze different subsets of data.
Normal filters: Normal filters, also known as regular filters, are filters that are applied to the entire workbook or specific worksheets. They are typically created using the Filter Shelf or the Data pane. Normal filters provide more advanced filtering options, such as filtering based on multiple conditions or using complex expressions. Unlike quick filters, normal filters require users to manually adjust the filter criteria in the filter settings.
Live mock interview
Mock interview: Tableau Basics
- Read your scene and goals
- Talk it out; goals tick off live
- Get a score and stronger lines
Your voice and your AI key never touch our servers; the key stays in this browser and is sent only to Google. Only your round scores are saved to track progress.