Calcite | Level 5

## How to get the percentage of different group within same category in bar chart

Hi,

I am trying to create a bar chart in the report using SAS VA and I want to get the percentage of different group within same category. For example, I have group A, B and C. I use Year as category or the x-axis. I try to get the percentage so that if I add up the percentage for A, B and C in the same year it will be 100%. But currently the percentage will be 100% only when I add up the percentage for all the year.

Can someone help me with it? It is quite urgent.

Thanks!

6 REPLIES 6
SAS Super FREQ

## Re: How to get the percentage of different group within same category in bar chart

I'm not sure of a way to get the percentage of a subtotal like this in a bar chart.

For what it's worth, you can create percentage of subtotal for a crosstab.
Calcite | Level 5

## Re: How to get the percentage of different group within same category in bar chart

Haha, thanks Sam. I also got the crosstab one but my boss prefer the bar chart. Thanks for your reply!
Lapis Lazuli | Level 10

## Re: How to get the percentage of different group within same category in bar chart

Hello Sagdec,

Use Group by option which is available in 'Roles'.
As per your data., Roles are...

Category : Year
Measure : Some X or Percentage.
Group (by) : Group.

Hope this helps you...

Let me know..

Thanks & Regards,
Teja Surapaneni
SAS Super FREQ

## Re: How to get the percentage of different group within same category in bar chart

Hi Teja,

The trouble is, the percentages are based on the full data and not the subgroup:

There doesn't seem to be an easy way to get these group subtotals in a barchart.

Sam

Lapis Lazuli | Level 10

## Re: How to get the percentage of different group within same category in bar chart

Hello Sam,

I got it.., I agree with u..

Teja

Calcite | Level 5

## Re: How to get the percentage of different group within same category in bar chart

Hi Teja, if I put percentage as measure it will show percentage of total not subgroup. But thanks for your reply!
Discussion stats
• 6 replies
• 2781 views
• 0 likes
• 3 in conversation