Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Displaying value 0 in a bar chart
Angel28
Hi,
How to display a value 0 in a bar chart if in the table there is no value. The value used is optional grouping. Please help me ASAP.
Find more posts tagged with
Comments
mwilliams
The chart is embedded in a table to display info for the group and if the group returns no data you want to show a 0? Or something else? Maybe you can make an example of what you're talking about with the sample database and attach it in here. Thanks!
Angel28
Thanks. I find your solution very useful and its easy also.
The thing I am doing is showing total number of customers of a specific status (group by status) data and certain product id in a chart. There are 5 statuses. If in a group there is no customers with a product id there is no row in the table with that status. And of course no bar in the chart. So I want to display 0 in the chart if there is no bar for a group.
Angel28
Showing series labels I am getting the value which have row in the table. Which don't have I want to display 0.
mwilliams
Can you reproduce your issue using the sample database or a flat file of data? Thanks!
Angel28
I am using scripted data source.
mwilliams
Then, can you reproduce it using a simple scripted data set that I can run? You can define a sample set of data in the dataSet's open method and define your rows like normal, using this data, in the fetch event. This will allow you to create a sample using a scripted dataSet that I can run. Thanks.
Angel28
I have given some data in the scripted data set. Hope u will find a solution for this. I am having another problem. If I am inserting a cross-tab in the design, insert query is not executing. Removing the cross-tab, insert works fine. Its inserting in the database. I have tried putting the cross-tab in and outside of table, but still the same. Please, I am working on this for so long, trying to figure out what is the problem.
I really appreciate ur help.
mwilliams
I get error when I run your report because I don't have access to your Maximo data. Let me see if I understand so I can just create an example. You have data in a table that is grouped by status. If there are no customers with a certain status, there will not be a group for that status, so in your chart, there will not be a bar for that status? Is that the case? So, if you have five statuses and your data looks like this, you'll be missing a bar?
status | customer | value
s1 | c1 | v1
s1 | c2 | v1
s2 | c3 | v1
s3 | c4 | v1
s4 | c5 | v1
s4 | c6 | v1
There is not a s5, because no customer falls in that status, so the table and chart will be missing this section? Is this what you're meaning?
If so, you could create a dataSet with the 5 statuses and join that dataSet with your original dataSet so that all 5 statuses are represented. Then, all statuses will always be represented. Let me know if this is correct. I can make an example.
Angel28
Yes, you got it right. But as you saw in my query, there is no fixed statuses. If the status would be always 5 then I should have follwed your suggestion. It is random.
I am really stuck with my cross-tab
Angel28
For s5 there is at least one customer with that status.
mwilliams
Then why don't they show up? Are you filtering them out? Can you give me some dummy sample data just like above, only with actual values in the value column and then tell me the scenario in which one of the statuses fails to appear? That is now where I'm stuck not knowing what's happening. Thanks!