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

Hi all. I’m trying to create something equivalent to a “metric_name” drop down filter that has the values “# of asins overall”, “# of approved ASINS” and once we filter it from the drop down, only those rows show up? # of asins overall", # of approved ASINS are all existing calculated fields in my pivot table.

I tried:
ifelse(‘# of asins overall’ = ${MetricSelector2}, {#_of_asins_overall},
ifelse(‘# of Approved asins’ = ${MetricSelector2}, {# of Approved asins},
ifelse(‘# of asins Enforced - Under Review’ = ${MetricSelector2}, {# of asins Enforced - Under Review},
‘NA’)))

but keep running into an error:
still running into the same error -Expression {{argumentName}} for function {{functionName}} has incorrect argument type {{incorrectArgumentType}}. Function syntax expects {{functionSignature}}.

MetricSelector2 is a string parameter

Thank you in advance.

Hi @ayzaish and welcome to the Quick Sight community!
You shouldn’t need to add ‘ifelse’ in front of each expression, so what if you tried removing the 2nd and 3rd ‘ifelse’:

Also, try switching the objects on each side of the =, so the overall expression may look more like:

ifelse(${MetricSelector2} = ‘# of asins overall’, {#_of_asins_overall},
         ${MetricSelector2} = ‘# of Approved asins’, {# of Approved asins},
         ${MetricSelector2} = ‘# of asins Enforced - Under Review’, {# of asins Enforced - Under Review},
‘NA’)

Let me know if this helps with your case or if you have any additional questions!