0
0
Tableaubi_tool~20 mins

Type conversion functions in Tableau - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Type Conversion Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
1:30remaining
Output of INT() conversion in Tableau
What is the output of the following Tableau calculated field?

INT("123.99")

Assume the input is a string and INT() converts it to an integer.
Tableau
INT("123.99")
A123
B124
C123.99
DError: Cannot convert string with decimal to INT
Attempts:
2 left
💡 Hint
INT() truncates decimal parts after converting to number.
visualization
intermediate
1:30remaining
Visualizing type conversion impact on data
You have a dataset with a field 'Sales' stored as string values like '1000', '2000', '3000'. You want to create a bar chart showing total sales.

Which Tableau calculated field should you use to correctly sum sales as numbers?
ASUM(STR([Sales]))
BSUM([Sales])
CSUM(INT([Sales]))
DSUM(FLOAT([Sales]))
Attempts:
2 left
💡 Hint
Sales values have decimals possible, so use a conversion that supports decimals.
🧠 Conceptual
advanced
2:00remaining
Understanding type conversion errors in Tableau
Which of the following scenarios will cause a type conversion error in Tableau when using INT() or FLOAT() functions?
AConverting a number 123 to INT()
BConverting a string 'abc123' to INT()
CConverting a string '123.45' to FLOAT()
DConverting a string '1000' to FLOAT()
Attempts:
2 left
💡 Hint
Think about what strings can be converted to numbers.
data_modeling
advanced
2:00remaining
Choosing correct type conversion for date calculations
You have a string field 'OrderDate' in format '2023-06-15'. You want to calculate the number of days since this date.

Which Tableau calculated field correctly converts 'OrderDate' to a date type for this calculation?
ADATEDIFF("day", STR([OrderDate]), TODAY())
BDATEDIFF("day", INT([OrderDate]), TODAY())
CDATEDIFF("day", DATE([OrderDate]), TODAY())
DDATEDIFF("day", FLOAT([OrderDate]), TODAY())
Attempts:
2 left
💡 Hint
Dates must be converted to date type, not numbers or strings.
🔧 Formula Fix
expert
2:30remaining
Debugging type conversion in nested calculations
Given the Tableau calculated field:

IF INT([Score]) > 50 THEN "Pass" ELSE "Fail" END

Which issue will cause this calculation to fail or produce incorrect results?
Tableau
IF INT([Score]) > 50 THEN "Pass" ELSE "Fail" END
AIf [Score] contains null or non-numeric strings, INT() will cause an error
BComparison operator '>' is invalid in Tableau calculated fields
CThe ELSE clause is missing a return value causing syntax error
DINT() converts decimals correctly, so no issues expected
Attempts:
2 left
💡 Hint
Consider what happens if input is not a clean number string.