Flashcards 2 — Filters & calculations
Filter types, context, parameters, LOD and table calculations. Click a card to flip, or use the arrow keys and space bar.
Differentiate between parameters and filters in Tableau.
A filter restricts which rows reach the view. Its values come from the data, it can be multi-select, and it updates automatically when new members appear. A parameter supplies a value you define. It does not touch the data by itself — something has to reference it before anything happens. Classic parameters hold one value at a time and… Read the lesson
What are Quick Filters in Tableau?
A quick filter is a filter exposed as a control in the view, so a reader can change its value without editing anything. You create one by right-clicking a field on the Filters shelf and choosing Show Filter. The control type is configurable — single-value list, multi-select, dropdown, slider, wildcard search, relative date and so on.… Read the lesson
What is Aggregation & Disaggregation?
Aggregation is combining many rows into one value — summing, averaging, counting. Tableau aggregates measures automatically, because each mark in a view can only display a single number. You can see the aggregation in the pill itself: `SUM(Sales)` rather than `Sales`. Change it from the field's dropdown, or set a different default in the… Read the lesson
What is Context Filter?
A context filter is one you promote above the ordinary dimension filters so that everything else operates on its result. Tableau builds a temporary table containing only the rows that pass the context filter, and every subsequent filter, top-N rule and FIXED calculation works against that subset. The classic reason to use one is top-N.… Read the lesson
What are the limitations of context filters?
The temporary table has to be built, and it is rebuilt every time the context filter changes. That is real work, so a context filter on a fast-changing quick filter can make a dashboard slower rather than faster. Context is also a blunt instrument: it applies to the whole sheet, not to a single calculation, so you cannot scope it… Read the lesson
How to remove 'All' options from a Tableau filter?
On the filter control, click the dropdown arrow in its heading, choose Customize, and untick Show "All" Value. The option is a display setting rather than a filter change — the values themselves are unaffected, and ticking it again restores the entry. The usual reason to remove it is a dashboard where selecting everything is meaningless… Read the lesson
How to use group in calculated field?
An ad-hoc group created by selecting marks and clicking the paperclip cannot be referenced in a calculation. To use grouping inside a calculated field you need the group to exist as a field. Two ways to get there. Create the group properly in the Data pane — right-click the dimension → Create → Group — which produces a new field you can… Read the lesson
What is the difference between Quick Filter, Normal filter and Context filter?
These describe three different things, which is partly why the question gets asked. A normal filter restricts rows in the view. It exists on the Filters shelf and the reader cannot change it. A quick filter is the same filter *exposed as a control*, so a reader can change its value. Right-click the pill and choose Show Filter. It is a… Read the lesson
Where all can you use global filters?
Global filters can be applied across worksheets, dashboards and stories. The mechanism is the Apply to Worksheets option on a filter: right-click the pill and choose whether it affects only the current sheet, all sheets using the same data source, all sheets using related data sources, or a selected list. On a dashboard, the equivalent… Read the lesson
What is LOD expression in Tableau?
A level of detail expression computes an aggregate at a granularity other than the view's, which is otherwise impossible because a calculation normally inherits the level of detail from whatever is on the shelves. There are three types: - FIXED uses only the dimensions you name and ignores what is in the view. `{FIXED [Customer ID] :… Read the lesson
What is the difference between Quick Filter and Normal filter?
They are the same filter. The difference is whether the reader can see and change it. A normal filter sits on the Filters shelf and applies silently. Only someone editing the workbook can alter it. A quick filter is that filter with Show Filter turned on, so it renders as a control — a list, dropdown, slider or search box — that a reader… Read the lesson
What are the types of filters in Tableau?
Tableau applies filters in a fixed order, and the types line up with it: - Extract filters — applied when the extract is built, so excluded rows never enter the workbook. - Data source filters — applied to every sheet using the source, before anything else. Common for row-level security. - Context filters — promoted above ordinary… Read the lesson
What is a context filter?
A context filter is a filter promoted above the other dimension filters, so that everything applied afterwards operates on its result. Tableau creates a temporary table containing only the rows that pass it. Subsequent filters, top-N rules and FIXED expressions all see that reduced set rather than the full data. The main use is making a… Read the lesson
What is table calculation in Tableau?
A table calculation is computed on the aggregated result already in the view, after the query has returned, rather than in the database. That makes it fast and flexible, but it also means a table calculation can only see what the view contains. Anything filtered out is invisible to it. Every table calculation is defined by two things:… Read the lesson
What is a calculated field in Tableau?
A calculated field is a new field you define with a formula, computed from existing fields rather than read from the source. Create one from Analysis → Create Calculated Field, or by right-clicking in the Data pane. It then behaves like any other field and can be used on shelves, in filters, or inside other calculations. The types worth… Read the lesson
How to get current date and time?
`NOW()` returns the current date and time. `TODAY()` returns the current date only. Both are evaluated when the view is refreshed rather than continuously, so a workbook left open does not tick over. They are most often used in relative date logic — `DATEDIFF('day', [Order Date], TODAY())` for days elapsed, or a boolean like `[Order… Read the lesson
How to check if a data is a of type date?
`ISDATE([field])` returns true when a string can be interpreted as a date, and false otherwise. It takes a string argument, so it is used for validating imported data rather than checking a field that is already typed as a date. The typical pattern is a data-quality flag on a text column that should hold dates: `IF ISDATE([Raw Date])… Read the lesson
What does REPLACE function do in Tableau?
`REPLACE(string, substring, replacement)` searches a string for a substring and substitutes it, returning the modified string. The original field is unchanged. `REPLACE([Product Name], 'Corp.', 'Corporation')` standardises a naming variation across a column. It is a string function, which is worth stating explicitly because interviewers… Read the lesson
Which function returns the number of items in a group?
`COUNT()` returns the number of items in a group, ignoring nulls. The related ones worth knowing together: - `COUNT([field])` — non-null values. - `COUNTD([field])` — distinct non-null values. - `SUM([Number of Records])`, or `COUNT(*)` behaviour, for the row count regardless of nulls. The distinction matters. On a nullable column,… Read the lesson
What is Forecasting in Tableau?
Forecasting projects a measure forward in time using exponential smoothing, fitted automatically from the historical values in the view. It requires a date dimension and at least one measure, and enough history to work with — Tableau wants several periods, and more for a seasonal pattern to be detected. Turn it on from the Analytics pane… Read the lesson
What is a Trendline in tableau?
A trend line is a fitted model drawn over the marks in a view, showing the underlying direction of the relationship rather than the point-to-point movement. Add one from the Analytics pane. The available models are linear, logarithmic, exponential, power and polynomial, and the choice should follow the shape of the relationship rather… Read the lesson
Give an expression to add 4 months to the date 014-03-12?
`DATEADD('month', 4, [Date])` — the arguments are the date part, the interval to add, and the date to shift. For a literal rather than a field, wrap it: `DATEADD('month', 4, #2014-03-12#)`, which returns 12 July 2014. Tableau uses `#` around date literals. The same function handles other parts by swapping the first argument — `'day'`,… Read the lesson
Which filter is used to get the top 10 values from a view?
A Top filter. On the Filters shelf, open the field's dialog, go to the Top tab, and set Top N by a field — for example, top 10 by `SUM(Sales)`. It can rank by a field or by a formula, and a parameter can supply N so the reader can change it. The subtlety worth raising is how it interacts with other filters. A top filter and a dimension… Read the lesson