tableau-desktop

excel to Tableau Aggregation formula conversion


Can someone help me to convert the excel formula to use it in Tableau

=sum(aggr(SUM(distinct SALES_TEAM_SIZE),[SALES TEAM]))


Solution

  • In Tableau sums are automatically classified as aggregations.

    I am not entirely sure what you data looks like but based off your question I will assume that Sales Team Size is an integer and Sales Team is a varchar or text field.

    For simplicity of explanation I will describe this process by making three calculations:

    1. First lets make a calculation to get the distinct count of SALES_TEAM_SIZE and name it [dc_sales_team_size]:

      COUNTD([SALES_TEAM_SIZE])
      
    2. Now we'll make one to get the total number of SALES TEAM and call it [c_sales_team]

      COUNT([SALES TEAM])
      
    3. Create one last calculated field, name it [st_total] and add these two new fields together.

      [dc_sales_team_size] + [c_sales_team]
      

    Drag [st_total] to your worksheet.

    Read more on Tableau Aggregations here.