<?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 How to multiply the result of a case statement which is labeled as literal by a number in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-multiply-the-result-of-a-case-statement-which-is-labeled/m-p/751491#M236573</link>
    <description>&lt;PRE&gt;Proc sql;
create table mytable as
select distinct b.this
, case 
when b.rate &amp;lt; 0.35 then '35th'
when b.rate &amp;lt; 0.45 then '55th'
end as 'current rate'n
, case
when b.rate &amp;lt; 0.35 then '45th'
when b.rate &amp;lt; 0.45 then '65th'
end as 'next rate'n
, case
when b.rate &amp;lt;.35 then (b.rate * 'next rate'n)
when b.rate &amp;lt;0.45 then (b.rate * 'next rate'n)
end as 'final'
from tableb b Left Join tablea a&lt;/PRE&gt;
&lt;P&gt;regards,&lt;/P&gt;
&lt;P&gt;blue blue&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jul 2021 16:03:02 GMT</pubDate>
    <dc:creator>GN0001</dc:creator>
    <dc:date>2021-07-01T16:03:02Z</dc:date>
    <item>
      <title>How to multiply the result of a case statement which is labeled as literal by a number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-multiply-the-result-of-a-case-statement-which-is-labeled/m-p/751491#M236573</link>
      <description>&lt;PRE&gt;Proc sql;
create table mytable as
select distinct b.this
, case 
when b.rate &amp;lt; 0.35 then '35th'
when b.rate &amp;lt; 0.45 then '55th'
end as 'current rate'n
, case
when b.rate &amp;lt; 0.35 then '45th'
when b.rate &amp;lt; 0.45 then '65th'
end as 'next rate'n
, case
when b.rate &amp;lt;.35 then (b.rate * 'next rate'n)
when b.rate &amp;lt;0.45 then (b.rate * 'next rate'n)
end as 'final'
from tableb b Left Join tablea a&lt;/PRE&gt;
&lt;P&gt;regards,&lt;/P&gt;
&lt;P&gt;blue blue&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 16:03:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-multiply-the-result-of-a-case-statement-which-is-labeled/m-p/751491#M236573</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-07-01T16:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to multiply the result of a case statement which is labeled as literal by a number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-multiply-the-result-of-a-case-statement-which-is-labeled/m-p/751493#M236575</link>
      <description>&lt;P&gt;Is there a question in there somewhere?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you looking for the CALCULATED keyword?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select amount
        , sum(amount) as total
         , amount / calculated total as percent
from have
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jul 2021 16:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-multiply-the-result-of-a-case-statement-which-is-labeled/m-p/751493#M236575</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-07-01T16:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to multiply the result of a case statement which is labeled as literal by a number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-multiply-the-result-of-a-case-statement-which-is-labeled/m-p/751512#M236588</link>
      <description>&lt;P&gt;Hello Tom,&lt;/P&gt;
&lt;P&gt;I put a case statement in the code to calculate something. I found the answer while I was typing the question.&lt;/P&gt;
&lt;P&gt;That was to multiply the label that is create for a case statement with a number. Since the label is a literal, I didn't know how to multiply by a text. I found the solution by mysel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the response.&lt;/P&gt;
&lt;P&gt;Blue blue&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 17:35:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-multiply-the-result-of-a-case-statement-which-is-labeled/m-p/751512#M236588</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-07-01T17:35:38Z</dc:date>
    </item>
  </channel>
</rss>

