Trying to create new calculated field

I am trying to create a new calculated field that involves a parameter, the parameter is called TaxStatus and data type is string with static values Subject to AMT, Tax Exempt, and Taxable. I attempted to create a calculated field called selected_tax_status_amount all the columns are named correctly and Total Volume is a column that was renamed.
ifelse(

${TaxStatus} = “Taxable”,

ifelse(

({srs_mstr_fdrl_txbl_flag} = 1) OR ({srs_mstr_st_txbl_flag} = 1),

{Total Volume},

0.0

),

ifelse(

${TaxStatus} = "Tax Exempt",

ifelse(

  ({srs_mstr_fdrl_txbl_flag} = 0) AND ({srs_mstr_st_txbl_flag} = 0),

  {Total Volume},

  0.0

),

ifelse(

  ({srs_mstr_fdrl_alt_min_tax_flag} = 1) OR ({srs_mstr_st_alt_min_tax_flag} = 1),

  {Total Volume},

  0.0

)

)

)

error i am getting: Expression {{argumentName}} for function {{functionName}} has incorrect argument type {{incorrectArgumentType}}. Function syntax expects {{functionSignature}}.

ifelse(
  ${TaxStatus} = "Taxable",
  ifelse(
    ({srs_mstr_fdrl_txbl_flag} = 1) OR ({srs_mstr_st_txbl_flag} = 1),
    {Total Volume},
    0.0
  ),
  ifelse(
    ${TaxStatus} = "Tax Exempt",
    ifelse(
      ({srs_mstr_fdrl_txbl_flag} = 0) AND ({srs_mstr_st_txbl_flag} = 0),
      {Total Volume},
      0.0
    ),
    ifelse(
      ({srs_mstr_fdrl_alt_min_tax_flag} = 1) OR ({srs_mstr_st_alt_min_tax_flag} = 1),
      {Total Volume},
      0.0
    )
  )
)

The error

“Expression {{argumentName}} for function {{functionName}} has incorrect argument type {{incorrectArgumentType}}. Function syntax expects {{functionSignature}}”

indicates a data type mismatch.

This error typically occurs when:

1. Fields appear numeric but are actually strings in the dataset

2. Mixed data types in comparisons or operations

3. Parameter vs field type mismatches

Check field data types:

  • Verify that {srs_mstr_fdrl_txbl_flag}, {srs_mstr_st_txbl_flag}, etc. are actually Integer or Decimal types, not String
  • Check {Total Volume} is numeric type

Test components individually:

{srs_mstr_fdrl_txbl_flag} = 1

Then:

({srs_mstr_fdrl_txbl_flag} = 1) OR ({srs_mstr_st_txbl_flag} = 1)

Fix data types:

If fields are strings, use parseInt() or parseDecimal():

ifelse( ${TaxStatus} = “Taxable”,

ifelse( (parseInt({srs_mstr_fdrl_txbl_flag}) = 1) OR (parseInt({srs_mstr_st_txbl_flag}) = 1), 

    {Total Volume}, 0.0 ), 

...

e.g.

ifelse( 
    ${TaxStatus} = "Taxable", 
    ifelse( 
        (parseInt({srs_mstr_fdrl_txbl_flag}) = 1) OR (parseInt({srs_mstr_st_txbl_flag}) = 1), 
        {Total Volume}, 
        0.0 
    ), 
    ifelse( 
        ${TaxStatus} = "Tax Exempt", 
        ifelse( 
            (parseInt({srs_mstr_fdrl_txbl_flag}) = 0) AND (parseInt({srs_mstr_st_txbl_flag}) = 0), 
            {Total Volume}, 
            0.0 
        ), 
        ifelse( 
            (parseInt({srs_mstr_fdrl_alt_min_tax_flag}) = 1) OR (parseInt({srs_mstr_st_alt_min_tax_flag}) = 1), 
            {Total Volume}, 
            0.0 
        ) 
    ) 
)

Verified that {srs_mstr_fdrl_txbl_flag}, {srs_mstr_st_txbl_flag} are integer data types , and also checked Total Volume is a decimal data type. also tested component individually was able to create a calculated field called Taxable - ifelse(({srs_mstr_fdrl_txbl_flag} = 1) OR ({srs_mstr_st_txbl_flag} = 1), {Total Volume}, 0.0)
error still persists

Hi @izzycs,

Hope everything is well with you! Just checking back in since this thread hasn’t received a response in a while. Were you able to find a workaround to your question in the meantime or are you still facing persistent issues? If we do not hear back within the next 3 business days, I’ll go ahead and close out of this topic.

Thank you!

Hi @izzycs,

Since we not heard back, I’ll go ahead and close this topic. However, if you have any additional questions, please feel free to post again in the Quick Suite Community and link this thread for any relevant information.