<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Clustered Bar chart in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/545854#M74330</link>
    <description>&lt;PRE&gt;proc sgplot data=work.'levée_trésor'n;
   vbar date / group = maturity groupdisplay=cluster response=buy_price;
   vbar date / group = maturity groupdisplay=cluster response=ask_price;
run;&lt;/PRE&gt;
&lt;P&gt;should display something with both variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not quite sure what you are wanting though&lt;/P&gt;</description>
    <pubDate>Mon, 25 Mar 2019 14:55:26 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-03-25T14:55:26Z</dc:date>
    <item>
      <title>Clustered Bar chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/545842#M74327</link>
      <description>&lt;P&gt;Hello ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i'm trying to get a clustered bar chart from my data using proc gchart , but I can't get it all to work.&lt;/P&gt;&lt;P&gt;I'm trying to compare the two prices ( Ask price and buy price ) for every maturity grouped by date.&lt;/P&gt;&lt;P&gt;My data is like this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp; &amp;nbsp; Maturity &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; ask_Price &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp; &amp;nbsp; buy_Price&lt;/P&gt;&lt;P&gt;01jan &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20&amp;nbsp;&lt;/P&gt;&lt;P&gt;01jan &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 600 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 250&lt;/P&gt;&lt;P&gt;01jan &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 376 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 120&lt;/P&gt;&lt;P&gt;02jan &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 500 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20&amp;nbsp;&lt;/P&gt;&lt;P&gt;02jan &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 60 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30&lt;/P&gt;&lt;P&gt;02jan &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 37 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; . &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; . &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; . &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; . &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; . &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; . &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; . &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for a specific date , there may be different maturities, and for every maturity I have Ask and buy price.&lt;/P&gt;&lt;P&gt;For the bar chart ,&amp;nbsp; I want to group it by date , and the subgroup should be maturity.&lt;/P&gt;&lt;P&gt;so for every date I should have the traded maturities in that date , and for every maturity I should have the ask_price and buy_price.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 14:31:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/545842#M74327</guid>
      <dc:creator>LoPez_Diaz</dc:creator>
      <dc:date>2019-03-25T14:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Clustered Bar chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/545850#M74329</link>
      <description>&lt;P&gt;I used this code , but I only get one price to show up, either buy or ask price ...&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I get both to show up ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=work.'levée_trésor'n;&lt;BR /&gt;vbar date / group = maturity groupdisplay=cluster response=buy_price;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 14:39:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/545850#M74329</guid>
      <dc:creator>LoPez_Diaz</dc:creator>
      <dc:date>2019-03-25T14:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Clustered Bar chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/545854#M74330</link>
      <description>&lt;PRE&gt;proc sgplot data=work.'levée_trésor'n;
   vbar date / group = maturity groupdisplay=cluster response=buy_price;
   vbar date / group = maturity groupdisplay=cluster response=ask_price;
run;&lt;/PRE&gt;
&lt;P&gt;should display something with both variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not quite sure what you are wanting though&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 14:55:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/545854#M74330</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-25T14:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Clustered Bar chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/545866#M74331</link>
      <description>&lt;P&gt;Thank you for your fast reply ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need is a side by side clustered bar chart.&lt;/P&gt;&lt;P&gt;the date is the group variable , the maturity is the subgroup variable , but i don't know how to display the ask and buy price for&amp;nbsp; every maturity.&lt;/P&gt;&lt;P&gt;Please check the link to see a similar graph, except that for every pop_group in the linked graph , I should have two bars .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.bing.com/images/search?view=detailV2&amp;amp;id=1493CDA15CD560DD31ED183198374474E69F446F&amp;amp;thid=OIP.jQ4unIeCA4U5SvVhNDlQUQHaFg&amp;amp;mediaurl=https%3A%2F%2Fd2h0cx97tjks2p.cloudfront.net%2Fblogs%2Fwp-content%2Fuploads%2Fclustered-bar-chart.jpg&amp;amp;exph=804&amp;amp;expw=1080&amp;amp;q=side+by+side+clustered+bar+chart+sas&amp;amp;selectedindex=3&amp;amp;ajaxhist=0&amp;amp;vt=0&amp;amp;eim=1,6" target="_blank"&gt;https://www.bing.com/images/search?view=detailV2&amp;amp;id=1493CDA15CD560DD31ED183198374474E69F446F&amp;amp;thid=OIP.jQ4unIeCA4U5SvVhNDlQUQHaFg&amp;amp;mediaurl=https%3A%2F%2Fd2h0cx97tjks2p.cloudfront.net%2Fblogs%2Fwp-content%2Fuploads%2Fclustered-bar-chart.jpg&amp;amp;exph=804&amp;amp;expw=1080&amp;amp;q=side+by+side+clustered+bar+chart+sas&amp;amp;selectedindex=3&amp;amp;ajaxhist=0&amp;amp;vt=0&amp;amp;eim=1,6&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 15:19:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/545866#M74331</guid>
      <dc:creator>LoPez_Diaz</dc:creator>
      <dc:date>2019-03-25T15:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Clustered Bar chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/545909#M74332</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265711"&gt;@LoPez_Diaz&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for your fast reply ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I need is a side by side clustered bar chart.&lt;/P&gt;
