Skip to main content

I have a calculated field as follow.

 

If [name]="TEST LEAD" then 0 else sum([Price])/100 end

 

I get the error "Cannot mix aggregate and non-aggregate comparisons or results in "if" expressions.

 

Does anyone know a workaround this?

4 answers
  1. Sep 17, 2014, 10:20 PM

    You tried:

     

    If attr([name])="TEST LEAD" then 0 else sum([Price])/100 end

     

    And Tableau threw the second error you described?  Can you post a screenshot showing your calculation window, or provide a packaged workbook example, as suggested by Seth?

     

    This looks like a calc that can also be easily replicated using the Superstore Sales dataset that ships with Tableau:

    You tried: If attr([name])=

0/9000