4 Replies Latest reply on Mar 12, 2012 3:52 AM by Daniel Thull

    Counting unique values -- why doesn't the formula work?

    Daniel Thull


      I've been researching on this topic for some time but can't seem to get to the bottom of it...


      I have data in an Excel file, so I cannot use the COUNTD method to calculate unique values in a long list. I was really glad when I found this thread. However, when I tried to use the provided formula with my data (see attached workbook) it didn't work.


      WINDOW_SUM(IIF(FIRST()==0, 1, IIF(ATTR([Brand])==LOOKUP(ATTR([Brand]), -1), 0, 1)))


      In Excel I found that I have 247 unique brands, in Tableau I cannot get this to work as it always counts the total number of rows. What am I doing wrong? Can anyone help?