&lt;P&gt;the date is the group variable , the maturity is the subgroup variable , but i don't know how to display the ask and buy price for&amp;nbsp; every maturity.&lt;/P&gt;
&lt;P&gt;Please check the link to see a similar graph, except that for every pop_group in the linked graph , I should have two bars .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.bing.com/images/search?view=detailV2&amp;amp;id=1493CDA15CD560DD31ED183198374474E69F446F&amp;amp;thid=OIP.jQ4unIeCA4U5SvVhNDlQUQHaFg&amp;amp;mediaurl=https%3A%2F%2Fd2h0cx97tjks2p.cloudfront.net%2Fblogs%2Fwp-content%2Fuploads%2Fclustered-bar-chart.jpg&amp;amp;exph=804&amp;amp;expw=1080&amp;amp;q=side+by+side+clustered+bar+chart+sas&amp;amp;selectedindex=3&amp;amp;ajaxhist=0&amp;amp;vt=0&amp;amp;eim=1,6" target="_blank" rel="noopener"&gt;https://www.bing.com/images/search?view=detailV2&amp;amp;id=1493CDA15CD560DD31ED183198374474E69F446F&amp;amp;thid=OIP.jQ4unIeCA4U5SvVhNDlQUQHaFg&amp;amp;mediaurl=https%3A%2F%2Fd2h0cx97tjks2p.cloudfront.net%2Fblogs%2Fwp-content%2Fuploads%2Fclustered-bar-chart.jpg&amp;amp;exph=804&amp;amp;expw=1080&amp;amp;q=side+by+side+clustered+bar+chart+sas&amp;amp;selectedindex=3&amp;amp;ajaxhist=0&amp;amp;vt=0&amp;amp;eim=1,6&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you again&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That example shows two grouping variables, region and population.&lt;/P&gt;
&lt;P&gt;In effect your example data has three grouping variables: week, maturity and ask/buy type + a value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the examples from the same source: &lt;A href="https://www.bing.com/images/search?view=detailV2&amp;amp;id=66EE8198E271BFBD4C87EA526EDD1EC296B08434&amp;amp;thid=OIP.i07gbPk3ExmhjGriOs_UQQHaEc&amp;amp;exph=300&amp;amp;expw=500&amp;amp;q=side+by+side+clustered+bar+chart+sas&amp;amp;selectedindex=9&amp;amp;ajaxhist=0&amp;amp;vt=0&amp;amp;eim=1,6&amp;amp;ccid=i07gbPk3&amp;amp;simid=607999237023531808&amp;amp;mediaurl=https%3A%2F%2Fblogs.sas.com%2Fcontent%2Fgraphicallyspeaking%2Ffiles%2F2013%2F09%2FStackedClusterGroups_V93_SG.png" target="_blank"&gt;https://www.bing.com/images/search?view=detailV2&amp;amp;id=66EE8198E271BFBD4C87EA526EDD1EC296B08434&amp;amp;thid=OIP.i07gbPk3ExmhjGriOs_UQQHaEc&amp;amp;exph=300&amp;amp;expw=500&amp;amp;q=side+by+side+clustered+bar+chart+sas&amp;amp;selectedindex=9&amp;amp;ajaxhist=0&amp;amp;vt=0&amp;amp;eim=1,6&amp;amp;ccid=i07gbPk3&amp;amp;simid=607999237023531808&amp;amp;mediaurl=https%3A%2F%2Fblogs.sas.com%2Fcontent%2Fgraphicallyspeaking%2Ffiles%2F2013%2F09%2FStackedClusterGroups_V93_SG.png&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;or simpler:&amp;nbsp; &lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2013/09/07/bar-charts-with-stacked-and-cluster-groups/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2013/09/07/bar-charts-with-stacked-and-cluster-groups/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;shows and SGPANEL result. Adding the groupdisplay=cluster should get you close.&lt;/P&gt;
&lt;P&gt;BUT the data needs to be in the correct structure which means a single value(price) to plot and an additional variable to indicate which type of price the value represents.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
 input Date $      Maturity  $        ask_Price           buy_Price ;
datalines;
01jan      1      50         20 
01jan      2    600       250
01jan      5    376       120
02jan      6    500         20 
02jan      4     60         30
02jan      7     37         12
;
run;

data need;
   set have;
   type='Ask'; Price=Ask_price; output;
   type='Buy'; price=Buy_price; output;
run;

proc sgpanel data=need;
  panelby date / layout=columnlattice novarname noborder colheaderpos=bottom;
  vbar maturity / response=price group=Type groupdisplay=cluster ;
  rowaxis grid;
run;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Mar 2019 17:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/545909#M74332</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-25T17:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Clustered Bar chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/546107#M74341</link>
      <description>&lt;P&gt;Hello ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again for your help ... I really appreciate .&lt;/P&gt;&lt;P&gt;The code you gave me works great , but I get multiple pages in output. Every date has its own bar graph showing the ask and buy.&lt;/P&gt;&lt;P&gt;Is there a way to get all the dates in the same graph ?&amp;nbsp;&lt;BR /&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 12:44:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/546107#M74341</guid>
      <dc:creator>LoPez_Diaz</dc:creator>
      <dc:date>2019-03-26T12:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Clustered Bar chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/546198#M74346</link>
      <description>&lt;P&gt;Look at the options for the Panelby statement. The option ONEPANEL will attempt to place the entire graph in a single panel. But if you have lots of values of DATE you may run into issues with not being able to show them all across one row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which may lead to the options about rows and columns settings.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 15:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Clustered-Bar-chart/m-p/546198#M74346</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-26T15:25:04Z</dc:date>
    </item>
  </channel>
</rss>

