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

How to do stacked bars to 100% in VA?

Reply
New Contributor
Posts: 3

How to do stacked bars to 100% in VA?

A very useful way to compare distributions that vary in size is stacked bar charts that add up to 100%.  For example, excel has a 100% stacked column chart, which automatically converts to percentages and displays cells as a percent of the row or column total -- see attached example.  So far I haven't found the magic combination to do this in SAS -- adding percents to a crosstab just converts each cell to a percent of the overall total, not a percent of the row or column total...help!

Trusted Advisor
Posts: 1,289

Re: How to do stacked bars to 100% in VA?

As you discovered and also in comment at The current version (VA 6.3) doesn't provide the functionality to do cumulative totals on generic categories; only for dates.

If it is of interest though you could using VA Designer to show the percentage of each category using a stacked bar chart as below. The data you provided needs to be rearranged to achieve this as follows:

fruit_data.png

Cheers,

Michelle

VA63_stacked_bar_percentTotal.png

New Contributor
Posts: 3

Re: How to do stacked bars to 100% in VA?

Very helpful -- thanks!  Where did the "amount" measure come from -- did you calculate it, and if so, how?  Granted I've been doing all my data prep in enterprise guide and have only worked with the reporting end of VA, but I don't see "amount" as a measure there...

Trusted Advisor
Posts: 1,289

Re: How to do stacked bars to 100% in VA?

Glad to see it is helpful.

I rearranged the table you had in your excel spreadsheet and created an amount column for the figures (see screenshot above). So amount is whatever your measurement column is. Compare my screenshot to what you provided in your attachment in your first post.

Cheers,

Michelle

New Contributor
Posts: 3

Re: How to do stacked bars to 100% in VA?

And the light bulb blinks on...  thanks!

SAS Super FREQ
Posts: 73

Re: How to do stacked bars to 100% in VA?

There is a similar track that you may find useful: 100% Stacked Bar Charts

Ask a Question
Discussion stats
  • 5 replies
  • 2068 views
  • 5 likes
  • 3 in conversation