<?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: Nexted if else statement Issue in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/685436#M14213</link>
    <description>&lt;P&gt;Hello Kiran,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two conditions that return 1, so it might be helpful for troubleshooting purposes to change one of them to return 2 so we know which result is being returned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I am not mistaken,&amp;nbsp;&lt;SPAN&gt;( 'Calendar Month'n In (&lt;/SPAN&gt;&lt;SPAN&gt;1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) )&amp;nbsp; will always be True unless it is missing. This is equivalent to using the NotMissing operator, if that is your intent.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I believe that&amp;nbsp;( 'terminationtype'n In (' ') ) might also be better expressed using the Missing operator, although it should work as it is.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Looking at the full expression, it seems like it would be difficult for it ever to return 0.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sam&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Sep 2020 14:02:31 GMT</pubDate>
    <dc:creator>Sam_SAS</dc:creator>
    <dc:date>2020-09-21T14:02:31Z</dc:date>
    <item>
      <title>Nexted if else statement Issue</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/684553#M14195</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Created a new calculation based on nested if-else, only else if part working in the below condition. Can please tell me why if the part is not working&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF ( ( 'Calendar Year'n = 2020 ) AND ( 'current_status'n = '1' )&lt;BR /&gt;)&lt;BR /&gt;RETURN 1&lt;BR /&gt;ELSE (&lt;BR /&gt;IF ( ( 'Calendar Year'n In (2020) ) OR ( 'Calendar Month'n In (&lt;BR /&gt;1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) ) OR ( 'terminationtype'n&lt;BR /&gt;In (' ') ) )&lt;BR /&gt;RETURN 1&lt;BR /&gt;ELSE 0 )&amp;nbsp;&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;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 11:39:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/684553#M14195</guid>
      <dc:creator>kiranch</dc:creator>
      <dc:date>2020-09-17T11:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Nexted if else statement Issue</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/684570#M14196</link>
      <description>&lt;P&gt;Maxim 3: Know Your Data.&lt;/P&gt;
&lt;P&gt;Is Calendar Year of type numeric?&lt;/P&gt;
&lt;P&gt;Is current_status of type character?&lt;/P&gt;
&lt;P&gt;Do you actually have a combination of numeric 2020 and character '1' in your data?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 12:42:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/684570#M14196</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-17T12:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Nexted if else statement Issue</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/684572#M14197</link>
      <description>&lt;P&gt;The outer condition returns a 1, and the second condition returns a 1, so you can't detect which of those was true. And you use&lt;/P&gt;
&lt;PRE&gt;RETURN 1&lt;/PRE&gt;
&lt;P&gt;for the IFs, but a simple&lt;/P&gt;
&lt;PRE&gt;0&lt;/PRE&gt;
&lt;P&gt;in the ELSE. Should that have been&lt;/P&gt;
&lt;PRE&gt;RETURN 0&lt;/PRE&gt;
&lt;P&gt;? (I am not familiar with VA syntax)&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 12:47:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/684572#M14197</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-17T12:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Nexted if else statement Issue</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/684573#M14198</link>
      <description>&lt;P&gt;What language is that?&lt;/P&gt;
&lt;P&gt;In SAS data step the syntax for IF is IF condition THEN statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if ( 'Calendar Year'n = 2020 ) AND ( 'current_status'n = '1' ) then RETURN=1;
ELSE IF ( 'Calendar Year'n In (2020) )
     OR ( 'Calendar Month'n In (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) )
     OR ( 'terminationtype'n In (' ') )  then RETURN=1;
else return=0;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Sep 2020 12:49:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/684573#M14198</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-17T12:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Nexted if else statement Issue</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/684583#M14199</link>
      <description>Hi Kurtbremser,&lt;BR /&gt;&lt;BR /&gt;Thanks for the response,&lt;BR /&gt;&lt;BR /&gt;Yes, Calendar year in numeric and current_status is Character, I have combinations in my dataset, I am getting the second condition result because If use the termination type I get one result and If I use Current status I get another result.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Kiran</description>
      <pubDate>Thu, 17 Sep 2020 13:00:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/684583#M14199</guid>
      <dc:creator>kiranch</dc:creator>
      <dc:date>2020-09-17T13:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Nexted if else statement Issue</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/684592#M14200</link>
      <description>&lt;P&gt;Thanks Tom, For the immediate response In Sas Visual Analytics, We will create the calculated columns, Check the below Image, You can recollect.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kiranch_0-1600348608608.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49491i1463452DF8EB8CAF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kiranch_0-1600348608608.png" alt="kiranch_0-1600348608608.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 13:18:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/684592#M14200</guid>
      <dc:creator>kiranch</dc:creator>
      <dc:date>2020-09-17T13:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Nexted if else statement Issue</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/685436#M14213</link>
      <description>&lt;P&gt;Hello Kiran,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two conditions that return 1, so it might be helpful for troubleshooting purposes to change one of them to return 2 so we know which result is being returned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I am not mistaken,&amp;nbsp;&lt;SPAN&gt;( 'Calendar Month'n In (&lt;/SPAN&gt;&lt;SPAN&gt;1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) )&amp;nbsp; will always be True unless it is missing. This is equivalent to using the NotMissing operator, if that is your intent.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I believe that&amp;nbsp;( 'terminationtype'n In (' ') ) might also be better expressed using the Missing operator, although it should work as it is.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Looking at the full expression, it seems like it would be difficult for it ever to return 0.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sam&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 14:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/685436#M14213</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2020-09-21T14:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Nexted if else statement Issue</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/686609#M14228</link>
      <description>&lt;P&gt;Thanks Sam,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try based on your suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 05:21:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Nexted-if-else-statement-Issue/m-p/686609#M14228</guid>
      <dc:creator>kiranch</dc:creator>
      <dc:date>2020-09-25T05:21:21Z</dc:date>
    </item>
  </channel>
</rss>

