<?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: Calculated Items with WHERE conditions in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Calculated-Items-with-WHERE-conditions/m-p/740117#M29033</link>
    <description>&lt;P&gt;About 1), try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data X;
  do I = 1 to 365;
    date = today() - I;
    do type = "A", "B";
      output;
    end;
  end;
run;


proc sql;
select count(*)
from X
where DATE &amp;gt; (today() - 30 * 6)
 and TYPE = 'A'
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;About 2), it is already a "float" since SAS doesn't distinguish numeric types, they all are just "numbers".&lt;/P&gt;
&lt;P&gt;B&lt;/P&gt;</description>
    <pubDate>Mon, 10 May 2021 08:50:18 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2021-05-10T08:50:18Z</dc:date>
    <item>
      <title>Calculated Items with WHERE conditions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Calculated-Items-with-WHERE-conditions/m-p/740109#M29032</link>
      <description>&lt;P&gt;Hey, I'm a bit new to SAS.&lt;BR /&gt;One of my SAS users asked me to create a calculated item which could be used for campaigns in Customer Intelligence Studio in order to define certain populations.&lt;/P&gt;&lt;P&gt;The item can be translated to the following MS SQL querry:&lt;BR /&gt;&lt;BR /&gt;select count(*)&lt;BR /&gt;from&amp;nbsp;X&lt;BR /&gt;where 1=1&lt;BR /&gt;and DATE &amp;gt; getdate() - 30 * 6&lt;BR /&gt;and TYPE = 'A'&lt;BR /&gt;&lt;BR /&gt;In other words, we need the amount of records of type A of the last half of the year.&lt;/P&gt;&lt;P&gt;I've managed to create an item that counts all records of table X, but:&lt;/P&gt;&lt;P&gt;1) I don't know how to include my WHERE conditions.&lt;/P&gt;&lt;P&gt;2) I don't know how to define the item as FLOAT (it will be a numerator of another item for percentage calculations).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Note:&lt;/P&gt;&lt;P&gt;a) The item must be created in Information Maps, not Customer Intelligence Studio.&lt;/P&gt;&lt;P&gt;b) I've been asked by the user to create a single item to be used in Customer Intelligence studio.&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 07:33:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Calculated-Items-with-WHERE-conditions/m-p/740109#M29032</guid>
      <dc:creator>Eitan123</dc:creator>
      <dc:date>2021-05-10T07:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Items with WHERE conditions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Calculated-Items-with-WHERE-conditions/m-p/740117#M29033</link>
      <description>&lt;P&gt;About 1), try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data X;
  do I = 1 to 365;
    date = today() - I;
    do type = "A", "B";
      output;
    end;
  end;
run;


proc sql;
select count(*)
from X
where DATE &amp;gt; (today() - 30 * 6)
 and TYPE = 'A'
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;About 2), it is already a "float" since SAS doesn't distinguish numeric types, they all are just "numbers".&lt;/P&gt;
&lt;P&gt;B&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 08:50:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Calculated-Items-with-WHERE-conditions/m-p/740117#M29033</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2021-05-10T08:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Items with WHERE conditions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Calculated-Items-with-WHERE-conditions/m-p/740129#M29034</link>
      <description>&lt;P&gt;Hey yabwon,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;about 1): where do I write this code? within the expression of the item in information maps?&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 10:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Calculated-Items-with-WHERE-conditions/m-p/740129#M29034</guid>
      <dc:creator>Eitan123</dc:creator>
      <dc:date>2021-05-10T10:26:32Z</dc:date>
    </item>
  </channel>
</rss>

