ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 72 - TDA-C01 discussion

Report
Export

You have the following dataset.

You want to create a new calculated dimension field named Category that meets the following conditions:

. When Subject is Computer Science or Science, Category must be Sciences.

. When Subject is English or Social Studies, Category must be Humanities.

Which two logical functions achieve the goal? Choose two.

A.
IF [Subject]- 'Science' THEN 'Sciences' ELSEIF [Subject]='English' THEN 'Humanities' ELSEIF [Subject]-'Social Studies' THEN 'Humanities' ELSEIF [Subject]= 'Computer Science' THEN 'Sciences' END
Answers
A.
IF [Subject]- 'Science' THEN 'Sciences' ELSEIF [Subject]='English' THEN 'Humanities' ELSEIF [Subject]-'Social Studies' THEN 'Humanities' ELSEIF [Subject]= 'Computer Science' THEN 'Sciences' END
B.
IIF(( CONTAINS ([Subject], 'Science') = TRUE) , 'Humanities', 'Sciences')
Answers
B.
IIF(( CONTAINS ([Subject], 'Science') = TRUE) , 'Humanities', 'Sciences')
C.
IF ENDSWITH ( [Subject], 'Computer Science') THEN 'Sciences' ELSE 'Humanities' END
Answers
C.
IF ENDSWITH ( [Subject], 'Computer Science') THEN 'Sciences' ELSE 'Humanities' END
D.
CASE [Subject] WHEN 'Computer Science' THEN 'Sciences' WHEN 'Science' THEN 'Sciences' WHEN 'English' THEN 'Humanities' WHEN 'Social Studies' THEN 'Humanities' End
Answers
D.
CASE [Subject] WHEN 'Computer Science' THEN 'Sciences' WHEN 'Science' THEN 'Sciences' WHEN 'English' THEN 'Humanities' WHEN 'Social Studies' THEN 'Humanities' End
Suggested answer: A, D

Explanation:

To create a new calculated dimension field named Category that meets the given conditions, you can use either the IF or the CASE logical function. Both functions allow you to evaluate an expression and return a value based on different scenarios. Option A uses the IF function with multiple ELSEIF clauses to check the value of the Subject field and assign it to either 'Sciences' or 'Humanities'. Option D uses the CASE function with multiple WHEN clauses to do the same thing. Both options will produce the same result, but the CASE function is more concise and easier to read. Option B is incorrect because it will assign 'Humanities' to any subject that contains 'Science' in its name, which is not the desired outcome. Option C is incorrect because it will only check if the subject ends with 'Computer Science' and ignore the other subjects.Reference:

Logical Functions - Tableau

Tableau Certified Data Analyst Study Guide

asked 23/09/2024
Tolga Kesici
48 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first