<?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: Attribute Map Slows Box Plot with Medium Sized Data? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Attribute-Map-Slows-Box-Plot-with-Medium-Sized-Data/m-p/232519#M8435</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13856"&gt;@Jay54﻿&lt;/a&gt;, can definitely see how BOXPLOTPARM would help with this issue as well.&amp;nbsp; Really appreciate all your help on here (and your books and presentations and... )&amp;nbsp; I'll likely have more questions next week....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But have a great weekend!&lt;/P&gt;</description>
    <pubDate>Fri, 30 Oct 2015 21:00:28 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2015-10-30T21:00:28Z</dc:date>
    <item>
      <title>Attribute Map Slows Box Plot with Medium Sized Data?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Attribute-Map-Slows-Box-Plot-with-Medium-Sized-Data/m-p/232493#M8431</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm tearing apart a&amp;nbsp;slow GTL boxplot (10-20 seconds on&amp;nbsp;a 100,000 obs dataset) to see what parts are making it slow.&amp;nbsp; I'm using an attribute map to traffic-light it, and it seems that may be one contributor.&amp;nbsp;&amp;nbsp;Running v9.3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below sample code I expand sashelp.prdsale into 144,000 obs, then run two SGRENDER steps to make box plots.&amp;nbsp; When I use the template with an attribute map, it takes 7 seconds, vs 1 second when there is no attribute map.&amp;nbsp; Interestingly, if I remove the /group option on the BOXPLOT statement, the time is the same.&amp;nbsp; So the time seems to be in the creation of the attribute map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does it make sense that building an attribute map would slow the SGRENDER step this much?&amp;nbsp; In my head the attribute map might only have 2 levels (red and black), but perhaps it ends up with 144,000?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc template;
  define statgraph BoxWithAttributeMap;
    begingraph;
      discreteattrmap name='AttrMapBox';
          value 'Red'    / fillattrs=(color=red) ;
          value 'Black'  / fillattrs=(color=lightgrey) ;
      enddiscreteattrmap;
      discreteattrvar 
        attrVar=AttrColorBox
        var=BoxColor
        attrmap='AttrMapBox' 
      ;
      layout overlay ;
        boxplot x=category y=actual /group=AttrColorBox ;
      endlayout; 
    endgraph;
  end;

  define statgraph BoxNoAttributeMap;
    begingraph;
      layout overlay ;
        boxplot x=category y=actual;
      endlayout; 
    endgraph;
  end;
run;

data prdsale;
  set sashelp.prdsale;
  category=catx('-',country,region,product);
  length BoxColor $10;
  if category='CANADA-EAST-BED' then BoxColor='Red';
  else BoxColor='Black';
  do i=1 to 100;
    output;
  end;
run;

proc sgrender data=prdsale template="BoxWithAttributeMap";
run;
proc sgrender data=prdsale template="BoxNoAttributeMap";
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;--Q.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2015 17:54:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Attribute-Map-Slows-Box-Plot-with-Medium-Sized-Data/m-p/232493#M8431</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2015-10-30T17:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Map Slows Box Plot with Medium Sized Data?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Attribute-Map-Slows-Box-Plot-with-Medium-Sized-Data/m-p/232509#M8433</link>
      <description>&lt;P&gt;Hi Quentin,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The experts here at SAS are looking into your use case, and have identified reasons for the slowdown. &amp;nbsp;This will be something we can address in the next release.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the meantime, you could possibly work around the isue&amp;nbsp;that is slowing this down.. &amp;nbsp;Since you have a large data set, the parm data created for rendering contains not only the data for drawing the box, but also the original data set. &amp;nbsp;That is slowing down the internal process. &amp;nbsp;One way (similar to your previous question) would be to run the box plot WITHOUT the attr map setting and get the parm data (ODS OUTPUT). &amp;nbsp;Filter out the rows where STAT is missing. &amp;nbsp;Note, the STAT column name&amp;nbsp;may have&amp;nbsp;an internally generated long column name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, run the GTL program with the AttrMap using BOXPLOTPARM and the new cleaned data set. &amp;nbsp;You will have to assign the internally generated long column names, including the one for group. &amp;nbsp;Use that for the group and the attrmap. &amp;nbsp;See if this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2015 20:14:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Attribute-Map-Slows-Box-Plot-with-Medium-Sized-Data/m-p/232509#M8433</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-10-30T20:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Map Slows Box Plot with Medium Sized Data?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Attribute-Map-Slows-Box-Plot-with-Medium-Sized-Data/m-p/232519#M8435</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13856"&gt;@Jay54﻿&lt;/a&gt;, can definitely see how BOXPLOTPARM would help with this issue as well.&amp;nbsp; Really appreciate all your help on here (and your books and presentations and... )&amp;nbsp; I'll likely have more questions next week....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But have a great weekend!&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2015 21:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Attribute-Map-Slows-Box-Plot-with-Medium-Sized-Data/m-p/232519#M8435</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2015-10-30T21:00:28Z</dc:date>
    </item>
  </channel>
</rss>

