BookmarkSubscribeRSS Feed
HHiemstra
Calcite | Level 5

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!

6 REPLIES 6
MichelleHomes
Meteorite | Level 14

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

//Contact me to learn how Metacoda software can help keep your SAS platform secure - https://www.metacoda.com
HHiemstra
Calcite | Level 5

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...

MichelleHomes
Meteorite | Level 14

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

//Contact me to learn how Metacoda software can help keep your SAS platform secure - https://www.metacoda.com
HHiemstra
Calcite | Level 5

And the light bulb blinks on...  thanks!

Renato_sas
SAS Employee

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

hannaraenam
Calcite | Level 5

I got this to work by:

1. Create a new custom category with 1 label that includes the 100% of population 

2. Define the above as the 'category' of the bar chart

3. Define the 'group' of the bar chart to be the breakdown of categories 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 5100 views
  • 5 likes
  • 4 in conversation