Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in BI by (17.6k points)

I have a tableau data grid that I need to count distinct records. If the status is Complete distinct count the RecordID

  IF [Status] = "COMPLETE" THEN COUNTD([Survey ID]) ELSE 0 END)

 But I am getting an error "Cannot mix aggregate and non-aggregate comparisons or results in IF expression". Any ideas? 

1 Answer

0 votes
by (47.2k points)
  • You just need to rearrange the order of things.


  • This results by returning a Survey ID if the Status is 'COMPLETE' otherwise it will return a NULL to the COUNTD function. NULLs are ignored, so they won't be counted.

Intellipaat offers Tableau Training for the learners to master advanced visualization tools. 

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94k users

Browse Categories