I'm not sure I exactly follow what you want. In a sense, you are getting the distinct values for any dimension that you place on the Row or Columns and then an aggregation of any measures. The actual query generated by Tableau is more likely a GROUP BY instead of SELECT DISTINCT -- but ultimately the result is a distinct list of dimension values.
But maybe I'm not understanding your requirement. If so, can you provide an example?
I have multiple tables in my query and I need to get the distinct of the result set (I do not have a way to bring in unique records using joins because of the nature of the data I am dealing with) before Tableau can apply group by in order to avoid double counting of some of the measures.
I am bringing in results at most granular level in order to support my other count(distinct) calculations in the same report.
Please find sample data and expected result below.
Sample Data Contact_ID Indiv_id MRR division 1 111 $50 Div-1 1 111 $50 Div-1 2 112 $40 Div-1 3 113 $30 Div-2 4 114 $20 Div-3 4 114 $20 Div-3 Need to get distinct rows from above data and then sum MRR across distinct rows Expected Result MRR Division MRR Div-1 90 Div-2 30 Div-3 20
See the attached. I created a calculated field called "WS Avg MRR" using the formula WINDOW_SUM(AVG(MRR)) with some optimizations. The view is set up with division on Rows, with Contact_ID, and Indiv_id (i.e. all the other fields that define a distinct "row" in the data) on the Level of Detail Shelf. Then the WS Avg MRR field is set up with an Advanced... Compute Using of division, Contact_ID, and Indiv_ID on the right-hand side of the Advanced dialog, with Restarting every set to division.
This causes Tableau to create a "set" of the distinct values of the three fields, and restart the partitioning for each new value of division.