Calculations Flashcards

1
Q

T/F

Another word for aggregation is row-level calculation

A

False

They are two different calculations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

T/F

Aggregation and row-level calculations can appear in the same calculated field.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are 4 types of calculations?

A

row-level
aggregation
table calculations
LOD expressions

https://www.tableau.com/blog/understanding-how-tableau-calculation-types-work-together

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the order of calculations for the 4 types of calculations?

  • row-level
  • aggregation
  • table calculations
  • LOD expressions
A

row-level & LOD
aggregation
table calc.

https://www.tableau.com/blog/understanding-how-tableau-calculation-types-work-together

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What calculation type is each formula:

SUM([Revenue])
[Quantity] * [Price]
RUNNING_SUM(SUM([Revenue])

Table Calculation
Row-Lvl
Aggregation

A

Aggregation
Row-Lvl
Table Calculation

Image 1

https://www.tableau.com/blog/understanding-how-tableau-calculation-types-work-together

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Name the calculation type of each part of this formula:

RUNNING_SUM(SUM([[Quantity] * [Price]])

A

Image 2

https://www.tableau.com/blog/understanding-how-tableau-calculation-types-work-together

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Are aggregations preformed on columns or rows?

A

Hint:
Agg. examples: SUM(), AVG()

Aggregations are performed on a set of rows (records), grouping them by dimensions specified in the view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Will this formula create a calculation error?

[Distance]/([Activity Date])

A

Yes, you cannot divide a number by a date

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Will this formula create a calculation error?

[Distance]/COUNTD([Activity Date])

A

Yes, you cannot mix aggregate and non-aggregate arguments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does IIF() do? What’s the correct syntax?

A

IIF(<test>, <then>, <else>, [<unknown>])</unknown></else></then></test>

Unknown is for nulls

IIF ( [Sales] > 10, “OK”, “NOT OK”, “NA” )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the correct syntax for CASE in a caclulated field?

Example: you want the input of the [Season] to be Sandals if it’s summer and boots if it’s winter, other should be sneaker.

A

CASE <expression>
WHEN <value1> THEN <then1>
WHEN <value2> THEN <then2>
...
ELSE <blah>
END
IGNORE THIS -></blah></then2></value2></then1></value1></expression>

**Example: **
CASE [Season]
WHEN ‘Summer’ THEN ‘Sandals’
WHEN ‘Winter’ THEN ‘Boots’
ELSE ‘Sneakers’
END

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

T/F

All IF() can be written as CASE()

A

False, but all CASE() can be written as IF

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

T/F

To join 2 words end-to-end (e.g. “bat” “man” into “batman”) we would use CONCATENARE()

A

FALSE

there is no CONCATENATE() in Tableau

you would just use +

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

T/F

LOD Expressions are Table Calculations

A

False. These are 2 seperate things.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Answer these questions:
Calculations > 3 > Table Calculations fact check

https://campus.datacamp.com/courses/calculations-in-tableau/table-calculations-and-parameters?ex=2

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How is a Moving Average of 30 calulated?

A

Smooth out noisy data by calculating & plotting the avg of previous entries.

e.g. Each point is calculated based on the average of the previous 30 days

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

T/F

A chart presenting a moving avg of 30-days-sales will have less data points than a char with daily sales

A

True

With a moving average, we “smoothen” the graph by reducing the # of data pts thanks to averaging them to one number per window.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

CAGR ypically compares the values over a period [longer/shorter] than one year horizon, indexing avg growth in n years to the 1st year.

A

longer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

T/F

Moving calculations require RUNNING family of functions & may use WINDOW functions in a secondary calculation.

A

False,

moving calculations require “bucketing” time intervals into windows anchored to a point in time, so they rely heavily on the WINDOW family of functions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Comparing results per discrete month across various years is a ____ comparison.

A

year-over-year

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

T/F

This is a year-over-year comparison chart

Image 3

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

____ preforms a running calculation (e.g. SUM), restarting each year.

Hint: It’s a Quick Table Calculation

A

Year-to-Date (YTD)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What does CAGR stand for?

A

Compound Annual Growth Rate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is an example of a CAGR?

5 or 5%

A

5%

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What does 32% mean in this chart? | Image 4
In 2021, we observed a 32% avg compound annual growth rate over the previous 3 years, mainly driven by the spike in the last year
26
# T/F CAGR cannot be negative
False
27
[..........] calculations are used to see long-term trends. 1. CAGR 2. Moving 3. YTD 4. YOY
1. **CAGR** - compound annual growth rate - compares multiple years 2. **Moving** - Used for smoothing fluctuations in data (Handy when there are a lot of data points and a regular calculation wouldn't give much insight.) 3. NOT YTD - only analyzes 1 year 4. **YOY** - compare each year to see for monthly/seasonal trends (potentially good for more granular levels like day or weekday if filtered?) ## Footnote https://campus.datacamp.com/courses/calculations-in-tableau/time-series-analysis?ex=6
28
List all of the Quick Calculations | Hint: 11 5 groups
Running Total Percent Total Difference Percent Difference Rank Percentile Moving Average YTD Total Compound Growth Rate Year Over Year Growth YTD Growth
29
Create outline of an IF statement
If ___ THEN ___ ELSEIF ____ THEN ___ ELSE ___ END
30
Birth Year should be [dimension/measure]
dimension
31
Lat & Long should be [dimension/measure]
dimension
32
Bins are [discrete/continuous]
discrete
33
Time series are [discrete/continuous]
continuous
34
# T/F All CASE() can be written as IF()
T
35
Bins are created from a [**continuous/discrete**] [**dimension/measure**]
continuous measure also **numerical dimensions** Note that not all **continouos dimensions** are **numerical**. Date/time can also a **continuous dimnsion**, and Date/time cannot be binned.
36
How do you create a bin?
Hint: what type of field? Measure/dimension? Continious/discrete? . . . . . . .. . . . . . 1. Right click a continuous measure field/ numerical dimension (Note that not all **continouos dimensions** are **numerical**. Date/time can also a **continuous dimnsion**, and Date/time cannot be binned.) 2. "Create" 3. "Bins" 4. Edit the Bin in the "Edit Bin" popup
37
Bins are [**continuous/discrete**] fields by default
Discrete
38
_ bins show only the starting value of each bin * continuous measure * continuous dimensions * discrete measure * discrete dimensions | (Image 5)
discrete dimension | (bins cannot be measures)
39
You want your bins to look like **Image 6**, but they currently look like **Image 5**. How do you change this?
Change the field in columns from discrete to continuous.
40
How do you create a bin size parameter? (include all steps, till the parameter is in view)
1. Create bin calculated field 2. Create Parameter (while creating CF) * In the "Edit Bin" dialogue box, change "**Size of Bin**" to "Create a new parameter" * Edit in the "Create Parameter" popup * After saving, a Parameter & CF will show up in the Data Pane 3. Place the CF in vis. Show the Parameter. The parameter will change the CF Bin you created.
41
# T/F Bins can be used in calculations
False
42
# T/F You can only bin data from relational datasets
True
43
You can create a Bin from a [**measure/dimension/both**]
both | (dimension must be numeric)
44
A Bin can be a [**measure/dimension/both**]
dimension only | (The bin dimension can be continous or discrete, though)
45
# T/F When you create bins from a measure you create a new measure.
False When you create bins from a measure you create a new **dimension**
46
A Bin can be [**continuous/discrete/both**]
both | (Image 7)
47
How can you make a dimension Bin?
Bins can only be dimensions. Trick question!
48
Bins are _ by default, so to turn them into _, you need to _
Bins are **discrete** by default, so to turn them into **continuous**, you need to **right click the field (in the data pane or the visual/one of the cards) and choose the continuous option**.
49
# T/F Measures are always green and Dimensions are always blue.
False. The color is based on Distrete or Continuous Measures and Dimensions can be both discrete and continous.
50
# T/F If a dimension is numerical (including dates), it can be green.
True | (Green = continuous)
51
# T/F In the Data Pane, measures are always green and Dimensions are always blue
False Remember, the color is based on Discrete or Continuous. You can convert a field from Discrete to Contiuous or visa versa in the Data Pane
52
# T/F A measures can be blue.
True, a measure can be blue if it's discrete.
53
# T/F A dimensions cannot be green.
False, a dimension can be green if it's continous. If a dimension is numerical (including dates), it can be continuous.
54
# T/F Dimensions with a data type of string/Boolean can be continous.
False | Image 7
55
# T/F Dates are the most common continous dimension.
True Dates are **the** most common continous dimension. Note, that this doesn't mean that dates are commonly CD, but CDs are commonly dates.
56
Dimensions with a string/Boolean data type cannot be turned into _. * a measure * discrete dimension * continous dimension
Answer: Continous * **Why Not Measure**: String/Boolean can turned into a measure (e.g. turing into a Count Distinct **Image 10**) * **Why Not Discrete**: both can only be discrete | (**Image 7**)
57
_ is the most common continuous dimension. * Decimal # * Whole # * Date & Time * Date * String
Date | (**Image 7**)
58
Based on Image 9, can you tell if the field is a measure/dimension and continuous/discrete?
measure/dimension = No continuous/discrete = Yes
59
What is discrete/continous? Image 9
Image 9
60
# T/F You cannot bin data from relational datasets
False You can only bin data from relational datasets
61
# T/F You can only bin data from a measure
False You can also bin data from a numerical dimension
62
You can only bin data from a ____ database * NoSQL * Relational * Non-relational
relational Note, NoSQL = Non-relational NoSQL has no tables, no rows ## Footnote https://www.pluralsight.com/resources/blog/software-development/relational-vs-non-relational-databases#:~:text=The%20non%2Drelational%20database%2C%20or,type%20of%20data%20being%20stored.
63
What's relational VS non-relational databases?
relational = rows & columns non-relational = NOT rows & columns
64
[Relational/Non-Relational] database is a database that stores data in tables, rows, and columns, with the ability to establish links or relationships between different tables.
Relational
65
____ is a database that does not use the tabular schema of rows and columns found in most traditional database systems.
non-relational
66
Partitions are ___
1 or more dimensions defining how to group the **calculations** ## Footnote https://campus.datacamp.com/courses/calculations-in-tableau/table-calculations-and-parameters?ex=1
67
1 or more dimensions defining how to group the calculations are called ____
Partitions
68
**Image 11** is partitioned by ____
product & year | (month is an addressing field)
69
The addressing field/s in **Image 11** is/are ____
Month | (Year and Product are called partitions)
70
What will happen to **Image 12** chart if you change the Running_SUM() to Window_SUM()?
**Image 13**
71
What's the list of Quick Table Calculations?
**Image 14** Hint: PanTRYMAiD . . . . . . . . Hint: 3T 3Y 3P 1MA (11 total)
72
Is this likely made from a group or set. **Image 7 of Combinations**
set notice the In/Out **Image 8 of Combinations**
73
Is this likely made from a group or set. **Image 7 in Combination**
set notice the In/Out **Image 8 in Combination**
74
____ calculates the mean annual growth rate of a measure over a specified period of time longer than one year. 1. Compound Growth Rate 2. Moving Average 3. YTD Total 4. YOY Growth 5. YTD Growth
Compound Growth Rate (Note that CAGR is named this in the calculations tab) ## Footnote https://campus.datacamp.com/courses/calculations-in-tableau/time-series-analysis?ex=6
75
____ compares change in a measure to the same period last year (e.g. Q1]19 to Q1'18) 1. Compound Growth Rate 2. Moving Average 3. YTD Total 4. YOY Growth 5. YTD Growth
YOY Growth
76
____ calculates from the start of the year to the last known data point in that year. 1. Compound Growth Rate 2. Moving Average 3. YTD Total 4. YOY Growth 5. YTD Growth
YTD Total YTD Growth
77
YOY Growth requires continous date dimensions.
False YOY Growth requires **discrete** date dimensions.
78
____ calculated across a specified # of values bf and/or after the determined point in time 1. Compound Growth Rate 2. Moving Average 3. YTD Total 4. YOY Growth 5. YTD Growth
Moving Average
79
____ is used for smoothing fluctuating data 1. Compound Growth Rate 2. Moving Average 3. YTD Total 4. YOY Growth 5. YTD Growth
Moving Average
80
CASE Uses: (select all that apply) * THEN * END * WHEN * IF * ELSE
all but IF
81
Image 15 What Calculation type is Revenue?
Hint: * row-lvl calc. * aggregation calc. * table calc. * LOD expression . . . . . . . . . . . . . . . row-lvl calc.
82
What Calculation type is this: Running_sum(Sum(Revenu))
Hint: * row-lvl calc. * aggregation calc. * table calc. * LOD expression . . . . . . . . . . . . . . . Table calc
83
What Calculation type is this: Sum(Revenu)
Hint: * row-lvl calc. * aggregation calc. * table calc. * LOD expression . . . . . . . . . . . . . . . agg calc
84
What Calculation type is this: {FIXED [year]: SUM( [GDP] )}
Hint: * row-lvl calc. * aggregation calc. * table calc. * LOD expression . . . . . . . . . . . . . . . LOD Expression
85
Moving calculations require ____ family of functions & rely heavily ____ functions in a secondary calculation.
Moving calculations require **RUNNING** family of functions & rely heavily **WINDOW** functions in a secondary calculation.
86
Give an example of a result of a YOY Growth quick table calculation. Use in a sentence.
**-32%** and **1%** Bonus: this could mean: from Q1 lost **32%** of sales from 2018 to 2019 and increased by** 1%** from 2019 to 2020. | **Image 17**
87
Imagine a table with years in rows, quarters in columns, and sales in label. How would a YOY Growth quick table calculation change sales?
It calculates the percentage of growth (or loss) of sales in a Quarter from one year to the next. i.e. from Q1 lost 32% of sales from 2018 to 2019 and increased by 1% from 2019 to 2020. | **Image 17**
88
See Image 18. What does 11% mean? Note that the label, color, & columns have a YOY Growth quick calculation of SUM(Sales)
In Q1, there was an 11% increase in sales from 2020 to 2021 aka In Q1, there was an 11% increase in sales in 2021
89
YOY Growth quick calculation requires what type of date?
discrete date dimensions
90
Give an example of a result of a Compound Growth Rate quick table calculation
-8% Bonus: The CAGR of sales in 2020 is -8% | **Image 4**
91
Give an example of a result of a YTD Total quick table calculation
$860 Bonus: The YTD Total of sales in Q2 of 2020 is $860 | **Image 19**
92
Give an example of a result of a YTD Growth quick table calculation
59% Bonus: The YTD Growth of sales in Q2 of 2020 is 59% Can be negative can be over/under +/- 100%
93
# T/F By adjusting the YTD quick table calculation, you can also calculate MTD, QTD, etc.
True
94
The CGR quick caclulation uses only the previous period value in it's calculation
False The inputs for the CAGR calculation includes the final and first period value and the number of years. **Image 20** CGR measures the average annualized growth of a metric across a period (typically longer than 1 year) In essance, it provides **one aggregated number** that defines the **growth** for the **entire measurement period** For example (**in Image 4**) 32% represents the average compound annual growth rate over the previous three years, indicated on the chart with the red line, mainly driven by the spike in the last year
95
_____ Quick Calculation requires a discrete date dimension
YOY Growth I think YTD Growth & TYD Total too, but definitely **NOT** CGR
96
By adjusting the ____ quick table calculation, you can also calculate it by month.
YTD total/growth