Courseiva
Data Analysis →hardMultiple Choice

DA0-002 Data Analysis Practice Question

A data analyst at an e-commerce company is profiling a transactions table with ten million rows. The 'order_total' column is stored as text and contains values like '$1,299.00', a few entries of 'N/A', and several negative amounts that represent refunds. The analyst must produce a numeric column suitable for summation in a revenue report. Which sequence of operations best prepares the column?

⚠ Common exam trap

The trap here is trusting an implicit cast to clean currency-formatted text, when the dollar signs, commas, and 'N/A' entries actually cause errors or silent nulls that understate revenue.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Strip the currency symbol and thousands separators, convert non-numeric entries to null or a flagged value, preserve negative signs for refunds, then cast to decimal.

The column mixes formatting characters, non-numeric placeholders, and meaningful negative values. A robust cleanup removes currency symbols and separators, explicitly maps invalid entries to nulls or a flagged value, retains the negative sign for refunds, and then casts to a decimal type. Direct casting and character-stripping shortcuts either lose rows silently or corrupt the sign and precision of the amounts.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Strip the currency symbol and thousands separators, convert non-numeric entries to null or a flagged value, preserve negative signs for refunds, then cast to decimal.

    Why this is correct

    This sequence removes formatting characters that block conversion, explicitly handles the 'N/A' entries rather than letting them fail silently, keeps negative amounts so refunds reduce revenue correctly, and performs a deliberate cast to a numeric type. It also leaves a clear audit trail of which rows were invalid, which matters when the summed total feeds a financial report.

  • ✗

    Cast the column directly to a decimal type, letting the database coerce invalid strings to nulls.

    Why it's wrong here

    An implicit cast will fail or silently null out the currency-formatted values and the 'N/A' entries. Currency symbols and thousands separators are not valid numeric characters in most engines, so the cast either raises an error or quietly produces nulls that understate revenue. Even if it succeeds, the analyst never inspects what was lost, which is unacceptable for a financial report.

  • ✗

    Replace all non-numeric characters with zeros, then sum the column as text.

    Why it's wrong here

    Replacing characters with zeros would turn '$1,299.00' into a nonsense value and erase the distinction between a refund and a positive sale. Summing text values relies on implicit coercion, which varies by platform and can silently truncate at the first non-numeric character. This approach corrupts the amounts and produces a revenue figure that is both wrong and unauditable.

  • ✗

    Take the absolute value of every entry first, then remove the dollar signs and cast to integer.

    Why it's wrong here

    Applying absolute value destroys the refund information, so negative transactions would inflate revenue instead of reducing it. Casting to integer also truncates the cents, introducing systematic rounding error across ten million rows. The combination silently misstates both the direction and the precision of the financial data, which is precisely what the revenue report must avoid.

About these practice questions

Courseiva writes every DA0-002 question from scratch — 1,004 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

This DA0-002 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DA0-002 exam.