ExamGecko
Question list
Search
Search

Question 194 - SPLK-1002 discussion

Report
Export

If there are fields in the data with values that are ' ' or empty but not null, which of the following would add a value?

A.
| eval notNULL = if(isnull (notNULL), ''0'' notNULL)
Answers
A.
| eval notNULL = if(isnull (notNULL), ''0'' notNULL)
B.
| eval notNULL = if(isnull (notNULL), ''0''
Answers
B.
| eval notNULL = if(isnull (notNULL), ''0''
C.
| eval notNULL = '''' | nullfill value=0 notNULL
Answers
C.
| eval notNULL = '''' | nullfill value=0 notNULL
D.
| eval notNULL = '''' fillnull value=0 notNULL
Answers
D.
| eval notNULL = '''' fillnull value=0 notNULL
Suggested answer: D

Explanation:

The correct answer is D. | eval notNULL = '''' fillnull value=0 notNULL

Option A is incorrect because it is missing a comma between the ''0'' and the notNULL in the if function. The correct syntax for the if function is if (condition, true_value, false_value).

Option B is incorrect because it is missing the false_value argument in the if function. The correct syntax for the if function is if (condition, true_value, false_value).

Option C is incorrect because it uses the nullfill command, which only replaces null values, not empty strings. The nullfill command is equivalent to fillnull value=null.

Option D is correct because it uses the eval command to assign an empty string to the notNULL field, and then uses the fillnull command to replace the empty string with a zero. The fillnull command can replace any value with a specified replacement, not just null values.

asked 23/09/2024
Mashudu Abraham
34 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first