Courseiva
Data Preparation →hardMultiple Choice

Alteryx-Core Data Preparation Practice Question

Exhibit

Error: Formula (12): Parse Error at char 45: The field 'Sales' contains a string, but the expression requires a numeric value.

Refer to the exhibit. You are receiving this error while trying to calculate a margin percentage. What is the most likely cause and solution?

⚠ Common exam trap

Candidates often try to fix type errors by using the 'ToNumber()' function inside the Formula tool. While this works, it is better practice to fix the source type using the Select tool first.

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

✓

Use the Select tool to change 'Sales' to a numeric type

The error indicates a type mismatch. Alteryx is strongly typed; arithmetic operations require numeric fields. Even if the 'Sales' column appears to be a number, it is currently stored as a String, preventing the formula engine from performing calculations. Converting the type before the calculation is required for the engine to treat the data as integers or floats, allowing mathematical operations to proceed successfully without runtime errors.

Answer analysis

Option-by-option breakdown

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

  • ✗

    The formula requires an IF statement to handle negative values.

    Why it's wrong here

    The error message specifically references a type mismatch between a string and a numeric requirement. Adding an IF statement would not resolve the underlying data type issue, as the engine would still encounter the string value when evaluating the mathematical expression, causing the same error to persist.

  • ✓

    Use the Select tool to change 'Sales' to a numeric type

    Why this is correct

    The Select tool is the standard method for changing field types. By changing 'Sales' to Double or Integer, the Formula tool will recognize the data as numeric. This is the most efficient and readable way to fix type errors in an Alteryx workflow prior to calculation.

  • ✗

    The formula needs to be wrapped in a ToNumber() function

    Why it's wrong here

    While ToNumber() inside the Formula tool could convert the string, it is often better practice to cast data types at the schema level using the Select tool. This keeps the Formula tool logic clean and improves performance by ensuring the data is correctly typed upstream of the calculation.

  • ✗

    The 'Sales' column has hidden characters that must be trimmed

    Why it's wrong here

    Trimming whitespace only removes leading or trailing spaces; it does not change the data type of the field. If the field is defined as a string, it will remain a string after trimming, and the formula engine will continue to reject the non-numeric data type provided.

About these practice questions

One of 142 original Alteryx-Core practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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 Alteryx exam blueprint

This Alteryx-Core practice question is part of Courseiva's free Alteryx 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 Alteryx-Core exam.