4 Replies Latest reply on Jul 13, 2018 8:55 AM by suman kumar

    Error "Cannot mix aggregate and non-aggregate comparisons or results in 'IF' expressions

    saurabh.jain.29

      Hi,

      I’m new to Tableau and am slowly getting to grips with it. I am trying to calculate efficiency for the current year using the below mentioned calculated field but it is throwing an error of aggregate and non-aggregate comparisons which kind of makes sense so I tried putting ATTR in front of  YEAR([Date] but then it returns null. So, I am quite confused.

       

      It would be great if anyone can give me a direction for the same.

       

      PS: Sorry if you found the question silly

       

      IF (YEAR([Date])) = 2018

       

      THEN ([Company LE])

       

      END