SPLK-1002 Exam QuestionsBrowse all questions from this exam

SPLK-1002 Exam - Question 34


A user wants to convert numeric field values to strings and also to sort on those values.

Which command should be used first, the eval or the sort?

Show Answer
Correct Answer: B

When converting numeric field values to strings and then sorting, it is essential first to convert the numeric values to strings using the eval command. This is because sorting alphanumeric strings directly ensures they will be sorted in the correct order intended for strings. If you sort numerically first and then convert to strings, it could disrupt the intended sort order since the primary goal is to work with the string representation. Therefore, first converting to strings with eval and then sorting is the correct approach.

Discussion

17 comments
Sign in to comment
okseyOption: C
Aug 31, 2020

Use sort first, then convert the numeric to a string with eval. C

mybox1Option: C
Nov 3, 2020

To order numerically, first sort, then use eval - page 107

MxQ3
Jun 24, 2022

This is correct

emlchOption: B
Jun 19, 2022

If you convert to a string first you will have this kind of ordenation: 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21...

mikey_76Option: B
Sep 2, 2021

the logical answer is C, sorting the numbers first and then converting to string. However the wording of the questions make it sound like they want to convert first and then sort alphanumerically so B is the answer. The wording on the question needs to be more clear

SasnycoNOption: A
Nov 18, 2021

I think it's A as It doesn't matter if you are soring before or after as they are all numeric fields and the resutls will be the same.

RoVasq3Option: C
Mar 18, 2022

Answer is C

HarrysaOption: B
Apr 21, 2023

C is wrong becasue If you use the sort command first and then the eval command, you need to ensure that the sort command is sorting the values in the desired way (i.e., as strings rather than numerically), and you need to use the str function within the sort command to force it to treat the values as strings. This can make the command more complicated and increase the likelihood of errors.

BianchiOption: C
Aug 1, 2021

Why would you sort values in an alpha-numeric way? that's not logit, that said, you sort first, then eval. Fund 2 Page 104 (c) sort first then eval

teems5ukOption: C
Sep 19, 2021

Fun2(page ) justifies option C

[Removed]Option: C
Apr 21, 2022

Answer is C, sort first. Always.

fsanchezsOption: C
Apr 25, 2022

The answer is C

Nicker9Option: C
Jul 10, 2022

You have to sort first and then convert to a string. So Answer C.

jdestinobleOption: C
Aug 3, 2022

C is correct

TestingAccount900Option: C
Sep 22, 2022

C is correct

solomoneOption: C
Apr 10, 2023

Sort numerically first always.

mohanmk95Option: C
Apr 28, 2023

need to be sort out in numeric format only

jsk46Option: A
Sep 14, 2023

B and C return the same result so the correct anws is A