3 Replies Latest reply on Apr 30, 2018 4:46 AM by Kapil Dks

    Need help on SQL Query Logic into Tableau Calculation?

    Kapil Dks

      Hi,

       

      I need to achieve following SQL logic in Tableau Calculation.

       

      SQL : CASE WHEN Product IN ('Samsung') THEN SUM(CASE WHEN Summary= 'AA' AND SummaryStatus= 'BB' THEN Qty ELSE 0 END) ELSE Count(DISTINCT ID) END  As "Result"

       

      This is part of my query. Whole query returns following output.

       

      ProductDistinct Qty

      Sum Of Qty

      Result

      Sony5105
      Samsung1400400
      Airtel121

       

      Above result are my expected result. Could please help me on the "Tableau Calculation"?