<?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: Why Conditional not work in GTL? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Why-Conditional-not-work-in-GTL/m-p/159388#M5979</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No. log is clean. my sas version is SAS 9.2 TS Level 2M9.&lt;/P&gt;&lt;P&gt;Maybe you can run my code in your SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 May 2014 03:16:46 GMT</pubDate>
    <dc:creator>Happydragon</dc:creator>
    <dc:date>2014-05-15T03:16:46Z</dc:date>
    <item>
      <title>Why Conditional not work in GTL?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Why-Conditional-not-work-in-GTL/m-p/159386#M5977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all, I try to use conditional logic to control the output in GTL. But it doesn't work. see code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I expect is, when pass variable NPIC=2 into _NPIC, we will got second cell show in the graph. but what I got is not as my expect. See the title, _NPIC should got the variable value from data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc template;&lt;/P&gt;&lt;P&gt;define statgraph sgdesign1;&lt;/P&gt;&lt;P&gt;dynamic _HEIGHT _WEIGHT _HEIGHT2 _AGE _NPIC;&lt;/P&gt;&lt;P&gt;begingraph;&lt;/P&gt;&lt;P&gt;layout lattice _id='lattice' / columndatarange=data columngutter=10 rowdatarange=data rowgutter=10 rows=2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; entrytitle "aaaa" eval(mean(_Npic)) '--' eval(max(_NPIC)=2);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layout overlay _id='overlay' /;&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; scatterplot _id='scatter' x=_HEIGHT y=_WEIGHT / name='scatter';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endlayout;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp; if ( eval(max(_NPIC)=2) ) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layout overlay _id='overlay2' /;&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; scatterplot _id='scatter2' x=_HEIGHT2 y=_AGE / name='scatter2';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endlayout;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endif;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sidebar / align=bottom spacefill=false;&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; discretelegend _id='legend3' 'scatter'&amp;nbsp; / border=true displayclipped=true halign=center opaque=true valign=center;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endsidebar;&lt;/P&gt;&lt;P&gt;endlayout;&lt;/P&gt;&lt;P&gt;endgraph;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=sashelp.class out=class;&lt;/P&gt;&lt;P&gt;by sex;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data class;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set class;&lt;/P&gt;&lt;P&gt;&amp;nbsp; x2=height;&lt;/P&gt;&lt;P&gt;&amp;nbsp; npic=2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;proc sgrender data=CLASS template=sgdesign1;&lt;/P&gt;&lt;P&gt;where sex='F';&lt;/P&gt;&lt;P&gt;dynamic _HEIGHT="HEIGHT" _WEIGHT="WEIGHT" _HEIGHT2="X2" _AGE="AGE" _NPIC="NPIC";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SGRender30.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/6325_SGRender30.png" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 02:43:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Why-Conditional-not-work-in-GTL/m-p/159386#M5977</guid>
      <dc:creator>Happydragon</dc:creator>
      <dc:date>2014-05-15T02:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Why Conditional not work in GTL?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Why-Conditional-not-work-in-GTL/m-p/159387#M5978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Were there any warning messages in the log?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 02:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Why-Conditional-not-work-in-GTL/m-p/159387#M5978</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2014-05-15T02:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why Conditional not work in GTL?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Why-Conditional-not-work-in-GTL/m-p/159388#M5979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No. log is clean. my sas version is SAS 9.2 TS Level 2M9.&lt;/P&gt;&lt;P&gt;Maybe you can run my code in your SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 03:16:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Why-Conditional-not-work-in-GTL/m-p/159388#M5979</guid>
      <dc:creator>Happydragon</dc:creator>
      <dc:date>2014-05-15T03:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Why Conditional not work in GTL?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Why-Conditional-not-work-in-GTL/m-p/159389#M5980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Remove the eval() from the expression. It should just be max(_NPIC). For "if" conditions, the eval is not necessary.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 04:12:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Why-Conditional-not-work-in-GTL/m-p/159389#M5980</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2014-05-15T04:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why Conditional not work in GTL?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Why-Conditional-not-work-in-GTL/m-p/159390#M5981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To further explain, we use the eval() to differentiate an expression from a variable in plot statements and other situations. However, in an "if" condition, it can only be an expression. Therefore, we do not expect you to use an eval() there. Actually using eval() was causing your expression to not be processed correctly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 04:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Why-Conditional-not-work-in-GTL/m-p/159390#M5981</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2014-05-15T04:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why Conditional not work in GTL?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Why-Conditional-not-work-in-GTL/m-p/159391#M5982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your reply. It work correctly after remove eval(). But why it doesn't work if I remove max()?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At first, I try to use&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if (_NPIC=2) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it doesn't work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 04:37:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Why-Conditional-not-work-in-GTL/m-p/159391#M5982</guid>
      <dc:creator>Happydragon</dc:creator>
      <dc:date>2014-05-15T04:37:51Z</dc:date>
    </item>
  </channel>
</rss>

