2 Replies Latest reply on Oct 26, 2016 4:46 AM by Rafael Godoy

    Problems creating a calculation using Tableau Extract

    Rafael Godoy

      Hi All.


      I've the scenario below:



      I need to use all lines that I've to calculated the metric  my_sales, but i can't use this to calculate the global sales...The sum(distinct global_sales) is not possible, because, i can't remove duplicate values without the dimensions...


      I would like to use, in this example:

      To calculate the global metric:

      Execute this query select distinct category,place,Sales_category from all_sales where place  = 'Shopping A' and Category = 'Tablet'


      After ran this query the result is = Shopping A, Tablet, 200 (Excluding duplicate values)


      To calculate the My Sales:


      select sum(sales) from all_sales where place  = 'Shopping A' and Category = 'Tablet' .


      (In this case i need to sum all values of sales that I've on data set)



      How can I do it using Tableau extract?