Show 0 if value has no data - Tableau

+1 vote
I need to classify my dataset into groups depending on sales and store wise details. I'm fetching my data from the database, so it contains null or empty values. How to replace them with 0 for calculation purpose.

How to display 0 if there is no data (null or empty) corresponding to that field in a row?
Apr 24, 2019 in Tableau by abhay
45,554 views

4 answers to this question.

+1 vote

Hi Abhay,

To replace null or empty values you can use ZN() or ISNULL() to check and show 0.

Using ZN() - 

ZN function is used to return 0 or not null values for a column. It takes a field as a parameter.

ZN([Phone No]) would return phone no if or null else gives 0.

Using ISNULL() -

 ISNULL([Field] returns true if value is NULL.

Hope this helps you.

answered Apr 24, 2019 by Cherukuri
• 32,930 points
What if the cells are BLANK and not NULL?
Aren't blank cells considered null?
A null value is not the same a blank.  Null means it is void of anything, whereas blank means it is space.
0 votes

Now you want the cells without data with "0" right.

  1. drop category filed into columns.
  2. create a duplicate for catgeory filed in data pane.
  3. drag the duplicated filed into rows.
  4. Now drag the "lookup with ZN" calculated filed which you created in first filed to text. now you see that the empty cells are populated with zero.
answered Dec 10, 2020 by Gitika
• 65,870 points
0 votes

Option 1: Display Zeros as Blanks

  1. From the Data pane (where the Dimensions and Measures are displayed), right-click the field that you want to format, and then select Default Properties > Number Format.
  2. Select Custom, enter #,##0.000; -#,##0.000;"", and then click OK.
answered Dec 10, 2020 by Rajiv
• 8,880 points
0 votes

Method 2

  1. Select the range with empty cells.
  2. Press Ctrl + H to display the Find & Replace dialog box.
  3. Move to the Replace tab in the dialog.
  4. Leave the Find what field blank and enter the necessary value in the Replace with a text box.
  5. Click Replace All.
answered Dec 10, 2020 by Roshni
• 10,420 points

Related Questions In Tableau

0 votes
1 answer
0 votes
1 answer

How to use tableau to searh for text within entire data

You can use a pivot table in ...READ MORE

answered Apr 4, 2018 in Tableau by xyz
• 1,560 points
227 views
0 votes
1 answer

Display highest value in quarterly data

I guess your field name is in ...READ MORE

answered Apr 6, 2018 in Tableau by QueenBee
• 1,820 points
118 views
0 votes
1 answer

How to dynamically determine and categorize duplicate value in Tableau?

Apparently you define a duplicate records as ...READ MORE

answered Apr 12, 2018 in Tableau by xyz
• 1,560 points
4,660 views
0 votes
1 answer

How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,240 points
6,639 views
+1 vote
1 answer
0 votes
1 answer

Calculated filed with if-then

Below is the required code:  IF (NOT ISNULL([test2])) ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,240 points
510 views
+2 votes
1 answer
0 votes
1 answer

Show color bar even when no data in bar chart

Hi Latha, Follow the below steps: 1. Create the ...READ MORE

answered May 9, 2019 in Tableau by Cherukuri
• 32,930 points
302 views
0 votes
1 answer

Rank measure values and show percentage of measures in Tableau

Hi Sindhu, 1. First create a table with ...READ MORE

answered Mar 8, 2019 in Tableau by Cherukuri
• 32,930 points
2,043 views