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
123,548 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.

For an in-depth explanation check out Tableau Training Course details.

answered Apr 24, 2019 by Cherukuri
• 33,030 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,770 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,870 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,480 points

Related Questions In Tableau

0 votes
1 answer
0 votes
1 answer

Tableau "Who has seen this view" data automation

Will you be able to query the ...READ MORE

answered Mar 16, 2022 in Tableau by Vaani
• 7,070 points
814 views
0 votes
1 answer

combine two data sets in tableau so that I can show a forecast for the next 3 months

I believe the best approach is to ...READ MORE

answered Apr 5, 2022 in Tableau by Vaani
• 7,070 points
914 views
0 votes
1 answer

creating a tableau pie chart with no measures data

It's not difficult once you understand the ...READ MORE

answered Apr 12, 2022 in Tableau by Neha
• 9,020 points
937 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
9,925 views
+2 votes
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
1,616 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
• 33,030 points
1,498 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
• 33,030 points
4,396 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP