Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What does the LEFT(string, number) function do in Tableau?
It returns the first number of characters from the start (left side) of the string.
Click to reveal answer
beginner
How does the RIGHT(string, number) function work in Tableau?
It returns the last number of characters from the end (right side) of the string.
Click to reveal answer
beginner
What is the purpose of the CONTAINS(string, substring) function in Tableau?
It checks if the substring exists anywhere inside the string. It returns TRUE if found, otherwise FALSE.
Click to reveal answer
beginner
Write a Tableau formula to get the first 3 characters of a field called [ProductCode].
LEFT([ProductCode], 3)
Click to reveal answer
beginner
How can you check if the word 'Sale' appears in a field called [Description] in Tableau?
Use CONTAINS([Description], 'Sale') which returns TRUE if 'Sale' is found anywhere in [Description].
Click to reveal answer
What does RIGHT('Tableau', 4) return?
A'leau'
B'u'
C'eau'
D'blau'
✗ Incorrect
RIGHT('Tableau', 4) returns the last 4 characters: 'leau'.
Which function checks if a substring exists inside a string in Tableau?
ACONTAINS()
BRIGHT()
CLEFT()
DFIND()
✗ Incorrect
CONTAINS() returns TRUE if the substring is found inside the string.
What will LEFT('Dashboard', 5) return?
A'board'
B'boarda'
C'Dashb'
D'Dash'
✗ Incorrect
LEFT('Dashboard', 5) returns the first 5 characters: 'Dashb'.
If CONTAINS([Name], 'John') is FALSE, what does it mean?
A'John' is at the start of [Name]
B[Name] is empty
C'John' is at the end of [Name]
D'John' is not found anywhere in [Name]
✗ Incorrect
FALSE means the substring 'John' is not found anywhere in [Name].
Which function would you use to get the last 2 characters of a string?
ALEFT(string, 2)
BRIGHT(string, 2)
CCONTAINS(string, 2)
DMID(string, 2)
✗ Incorrect
RIGHT(string, 2) returns the last 2 characters of the string.
Explain how LEFT, RIGHT, and CONTAINS functions work in Tableau with simple examples.
Think about cutting a piece from the start or end of a word, and searching for a word inside a sentence.
You got /4 concepts.
Describe a real-life scenario where you might use the CONTAINS function in a Tableau report.
Imagine you want to find all sales that mention 'discount' in their notes.
You got /4 concepts.
Practice
(1/5)
1. What does the Tableau function LEFT('Tableau', 3) return?
easy
A. 'Tab'
B. 'bleau'
C. 'Table'
D. 'au'
Solution
Step 1: Understand LEFT function
The LEFT function extracts characters from the start of a string. Here, it extracts 3 characters from 'Tableau'.
Step 2: Extract first 3 characters
The first 3 characters of 'Tableau' are 'Tab'.
Final Answer:
'Tab' -> Option A
Quick Check:
LEFT('Tableau', 3) = 'Tab' [OK]
Hint: LEFT gets characters from the start of text [OK]
Common Mistakes:
Confusing LEFT with RIGHT function
Extracting more or fewer characters than specified
Assuming it extracts from the end
2. Which of the following is the correct syntax to check if the string 'Data' contains the letter 'a' in Tableau?
easy
A. LEFT('Data', 'a')
B. CONTAINS('Data', 'a')
C. CONTAINS('a', 'Data')
D. RIGHT('Data', 'a')
Solution
Step 1: Understand CONTAINS syntax
CONTAINS(text, substring) checks if substring exists in text. The first argument is the main text, second is what to find.
Step 2: Apply to given strings
To check if 'Data' contains 'a', use CONTAINS('Data', 'a').
Final Answer:
CONTAINS('Data', 'a') -> Option B
Quick Check:
CONTAINS('Data', 'a') = TRUE [OK]
Hint: CONTAINS(text, substring) order matters: text first [OK]
Common Mistakes:
Swapping the order of arguments in CONTAINS
Using LEFT or RIGHT instead of CONTAINS
Passing characters as numbers
3. What is the result of RIGHT('Analytics', 4) in Tableau?
medium
A. 'tics'
B. 'Anal'
C. 'ytic'
D. 'naly'
Solution
Step 1: Understand RIGHT function
RIGHT extracts characters from the end of a string. Here, it extracts 4 characters from 'Analytics'.
Step 2: Extract last 4 characters
The last 4 characters of 'Analytics' are 'tics'.
Final Answer:
'tics' -> Option A
Quick Check:
RIGHT('Analytics', 4) = 'tics' [OK]
Hint: RIGHT gets characters from the end of text [OK]
Common Mistakes:
Extracting characters from the start instead of end
Counting wrong number of characters
Confusing with LEFT function
4. You wrote the formula CONTAINS('Business', Business) in Tableau but it gives an error. What is the problem?
medium
A. The first argument should be a number
B. CONTAINS cannot be used with text
C. LEFT function should be used instead
D. Missing quotes around 'Business' in second argument
Solution
Step 1: Check CONTAINS argument types
CONTAINS requires both arguments to be text strings or fields. Here, second argument is missing quotes, so Tableau treats it as a field name.
Step 2: Fix by adding quotes
Adding quotes around 'Business' in second argument makes it a string literal, fixing the error.
Final Answer:
Missing quotes around 'Business' in second argument -> Option D
Quick Check:
CONTAINS('Business', 'Business') works [OK]
Hint: Always quote text strings inside CONTAINS [OK]
Common Mistakes:
Using unquoted text instead of string literals
Confusing CONTAINS with LEFT or RIGHT
Passing numbers instead of text
5. You want to create a calculated field in Tableau that returns TRUE if the first 2 letters of a product code are 'AB' and the code contains '123'. Which formula is correct?
hard
A. CONTAINS([Product Code], 'AB') AND LEFT([Product Code], 3) = '123'
B. RIGHT([Product Code], 2) = 'AB' OR CONTAINS('123', [Product Code])
C. LEFT([Product Code], 2) = 'AB' AND CONTAINS([Product Code], '123')
D. LEFT([Product Code], 2) = 'AB' AND CONTAINS('123', [Product Code])
Solution
Step 1: Check LEFT function usage
LEFT([Product Code], 2) extracts first 2 letters. We compare it to 'AB' to check the start.
Step 2: Check CONTAINS usage
CONTAINS([Product Code], '123') checks if '123' is anywhere in the code. The order is correct: main text first, substring second.
Step 3: Combine conditions with AND
Both conditions must be true, so use AND.
Final Answer:
LEFT([Product Code], 2) = 'AB' AND CONTAINS([Product Code], '123') -> Option C
Quick Check:
Correct syntax and logic = LEFT([Product Code], 2) = 'AB' AND CONTAINS([Product Code], '123') [OK]
Hint: Use LEFT for start, CONTAINS for anywhere, combine with AND [OK]