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

SAS VA Stacked Bar Chart >> How to sort on the measure-value?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

SAS VA Stacked Bar Chart >> How to sort on the measure-value?

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


Accepted Solutions
Solution
‎05-19-2016 10:25 AM
SAS Employee
Posts: 32

Re: SAS VA Stacked Bar Chart >> How to sort on the measure-value?

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


All Replies
Occasional Contributor
Posts: 5

Re: SAS VA Stacked Bar Chart >> How to sort on the measure-value?

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

Solution
‎05-19-2016 10:25 AM
SAS Employee
Posts: 32

Re: SAS VA Stacked Bar Chart >> How to sort on the measure-value?

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

 

Occasional Contributor
Posts: 5

Re: SAS VA Stacked Bar Chart >> How to sort on the measure-value?

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
Occasional Contributor
Posts: 5

Re: SAS VA Stacked Bar Chart >> How to sort on the measure-value?

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

 

Thanks!

SAS Employee
Posts: 5

Re: SAS VA Stacked Bar Chart >> How to sort on the measure-value?

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

 

 

Occasional Contributor
Posts: 5

Re: SAS VA Stacked Bar Chart >> How to sort on the measure-value?

[ Edited ]

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?

Attachment
SAS Employee
Posts: 5

Re: SAS VA Stacked Bar Chart >> How to sort on the measure-value?

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.

Post a Question
Discussion Stats
  • 7 replies
  • 1201 views
  • 2 likes
  • 4 in conversation