Tableau - Displaying null rate

39 Views Asked by At

I have pulled a table in to tableau with these dimensions: [TapeID], [Address], and [State]. I want to create a text table. In the first column of the text table I want to list the contents of the TapeID dimension as many times as there are other dimensions (excluding TapeID dimension). So in my case the distinct items will be listed twice.

The second column should list the matching column names
The third column should list the total records per items in TapeID
The fourth column should list the null count in the [Address] and [State] dimension

NOTE
The table is an SQL Server table for which I do not have altering or insertion permissions. So everything should be done in Tableau. Thank you

Original Table

TapeID Address State
156 Null TN
156 Null KY
156 O Lane Null
753 J Lane Null
753 F Cir Null
753 W Blvd MI
951 Jh St CA

This is the text table I am trying to create in tableau

TapeID Field_Name Total_Record Null_Count
156 Address 3 2
156 State 3 1
753 Address 3 0
753 State 3 2
951 Address 1 0
951 State 1 0
1

There are 1 best solutions below

0
On

You can form your result using the following information:

  • COUNT(Table Name) returns the number of data records
  • COUNT(Field Name) returns the number of records that have a value for the specified field.
  • The difference of course would be the number of records with a null value for the specified field.

Finally,

  • COUNTD(Field Name) returns the number of distinct values that appear in the specified field.