Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Tableau Exam TCC-C01 Topic 4 Question 8 Discussion

Actual exam question for Tableau's TCC-C01 exam
Question #: 8
Topic #: 4
[All TCC-C01 Questions]

A client wants to count all the distinct orders placed in 2010. They have written the following calculation, but the result is incorrect.

IF YEAR([Date])=2010 THEN COUNTD ([OrderID]) END

Which calculation will produce the correct result?

Show Suggested Answer Hide Answer
Suggested Answer: C

The correct calculation to count all distinct orders placed in 2010 involves placing the conditional inside the aggregation function, not the other way around. Here's how to correct the client's calculation:

Original Calculation Issue: The client's original calculation attempts to apply the COUNTD function within an IF statement, which does not work as expected because the COUNTD function cannot conditionally count within the scope of the IF statement.

Correct Calculation: COUNTD(IF YEAR([Date]) = 2010 THEN [OrderID] END). This calculation checks each order date; if the year is 2010, it returns the OrderID. The COUNTD function then counts all unique OrderIDs that meet this condition.

Why It Works: This method ensures that each order is first checked for the year condition before being counted, effectively filtering and counting in one step. It efficiently processes the data by focusing the distinct count operation only on relevant records.

Reference This approach is consistent with Tableau's guidance on using conditional logic inside aggregation functions for accurate and efficient data calculations, as detailed in the Tableau User Guide under 'Aggregations and Calculations'.


Contribute your Thoughts:

Thersa
15 days ago
Option A is trying to be all fancy with that WINDOW_COUNTD function, but I'm not buying it. Keep it simple, right? Option C is the way to go, no doubt about it.
upvoted 0 times
...
Stephaine
20 days ago
Wait, is this a trick question? What if the client wants the total number of orders, not just the distinct ones? Option D might be the way to go then. Better safe than sorry, you know?
upvoted 0 times
...
Malissa
22 days ago
Haha, Option D is just straight-up counting the number of order IDs, not the distinct ones. Rookie mistake there, guys. I'm going with Option C, it's the only one that actually counts the distinct orders.
upvoted 0 times
Eun
15 days ago
Yeah, Option D is just counting the total number of orders, not the distinct ones. Option C is the way to go.
upvoted 0 times
...
Tamra
18 days ago
I agree, Option C is the correct one. It counts the distinct orders based on the condition.
upvoted 0 times
...
...
Isabelle
1 months ago
Why do you think D is correct?
upvoted 0 times
...
Dusti
1 months ago
I disagree, I believe the correct answer is D.
upvoted 0 times
...
Isabelle
1 months ago
I think the correct answer is C.
upvoted 0 times
...
Brendan
1 months ago
Hmm, I'm not sure about that. Option B might be the way to go - it seems to be counting the distinct order IDs for the entire year of 2010, which is what the question is asking for. Plus, it has those curly braces, which always make things look more impressive.
upvoted 0 times
Viki
16 days ago
User 2: Yeah, I agree. The curly braces make it look more official too.
upvoted 0 times
...
Earleen
24 days ago
User 1: I think Option B is the correct one. It counts the distinct order IDs for the year 2010.
upvoted 0 times
...
...
Afton
1 months ago
The issue with the original calculation is that it's only counting the distinct order IDs for each individual year, not across the entire year of 2010. Option C looks like the way to go here.
upvoted 0 times
Nicolette
10 days ago
Great, I'll use Option C for the calculation. Thanks for the help!
upvoted 0 times
...
Margurite
11 days ago
That makes sense. Option C considers the year 2010 as a whole, not just individual years.
upvoted 0 times
...
Glendora
13 days ago
Option C is correct. It will count all distinct orders placed in 2010.
upvoted 0 times
...
...
MonBouj
2 months ago
Option C is the best choice as it correctly applies the filtering logic first and then counts distinct orders effectively.
upvoted 1 times
...

Save Cancel