<?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: Multiple Ifs in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-Ifs/m-p/59079#M16631</link>
    <description>Hi Mark,&lt;BR /&gt;
&lt;BR /&gt;
I am providing you the sample code for what you require. I hope thats what you require as an answer.&lt;BR /&gt;
Keep in mind the "Week" function in the code will give you the week number starting from 1st week of the year i.e. the values will vary from 1 to 52. &lt;BR /&gt;
&lt;BR /&gt;
Just try understanding the code. If you are new to proc sql, then you can go through the some basic concepts of the same, but the query is as simple as a SQL statement.&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
input date ddmmyy10. laptop_mod: $2. revenue;&lt;BR /&gt;
cards;&lt;BR /&gt;
10/03/2009 A 1000&lt;BR /&gt;
11/03/2009 A 3000&lt;BR /&gt;
12/03/2009 B 2000&lt;BR /&gt;
12/03/2009 A 5000&lt;BR /&gt;
13/03/2009 A 4000&lt;BR /&gt;
14/03/2009 B 10000&lt;BR /&gt;
15/03/2009 B 5500&lt;BR /&gt;
16/03/2009 B 4000&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
&lt;BR /&gt;
select week(date) as Week, laptop_mod,&lt;BR /&gt;
sum(revenue) as revenue&lt;BR /&gt;
from test&lt;BR /&gt;
group by 1,2&lt;BR /&gt;
;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Saurabh.</description>
    <pubDate>Thu, 18 Feb 2010 06:38:47 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-02-18T06:38:47Z</dc:date>
    <item>
      <title>Multiple Ifs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-Ifs/m-p/59078#M16630</link>
      <description>Hello ,&lt;BR /&gt;
&lt;BR /&gt;
I'm stuck in the SAS code.I have sorted the data by the date of sale of product over two week time and there are 180 observations and i want to find revenues for the two weeks time , a breakdown of revenues over two weeks time.There are two models of the laptop sold - say A and B and price of A and B are $ 10 and $ 20 respectively.&lt;BR /&gt;
&lt;BR /&gt;
How do i produce this breakdown for both weeks of sale of the two laptops.&lt;BR /&gt;
&lt;BR /&gt;
sincere regards &lt;BR /&gt;
&lt;BR /&gt;
mark</description>
      <pubDate>Thu, 18 Feb 2010 05:02:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-Ifs/m-p/59078#M16630</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-02-18T05:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Ifs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-Ifs/m-p/59079#M16631</link>
      <description>Hi Mark,&lt;BR /&gt;
&lt;BR /&gt;
I am providing you the sample code for what you require. I hope thats what you require as an answer.&lt;BR /&gt;
Keep in mind the "Week" function in the code will give you the week number starting from 1st week of the year i.e. the values will vary from 1 to 52. &lt;BR /&gt;
&lt;BR /&gt;
Just try understanding the code. If you are new to proc sql, then you can go through the some basic concepts of the same, but the query is as simple as a SQL statement.&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
input date ddmmyy10. laptop_mod: $2. revenue;&lt;BR /&gt;
cards;&lt;BR /&gt;
10/03/2009 A 1000&lt;BR /&gt;
11/03/2009 A 3000&lt;BR /&gt;
12/03/2009 B 2000&lt;BR /&gt;
12/03/2009 A 5000&lt;BR /&gt;
13/03/2009 A 4000&lt;BR /&gt;
14/03/2009 B 10000&lt;BR /&gt;
15/03/2009 B 5500&lt;BR /&gt;
16/03/2009 B 4000&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
&lt;BR /&gt;
select week(date) as Week, laptop_mod,&lt;BR /&gt;
sum(revenue) as revenue&lt;BR /&gt;
from test&lt;BR /&gt;
group by 1,2&lt;BR /&gt;
;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Saurabh.</description>
      <pubDate>Thu, 18 Feb 2010 06:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-Ifs/m-p/59079#M16631</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-02-18T06:38:47Z</dc:date>
    </item>
  </channel>
</rss>

