8 Replies Latest reply on Nov 20, 2016 3:45 AM by Daniel Andersen

    How to translate sql "where" clause to Tableau calculated field

    Lin Chen

      Hi,

      I'm struggling with Tableau calculations, especially "where clause". I need to count "How many IDs with non-zero sales" in the following table (TableA for example).

      IDNameSales
      1Christian5000
      2Louis2000
      3John0
      4Tom0

       

      In MS SQL Server, I can write my query as:

      select count(ID)

      from tableA

      where Sales <> 0;

       

      In order to get the same result as this query, what formula I should create in Tableau? I know there is build-in aggregate function of COUNT in Tableau, but how to translate where clause into tableau language?

       

      Many thanks;)