BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
robertopostma
Fluorite | Level 6

Hi Community,


I'm relatively new into SAS / SAS VA, and I'm running into an issue for which I'd like to make use of your expertise...

My question is: "How can I sort my stacked bar-chart by value in SAS VA"?

 

More details

- When I create a bar chart with only categories and 1 measure, by default, the bars are sorted by the value (for e.g. sum of value) 

- When I add a 3rd item to this chart (so it will be a stacked bar-chart, I only seem to be able to sort by the category in my chart and not anymore by value

 

Is this possible at all in SAS VA? And if so, how can it be achieved?

It might be that we don't have the newest version (I'm not 100% sure and will check it tomorrow), but in the version at the client where I now work, I didn't get it working.

 

Please find an excelfile with "sample data" and a pivot-chart in Excel, which does exactly what I want. 

The chart is built up by 

- taking sum of value (=x-axis)

- broken down by ITEM (=y axis)

- broken down by GROUP (=stacked bars)

 

In the example excel, it is sorted (correctly) by the sum of value by ITEM; in SAS VA I need your advise to have the same.

 

Many thanks for helping; please let me also know if this is not possible, so I can stop searching.

 

Roberto 

 

 

Roberto

1 ACCEPTED SOLUTION

Accepted Solutions
TedStolarczyk
SAS Employee

Roberto:

 

Out of the box (even with the most current VA release v7.3), with Stacked Bar Chart, you can sort by Category variable or Measure 1 or Measure 2 or Measure 3 or Measure n.  It doesn't automatically behind the scenes Sum all the Measures that comprise the Stacked Bar Chart and allow a sort on that.

 

With that said, do you happen to be familiar with Custom Graph Builder that's part of SAS Visual Analytics?

Within that, you can build a custom bar chart that mimics what's in your Excel file.

Not sure I can be detailed enough here with exact steps required and be succint at same time.

But a high level ... within Custom Graph Builder ...

* 2 Bar Charts that share the same Category variable and axes

* Bar Chart 1 is for the individual bar measures (e.g. your Group A, B, C, etc. numeric measures)

* Bar Chart 2 is for a calculated item that is the sum of measures stacked in Bar Chart 1

* Bar Chart 2 will need to be positioned behind Bar Chart 1 and have transparency settings which basically makes Bar Chart 2 invisible

* But you'll be able to sort on a measure which serves as your "Sum of all Measures"

 

White Papers on Custom Graph Builder, though not specific to above scenario:

http://support.sas.com/resources/papers/proceedings14/SAS346-2014.pdf

http://support.sas.com/resources/papers/proceedings15/SAS1800-2015.pdf

 

Hope this helps.

 

Sincerely,

Ted Stolarczyk, SAS Customer Loyalty team

 

View solution in original post

7 REPLIES 7
robertopostma
Fluorite | Level 6

Hi all,

 

 

I see that this topic is still unanswered after 1 week... Can you let me know if the problem I describe is clear?

 

And/or: let me know if it is possible at all (or not)?

 

Many thanks in advance!

 

Roberto

TedStolarczyk
SAS Employee

Roberto:

 

Out of the box (even with the most current VA release v7.3), with Stacked Bar Chart, you can sort by Category variable or Measure 1 or Measure 2 or Measure 3 or Measure n.  It doesn't automatically behind the scenes Sum all the Measures that comprise the Stacked Bar Chart and allow a sort on that.

 

With that said, do you happen to be familiar with Custom Graph Builder that's part of SAS Visual Analytics?

Within that, you can build a custom bar chart that mimics what's in your Excel file.

Not sure I can be detailed enough here with exact steps required and be succint at same time.

But a high level ... within Custom Graph Builder ...

* 2 Bar Charts that share the same Category variable and axes

* Bar Chart 1 is for the individual bar measures (e.g. your Group A, B, C, etc. numeric measures)

* Bar Chart 2 is for a calculated item that is the sum of measures stacked in Bar Chart 1

* Bar Chart 2 will need to be positioned behind Bar Chart 1 and have transparency settings which basically makes Bar Chart 2 invisible

* But you'll be able to sort on a measure which serves as your "Sum of all Measures"

 

White Papers on Custom Graph Builder, though not specific to above scenario:

http://support.sas.com/resources/papers/proceedings14/SAS346-2014.pdf

http://support.sas.com/resources/papers/proceedings15/SAS1800-2015.pdf

 

Hope this helps.

 

Sincerely,

Ted Stolarczyk, SAS Customer Loyalty team

 

robertopostma
Fluorite | Level 6
Thanks for your quick-reply; I wasn't aware of the custom-chart concept.

To be honest, it looks like it takes quite some effort to make this (for a common requirement). But it indeed looks like this can cover the requirement.

Thanks!

Roberto
Jadwiga
Calcite | Level 5

I have same problem but don't really understand how can I solve it. Could you give more detailed steps?

 

Thanks!

KeithM
SAS Employee

I created a SAS Sample that I think addresses your issue.   http://support.sas.com/kb/59/480.html

 

 

Jadwiga
Calcite | Level 5

Thank you! I tried to follow all the steps but the result looks strange... Do you know what went wrong? (see attached picture)

 

I added Rank (top 10 on frequency)- could that be a reason?


Capture.PNG
KeithM
SAS Employee

I would remove rank and see if that makes a difference.  I know the sample/workaround is very specific so some subtle changes may not work.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 7 replies
  • 5314 views
  • 2 likes
  • 4 in conversation