-
15. Re: How do we display zero when there is no data ?
Alex Xu Sep 1, 2016 1:10 PM (in response to Aditya Hrishikesh) -
16. Re: How do we display zero when there is no data ?
Rohit Bose Sep 2, 2016 2:00 AM (in response to Aditya Hrishikesh)Use ZN aor ISNULL function
-
17. Re: How do we display zero when there is no data ?
Swarup K Sep 2, 2016 1:21 AM (in response to Aditya Hrishikesh)Hi Aditya,
To display 0 when there is no data exists refer the attached workbook.
ZN(LOOKUP(SUM(IF YEAR([Order Date])=2012 THEN [Sales] END),0))
-
Book1.twbx 1.2 MB
-
-
18. Re: How do we display zero when there is no data ?
Aditya Hrishikesh Sep 2, 2016 3:56 AM (in response to Swarup K)Hi Swarup
Thanks for the reply. It works ( Displays zero) without the date filter. But I want to check the sales people sales for the previous week, when I use the 'Last week' filter or any other type of filter the Zero just disappears. Any hack around for this
-
19. Re: How do we display zero when there is no data ?
Aditya Hrishikesh Sep 2, 2016 3:56 AM (in response to Aditya Hrishikesh)could you please check the worksheet you provided with a date filter( any date filter zero disappears), and filter and see if this is the case for you too?
-
20. Re: How do we display zero when there is no data ?
Rashmi G Sep 2, 2016 5:26 AM (in response to Aditya Hrishikesh)@Aditya hrishikesh : Hi Aditya - I was able to create the results which you are asking for using some sample data.(Used ZN() ). I have attached the screenshots of sheets and underlying data too. If this dint work can you send me your sample file ?
-Rashmi
-
Display zero.png 10.0 KB
-
Zero.png 25.2 KB
-
-
21. Re: How do we display zero when there is no data ?
Aditya Hrishikesh Sep 2, 2016 5:48 AM (in response to Rashmi G)The data is read directly from the data base
its tableau 9.3
ZN() doesn't work
I also have a date filter for the previous week
The solution Swarup K provided works without the date filter but when there is a date filter the Zero's disappear
Did you try with a date filter ? From a DB?
-
22. Re: How do we display zero when there is no data ?
Swarup K Sep 2, 2016 10:42 AM (in response to Aditya Hrishikesh)Aditya..!! It's working when date filter is applied for me check the attached workbook. If you still persists with the problem share your workbook, if you are ok with the solution then mark the thread as answered.
Regards,
Swarup.
-
Book1.twbx 1.1 MB
-
-
23. Re: How do we display zero when there is no data ?
Aditya Hrishikesh Sep 5, 2016 2:59 AM (in response to Swarup K)I am reading the data directly from the Data Base and applying the date filter. It removes the zero. Its any date filter. Maybe it's a parameter setting that I am missing . Are you working with Tableau 10.0 ? I am currently on Tableau 9.3. If I use it on the entire data then the zero's appear!
The dates in the DB start from 2013 and I am filtering for 2016 (IF YEAR([Order Date])=2016 ), based on the calculated field you provided.
Pretty close to solving I think
-
24. Re: How do we display zero when there is no data ?
Łukasz Majewski Sep 5, 2016 3:55 AM (in response to Aditya Hrishikesh)If you are using "Show missing values" to display non existing or filtered dates then you should ZN aggregated values, i,e. ZN(SUM(x)) and not SUM(ZN(x)):
In the attached example dates between 14-17 September do not exist in the data source.
-
ZN_9.3.twbx 34.1 KB
-
-
25. Re: How do we display zero when there is no data ?
Swarup K Sep 5, 2016 7:35 AM (in response to Aditya Hrishikesh)It has to work. We had a similar requirement in my project few days back to show 0's in place of no data and we were using Oracle as database. Version doesn't matter it will give you the same output. We used 9.3 version in my project. If possible attach the workbook will try to figure it out.
Regards,
Swarup
-
Book1.twbx 1.2 MB
-
-
26. Re: How do we display zero when there is no data ?
Aditya Hrishikesh Sep 5, 2016 9:47 AM (in response to Swarup K)It's super strange. The date filter works from 1.04.2015 to 30.04.2015, displaying zero after that it changes to no value, I think it's more to do with data in the DB.
-
27. Re: How do we display zero when there is no data ?
Andrew Watson Sep 5, 2016 5:05 PM (in response to Aditya Hrishikesh) -
28. Re: How do we display zero when there is no data ?
Aditya Hrishikesh Sep 6, 2016 1:36 AM (in response to Andrew Watson)Andrew Watson : I tried putting Zero. It does not show up. Why is it so hard to do this in Tableau
-
29. Re: How do we display zero when there is no data ?
kettan Sep 6, 2016 2:07 AM (in response to Aditya Hrishikesh)Why is it so hard to do this in Tableau
It is difficult to know why it is so hard to do this in Tableau without seeing your worksheet and data.
I recommend you to recreate the same issue with dummy data and share it as a packaged workbook as already suggested by David Li here. I have a feeling that if you had done so from the start, you would have got a quick and precise answer and therefore possibly spent less time in total on this question yourself.
Ps. I also wish Tableau made a video - or something else that does the same job better - that teach questioners how as suggested in Add video about making simple sample dummy data for questions (4)