nerdexam
Tableau

TDS-C01 · Question #126

You have the following string value: Sales Data. Which calculated field produces an output of Sales?

The correct answer is B. LEFT ("Sales Data", 5). LEFT("Sales Data", 5) extracts the first 5 characters from the left of the string, returning "Sales" - exactly the 5 characters S, a, l, e, s. Option A fails because LEFT requires two arguments: the string and the number of characters to extract, so it would produce an error…

Connecting to & Preparing Data

Question

You have the following string value: Sales Data. Which calculated field produces an output of Sales?

Exhibit

TDS-C01 question #126 exhibit

Options

  • ALEFT ("Sales Data")
  • BLEFT ("Sales Data", 5)
  • CLTRIM ("Sales Data")
  • DRTRIM ("Sales Data")

How the community answered

(28 responses)
  • A
    4% (1)
  • B
    89% (25)
  • D
    7% (2)

Explanation

LEFT("Sales Data", 5) extracts the first 5 characters from the left of the string, returning "Sales" - exactly the 5 characters S, a, l, e, s. Option A fails because LEFT requires two arguments: the string and the number of characters to extract, so it would produce an error. Options C and D (LTRIM/RTRIM) are trim functions that remove leading or trailing whitespace respectively - neither removes the word " Data" from the string. A useful memory tip: think of LEFT(string, n) as "give me the first n characters from the left" - always count your target characters before the exam to confirm the number argument.

Topics

#LEFT function#string functions#calculated fields#text parsing

Community Discussion

No community discussion yet for this question.

Full TDS-C01 Practice