Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Missing categories in bar chart

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Missing categories in bar chart

Hi all,

 

It's my first time in the forum so I hope this question hasn't been posted before.

 

My problem with SAS VA is that when using a bar chart, some of my groups don't have values in every category. Thus in these categories, there is no bar shown. is there a way to show a "zero" bar or at least a missing space where that bar should normally be? here is an example:

 


SASVAChart.png

Accepted Solutions
Solution
‎05-16-2017 09:08 AM
Super User
Super User
Posts: 7,720

Re: Missing categories in bar chart

Well, I can't help with VA specifics, however code wise its pretty straight forward, just create a template of your categories, and then merge that with the data you have.  If you need specifics per parts of your data then proc sort distinct your data for the values you want, add a do loop to assign the categories, then merge back.  

View solution in original post


All Replies
Super User
Super User
Posts: 7,720

Re: Missing categories in bar chart

Well, first thing that comes to my mind, just add a row in your data for each missing category, with a result of 0, then all the categories will appear.

New Contributor
Posts: 2

Re: Missing categories in bar chart

yes that would be possible, but I would need to think about every possible combination of categories and also filters that may appear which makes this really hard. I was hoping for an easier solution directly in VA...

Solution
‎05-16-2017 09:08 AM
Super User
Super User
Posts: 7,720

Re: Missing categories in bar chart

Well, I can't help with VA specifics, however code wise its pretty straight forward, just create a template of your categories, and then merge that with the data you have.  If you need specifics per parts of your data then proc sort distinct your data for the values you want, add a do loop to assign the categories, then merge back.  

Frequent Contributor
Posts: 116

Re: Missing categories in bar chart

You may be able to use a calculated query with the missing function to force VA to output a value.

 

Something like

 

Capture.GIF

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 224 views
  • 1 like
  • 3 in conversation