New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Analytics-Con-301 Exam - Topic 5 Question 7 Discussion

Actual exam question for Salesforce's Analytics-Con-301 exam
Question #: 7
Topic #: 5
[All Analytics-Con-301 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.

References 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:

0/2000 characters
Catarina
3 days ago
Wait, why isn't A valid? That seems like it should work too.
upvoted 0 times
...
Lavina
8 days ago
I think B is the right choice. It uses the correct syntax!
upvoted 0 times
...
Dick
13 days ago
Option C looks solid for counting distinct orders in 2010.
upvoted 0 times
...
Truman
18 days ago
Wait, is WINDOW_COUNTD even a real function? I'm not sure about that one.
upvoted 0 times
...
Wynell
24 days ago
Haha, option D is like counting apples and oranges together. That's not what the client wants.
upvoted 0 times
...
Karan
29 days ago
I'm a bit confused. Shouldn't we be using WINDOW_COUNTD instead of COUNTD? That's what option A suggests.
upvoted 0 times
...
Bo
1 month ago
I feel like option B might be incorrect because it uses a fixed count instead of counting distinct orders directly. I think C is more straightforward.
upvoted 0 times
...
Penney
1 month ago
I’m a bit confused about the difference between COUNTD and WINDOW_COUNTD. I feel like I’ve seen both in practice questions, but I can’t recall which one applies here.
upvoted 0 times
...
Jesse
1 month ago
I think option C sounds familiar because it uses COUNTD with a conditional statement, which might be what we need to get distinct orders for 2010.
upvoted 0 times
...
Leontine
2 months ago
I remember we practiced a similar question where we had to filter by year, but I’m not sure if using COUNTD directly is the right approach here.
upvoted 0 times
...
Antonio
2 months ago
Tricky question! I'm going to try working through each option step-by-step to make sure I understand what they're doing.
upvoted 0 times
...
Julene
2 months ago
I'm feeling pretty confident about this one. I think option C is the way to go - it should give us the distinct order count for the entire year 2010.
upvoted 0 times
...
Carli
2 months ago
I think option C is the best.
upvoted 0 times
...
Nicolette
2 months ago
I'm a bit confused by the different options. I'll need to review the definitions of WINDOW_COUNTD, COUNTD, and COUNT to figure out which one will give the correct result.
upvoted 0 times
...
Malissa
3 months ago
Option C looks good to me. Counting distinct order IDs for the year 2010 should do the trick.
upvoted 0 times
...
Ena
3 months ago
I agree with C, it's straightforward and effective.
upvoted 0 times
...
Justine
3 months ago
Option B has some extra curly braces, which seems unnecessary. I'd go with option C.
upvoted 0 times
...
Eleonora
3 months ago
Okay, I think I see the issue. The original calculation is only counting distinct orders for each year, not across the entire year.
upvoted 0 times
...
Thea
3 months ago
Hmm, this looks tricky. I'll need to think through the difference between COUNTD and COUNT carefully.
upvoted 0 times
...

Save Cancel