0
0
Tableaubi_tool~20 mins

String functions (LEFT, RIGHT, CONTAINS) in Tableau - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
String Functions Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
Extracting Left Part of a String
Given a field ProductCode with values like 'AB12345', which Tableau calculation correctly extracts the first two characters?
ARIGHT([ProductCode], 2)
BCONTAINS([ProductCode], 2)
CLEFT([ProductCode], 2)
DLEFT([ProductCode], -2)
Attempts:
2 left
💡 Hint
Think about which function extracts characters from the start of the string.
visualization
intermediate
2:00remaining
Highlighting Rows Containing a Substring
You want to highlight all rows where the CustomerName contains the substring 'Smith'. Which calculated field formula will return TRUE for those rows?
ALEFT([CustomerName], 'Smith')
BCONTAINS([CustomerName], 'Smith')
CRIGHT([CustomerName], 5) = 'Smith'
DCONTAINS('Smith', [CustomerName])
Attempts:
2 left
💡 Hint
CONTAINS checks if the first argument string includes the second argument substring.
🧠 Conceptual
advanced
2:00remaining
Understanding RIGHT Function Behavior
What will the expression RIGHT('DataScience', 4) return in Tableau?
A'ence'
B'Scie'
C'enceScience'
DError: Invalid argument
Attempts:
2 left
💡 Hint
RIGHT extracts characters from the end of the string.
🔧 Formula Fix
advanced
2:00remaining
Identify the Error in String Function Usage
Which option will cause an error when used as a calculated field in Tableau?
ALEFT([OrderID], -1)
BLEFT([OrderID], 3)
CCONTAINS([OrderID], '')
DRIGHT([OrderID], 0)
Attempts:
2 left
💡 Hint
Check if negative length arguments are allowed in LEFT or RIGHT functions.
🎯 Scenario
expert
3:00remaining
Combining String Functions for Conditional Labeling
You have a field EmployeeID with values like 'EMP2023X'. You want to create a calculated field that returns 'Senior' if the last character is 'X', otherwise 'Junior'. Which formula achieves this?
AIF CONTAINS([EmployeeID], 'X') THEN 'Senior' ELSE 'Junior' END
BIF LEFT([EmployeeID], 1) = 'X' THEN 'Senior' ELSE 'Junior' END
CIF RIGHT([EmployeeID], 2) = 'X' THEN 'Senior' ELSE 'Junior' END
DIF RIGHT([EmployeeID], 1) = 'X' THEN 'Senior' ELSE 'Junior' END
Attempts:
2 left
💡 Hint
Check which function extracts the last character and compare it to 'X'.