<?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: sum in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639126#M476346</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For your table load from SQL i renamed as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;And then create the resident load of the table by Name &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;EWTD &lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;and call &lt;/SPAN&gt;&lt;STRONG style="font-size: 10pt; line-height: 1.5em;"&gt;tmpEWTD &lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;on that and do aggregation and make the SUM field named &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Surgical Admissions]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;tmpEWTD:///This are Important&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;ActualValue,&lt;/P&gt;&lt;P&gt;TLMKey,&lt;/P&gt;&lt;P&gt;SLMKey,&lt;/P&gt;&lt;P&gt;MetricDesc,&lt;/P&gt;&lt;P&gt;MetricKey,&lt;/P&gt;&lt;P&gt;if((TLMKey=18 and SLMKey=142 and MetricKey =3) or (TLMKey =18 and SLMKey =142 and MetricKey =5),MetricKey ) as Discharges,&lt;/P&gt;&lt;P&gt;if(TLMKey=18 and SLMKey =166 and MetricKey=4,MetricKey) as[Reducing Health Care acquired Infection],&lt;/P&gt;&lt;P&gt;if((TLMKey=18 and SLMKey=200 and MetricKey=46) or (TLMKey=18 and SLMKey=200 and MetricKey=47),MetricKey) as[Surgical Admissions],&lt;/P&gt;&lt;P&gt;RDODesc,&lt;/P&gt;&lt;P&gt;RDOKey,&lt;/P&gt;&lt;P&gt;ReferredMM,&lt;/P&gt;&lt;P&gt;ReferredYYYY, &lt;/P&gt;&lt;P&gt;SGKey,&lt;/P&gt;&lt;P&gt;SGName,&lt;/P&gt;&lt;P&gt;ServiceProvider,&lt;/P&gt;&lt;P&gt;ServiceProviderType,&lt;/P&gt;&lt;P&gt;ServiceProviderNum,&lt;/P&gt;&lt;P&gt;if(ServiceProviderType='H',ServiceProvider) as Hospital,&lt;/P&gt;&lt;P&gt;if(ServiceProviderType='T',ServiceProvider) as HospitalGroup;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Healthstat.dbo."MMI_ScorecardLevel3"&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=142 and MetricKey=3) or&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=142 and MetricKey=5) or&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=166 and MetricKey=4) or&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=200 and MetricKey=46) or&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=200 and MetricKey=47)&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;(ServiceProviderType='H' or ServiceProviderType='T');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Noconcatenate //&lt;STRONG&gt;///This are Important&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EWTD: &lt;STRONG&gt;///This are Important&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;ActualValue,&lt;/P&gt;&lt;P&gt;TLMKey,&lt;/P&gt;&lt;P&gt;SLMKey,&lt;/P&gt;&lt;P&gt;MetricDesc,&lt;/P&gt;&lt;P&gt;MetricKey,&lt;/P&gt;&lt;P&gt;Discharges,&lt;/P&gt;&lt;P&gt;[Reducing Health Care acquired Infection],&lt;/P&gt;&lt;P&gt;[Surgical Admissions],&lt;/P&gt;&lt;P&gt;RDODesc,&lt;/P&gt;&lt;P&gt;RDOKey,&lt;/P&gt;&lt;P&gt;ReferredMM,&lt;/P&gt;&lt;P&gt;ReferredYYYY, &lt;/P&gt;&lt;P&gt;SGKey,&lt;/P&gt;&lt;P&gt;SGName,&lt;/P&gt;&lt;P&gt;ServiceProvider,&lt;/P&gt;&lt;P&gt;ServiceProviderType,&lt;/P&gt;&lt;P&gt;ServiceProviderNum,&lt;/P&gt;&lt;P&gt;Hospital,&lt;/P&gt;&lt;P&gt;HospitalGroup,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum(if((TLMKey=18 and SLMKey=200 and Match(MetricKey,46,47)) ,ActualValue)) as [Surgical Admissions] &lt;STRONG&gt;///This are Important&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Resident &lt;STRONG&gt;tmpEWTD &lt;STRONG&gt;///This are Important&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group By &lt;STRONG&gt;///This are Important&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ActualValue,&lt;/P&gt;&lt;P&gt;TLMKey,&lt;/P&gt;&lt;P&gt;SLMKey,&lt;/P&gt;&lt;P&gt;MetricDesc,&lt;/P&gt;&lt;P&gt;MetricKey,&lt;/P&gt;&lt;P&gt;Discharges,&lt;/P&gt;&lt;P&gt;[Reducing Health Care acquired Infection],&lt;/P&gt;&lt;P&gt;[Surgical Admissions],&lt;/P&gt;&lt;P&gt;RDODesc,&lt;/P&gt;&lt;P&gt;RDOKey,&lt;/P&gt;&lt;P&gt;ReferredMM,&lt;/P&gt;&lt;P&gt;ReferredYYYY, &lt;/P&gt;&lt;P&gt;SGKey,&lt;/P&gt;&lt;P&gt;SGName,&lt;/P&gt;&lt;P&gt;ServiceProvider,&lt;/P&gt;&lt;P&gt;ServiceProviderType,&lt;/P&gt;&lt;P&gt;ServiceProviderNum,&lt;/P&gt;&lt;P&gt;Hospital,&lt;/P&gt;&lt;P&gt;HospitalGroup;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Drop table &lt;STRONG&gt;tmpEWTD&lt;/STRONG&gt;; //This is important&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Note:- Now check i update and use Noconcatenate also.&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jun 2014 11:47:38 GMT</pubDate>
    <dc:creator>its_anandrjs</dc:creator>
    <dc:date>2014-06-04T11:47:38Z</dc:date>
    <item>
      <title>sum in script</title>
      <link>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639120#M476340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I am trying to add the values together of the two metrics below in the script so that I can then use this value in other calculations in a table and I am not having much luck.&amp;nbsp; Can anyone help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TLMKey&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=18 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SLMKey&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=200 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MetricKey&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=46) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TLMKey&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=18 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SLMKey&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=200 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MetricKey&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=47),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ActualValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Surgical Admissions] &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Full load statement:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SET&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;ThousandSep&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=',';&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SET&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;DecimalSep&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;='.';&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SET&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;MoneyThousandSep&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=',';&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SET&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;MoneyDecimalSep&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;='.';&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SET&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;MoneyFormat&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;='€#,##0.00;-€#,##0.00';&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SET&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;TimeFormat&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;='hh:mm:ss';&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SET&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;DateFormat&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;='DD/MM/YYYY';&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SET&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;TimestampFormat&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;='DD/MM/YYYY hh:mm:ss[.fff]';&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SET&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;MonthNames&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SET&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;DayNames&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;='Mon;Tue;Wed;Thu;Fri;Sat;Sun';&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;OLEDB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;CONNECT32&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TO&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Healthstat;Data Source=cifdevelopment;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=EL6470B0001;Use Encryption for Data=False;Tag with column collation when possible=False]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//-------- Start Multiple Select Statements ------&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;EWTD:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ActualValue&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TLMKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SLMKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MetricDesc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MetricKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TLMKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=18 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SLMKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=142 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MetricKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=3) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TLMKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=18 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SLMKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=142 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MetricKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=5),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MetricKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Discharges&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TLMKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=18 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SLMKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=166 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MetricKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=4,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MetricKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Reducing Health Care acquired Infection]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TLMKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=18 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SLMKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=200 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MetricKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=46) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TLMKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=18 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SLMKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=200 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MetricKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=47),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MetricKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Surgical Admissions]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;RDODesc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;RDOKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ReferredMM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ReferredYYYY&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SGKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SGName&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ServiceProvider&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ServiceProviderType&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ServiceProviderNum&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ServiceProviderType&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;='H',&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ServiceProvider&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hospital&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ServiceProviderType&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;='T',&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ServiceProvider&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;HospitalGroup&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SQL&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;SELECT&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;*&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;FROM&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;Healthstat.dbo."MMI_ScorecardLevel3"&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;where&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;(tlmkey&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;=&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;18&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;and&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;slmkey&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;=&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;142&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;and&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;MetricKey=3)&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;or&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;(tlmkey&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;=&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;18&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;and&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;slmkey&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;=&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;142&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;and&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;MetricKey=5)&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;or&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;(tlmkey&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;=&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;18&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;and&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;slmkey&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;=&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;166&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;and&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;MetricKey=4)&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;or&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;(tlmkey&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;=&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;18&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;and&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;slmkey=200&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;and&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;MetricKey=46)&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;or&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;(tlmkey=18&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;and&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;slmkey=200&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;and&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;MetricKey=47)&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;and&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;(ServiceProviderType='H'&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;or&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;&lt;EM style="color: #800040; font-size: 8pt;"&gt;ServiceProviderType='T')&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;MonthMapping:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;INLINE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[&lt;BR /&gt;ReferredMM, Month&lt;BR /&gt;&lt;BR /&gt;1, Jan&lt;BR /&gt;&lt;BR /&gt;2, Feb&lt;BR /&gt;&lt;BR /&gt;3, Mar&lt;BR /&gt;&lt;BR /&gt;4, Apr&lt;BR /&gt;&lt;BR /&gt;5, May&lt;BR /&gt;&lt;BR /&gt;6, June&lt;BR /&gt;&lt;BR /&gt;7, July&lt;BR /&gt;&lt;BR /&gt;8, Aug&lt;BR /&gt;&lt;BR /&gt;9, Sept&lt;BR /&gt;&lt;BR /&gt;10, Oct&lt;BR /&gt;&lt;BR /&gt;11, Nov&lt;BR /&gt;&lt;BR /&gt;12, Dec&lt;BR /&gt;&lt;BR /&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Thanks for all the help so far this is a great forum&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Rhona&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 10:46:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639120#M476340</guid>
      <dc:creator>rcorcoran</dc:creator>
      <dc:date>2014-06-04T10:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: sum in script</title>
      <link>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639121#M476341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you post the entire load statement (for this one only) you are trying with?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 10:50:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639121#M476341</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-06-04T10:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: sum in script</title>
      <link>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639122#M476342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have put it up now&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 10:54:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639122#M476342</guid>
      <dc:creator>rcorcoran</dc:creator>
      <dc:date>2014-06-04T10:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: sum in script</title>
      <link>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639123#M476343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess you have to try like:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(If(......)) as YourNewFieldName&lt;/P&gt;&lt;P&gt;From &amp;lt;&amp;gt; Group By;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 11:03:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639123#M476343</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-06-04T11:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: sum in script</title>
      <link>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639124#M476344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Update now check sorry i forget to add drop statement&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take resident table and load your table like below script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;tmpEWTD:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;ActualValue,&lt;/P&gt;&lt;P&gt;TLMKey,&lt;/P&gt;&lt;P&gt;SLMKey,&lt;/P&gt;&lt;P&gt;MetricDesc,&lt;/P&gt;&lt;P&gt;MetricKey,&lt;/P&gt;&lt;P&gt;if((TLMKey=18 and SLMKey=142 and MetricKey =3) or (TLMKey =18 and SLMKey =142 and MetricKey =5),MetricKey ) as Discharges,&lt;/P&gt;&lt;P&gt;if(TLMKey=18 and SLMKey =166 and MetricKey=4,MetricKey) as[Reducing Health Care acquired Infection],&lt;/P&gt;&lt;P&gt;if((TLMKey=18 and SLMKey=200 and MetricKey=46) or (TLMKey=18 and SLMKey=200 and MetricKey=47),MetricKey) as[Surgical Admissions],&lt;/P&gt;&lt;P&gt;RDODesc,&lt;/P&gt;&lt;P&gt;RDOKey,&lt;/P&gt;&lt;P&gt;ReferredMM,&lt;/P&gt;&lt;P&gt;ReferredYYYY, &lt;/P&gt;&lt;P&gt;SGKey,&lt;/P&gt;&lt;P&gt;SGName,&lt;/P&gt;&lt;P&gt;ServiceProvider,&lt;/P&gt;&lt;P&gt;ServiceProviderType,&lt;/P&gt;&lt;P&gt;ServiceProviderNum,&lt;/P&gt;&lt;P&gt;if(ServiceProviderType='H',ServiceProvider) as Hospital,&lt;/P&gt;&lt;P&gt;if(ServiceProviderType='T',ServiceProvider) as HospitalGroup;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Healthstat.dbo."MMI_ScorecardLevel3"&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=142 and MetricKey=3) or&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=142 and MetricKey=5) or&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=166 and MetricKey=4) or&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=200 and MetricKey=46) or&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=200 and MetricKey=47)&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;(ServiceProviderType='H' or ServiceProviderType='T');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Noconcatenate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EWTD:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;ActualValue,&lt;/P&gt;&lt;P&gt;TLMKey,&lt;/P&gt;&lt;P&gt;SLMKey,&lt;/P&gt;&lt;P&gt;MetricDesc,&lt;/P&gt;&lt;P&gt;MetricKey,&lt;/P&gt;&lt;P&gt;Discharges,&lt;/P&gt;&lt;P&gt;[Reducing Health Care acquired Infection],&lt;/P&gt;&lt;P&gt;[Surgical Admissions],&lt;/P&gt;&lt;P&gt;RDODesc,&lt;/P&gt;&lt;P&gt;RDOKey,&lt;/P&gt;&lt;P&gt;ReferredMM,&lt;/P&gt;&lt;P&gt;ReferredYYYY, &lt;/P&gt;&lt;P&gt;SGKey,&lt;/P&gt;&lt;P&gt;SGName,&lt;/P&gt;&lt;P&gt;ServiceProvider,&lt;/P&gt;&lt;P&gt;ServiceProviderType,&lt;/P&gt;&lt;P&gt;ServiceProviderNum,&lt;/P&gt;&lt;P&gt;Hospital,&lt;/P&gt;&lt;P&gt;HospitalGroup,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum(if((TLMKey=18 and SLMKey=200 and Match(MetricKey,46,47)) ,ActualValue)) as [Surgical Admissions]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Resident &lt;STRONG&gt;tmpEWTD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group By&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ActualValue,&lt;/P&gt;&lt;P&gt;TLMKey,&lt;/P&gt;&lt;P&gt;SLMKey,&lt;/P&gt;&lt;P&gt;MetricDesc,&lt;/P&gt;&lt;P&gt;MetricKey,&lt;/P&gt;&lt;P&gt;Discharges,&lt;/P&gt;&lt;P&gt;[Reducing Health Care acquired Infection],&lt;/P&gt;&lt;P&gt;[Surgical Admissions],&lt;/P&gt;&lt;P&gt;RDODesc,&lt;/P&gt;&lt;P&gt;RDOKey,&lt;/P&gt;&lt;P&gt;ReferredMM,&lt;/P&gt;&lt;P&gt;ReferredYYYY, &lt;/P&gt;&lt;P&gt;SGKey,&lt;/P&gt;&lt;P&gt;SGName,&lt;/P&gt;&lt;P&gt;ServiceProvider,&lt;/P&gt;&lt;P&gt;ServiceProviderType,&lt;/P&gt;&lt;P&gt;ServiceProviderNum,&lt;/P&gt;&lt;P&gt;Hospital,&lt;/P&gt;&lt;P&gt;HospitalGroup;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Drop table &lt;STRONG&gt;tmpEWTD&lt;/STRONG&gt;; //This is important&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 11:13:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639124#M476344</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-06-04T11:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: sum in script</title>
      <link>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639125#M476345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks anand I have tried this but the load is failing with the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax error, missing/misplaced FROM:&lt;/P&gt;&lt;P&gt;tmpEWTD:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cant see where it is wrong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 11:35:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639125#M476345</guid>
      <dc:creator>rcorcoran</dc:creator>
      <dc:date>2014-06-04T11:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: sum in script</title>
      <link>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639126#M476346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For your table load from SQL i renamed as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;And then create the resident load of the table by Name &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;EWTD &lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;and call &lt;/SPAN&gt;&lt;STRONG style="font-size: 10pt; line-height: 1.5em;"&gt;tmpEWTD &lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;on that and do aggregation and make the SUM field named &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Surgical Admissions]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;tmpEWTD:///This are Important&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;ActualValue,&lt;/P&gt;&lt;P&gt;TLMKey,&lt;/P&gt;&lt;P&gt;SLMKey,&lt;/P&gt;&lt;P&gt;MetricDesc,&lt;/P&gt;&lt;P&gt;MetricKey,&lt;/P&gt;&lt;P&gt;if((TLMKey=18 and SLMKey=142 and MetricKey =3) or (TLMKey =18 and SLMKey =142 and MetricKey =5),MetricKey ) as Discharges,&lt;/P&gt;&lt;P&gt;if(TLMKey=18 and SLMKey =166 and MetricKey=4,MetricKey) as[Reducing Health Care acquired Infection],&lt;/P&gt;&lt;P&gt;if((TLMKey=18 and SLMKey=200 and MetricKey=46) or (TLMKey=18 and SLMKey=200 and MetricKey=47),MetricKey) as[Surgical Admissions],&lt;/P&gt;&lt;P&gt;RDODesc,&lt;/P&gt;&lt;P&gt;RDOKey,&lt;/P&gt;&lt;P&gt;ReferredMM,&lt;/P&gt;&lt;P&gt;ReferredYYYY, &lt;/P&gt;&lt;P&gt;SGKey,&lt;/P&gt;&lt;P&gt;SGName,&lt;/P&gt;&lt;P&gt;ServiceProvider,&lt;/P&gt;&lt;P&gt;ServiceProviderType,&lt;/P&gt;&lt;P&gt;ServiceProviderNum,&lt;/P&gt;&lt;P&gt;if(ServiceProviderType='H',ServiceProvider) as Hospital,&lt;/P&gt;&lt;P&gt;if(ServiceProviderType='T',ServiceProvider) as HospitalGroup;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Healthstat.dbo."MMI_ScorecardLevel3"&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=142 and MetricKey=3) or&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=142 and MetricKey=5) or&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=166 and MetricKey=4) or&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=200 and MetricKey=46) or&lt;/P&gt;&lt;P&gt;(tlmkey=18 and slmkey=200 and MetricKey=47)&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;(ServiceProviderType='H' or ServiceProviderType='T');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Noconcatenate //&lt;STRONG&gt;///This are Important&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EWTD: &lt;STRONG&gt;///This are Important&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;ActualValue,&lt;/P&gt;&lt;P&gt;TLMKey,&lt;/P&gt;&lt;P&gt;SLMKey,&lt;/P&gt;&lt;P&gt;MetricDesc,&lt;/P&gt;&lt;P&gt;MetricKey,&lt;/P&gt;&lt;P&gt;Discharges,&lt;/P&gt;&lt;P&gt;[Reducing Health Care acquired Infection],&lt;/P&gt;&lt;P&gt;[Surgical Admissions],&lt;/P&gt;&lt;P&gt;RDODesc,&lt;/P&gt;&lt;P&gt;RDOKey,&lt;/P&gt;&lt;P&gt;ReferredMM,&lt;/P&gt;&lt;P&gt;ReferredYYYY, &lt;/P&gt;&lt;P&gt;SGKey,&lt;/P&gt;&lt;P&gt;SGName,&lt;/P&gt;&lt;P&gt;ServiceProvider,&lt;/P&gt;&lt;P&gt;ServiceProviderType,&lt;/P&gt;&lt;P&gt;ServiceProviderNum,&lt;/P&gt;&lt;P&gt;Hospital,&lt;/P&gt;&lt;P&gt;HospitalGroup,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum(if((TLMKey=18 and SLMKey=200 and Match(MetricKey,46,47)) ,ActualValue)) as [Surgical Admissions] &lt;STRONG&gt;///This are Important&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Resident &lt;STRONG&gt;tmpEWTD &lt;STRONG&gt;///This are Important&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group By &lt;STRONG&gt;///This are Important&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ActualValue,&lt;/P&gt;&lt;P&gt;TLMKey,&lt;/P&gt;&lt;P&gt;SLMKey,&lt;/P&gt;&lt;P&gt;MetricDesc,&lt;/P&gt;&lt;P&gt;MetricKey,&lt;/P&gt;&lt;P&gt;Discharges,&lt;/P&gt;&lt;P&gt;[Reducing Health Care acquired Infection],&lt;/P&gt;&lt;P&gt;[Surgical Admissions],&lt;/P&gt;&lt;P&gt;RDODesc,&lt;/P&gt;&lt;P&gt;RDOKey,&lt;/P&gt;&lt;P&gt;ReferredMM,&lt;/P&gt;&lt;P&gt;ReferredYYYY, &lt;/P&gt;&lt;P&gt;SGKey,&lt;/P&gt;&lt;P&gt;SGName,&lt;/P&gt;&lt;P&gt;ServiceProvider,&lt;/P&gt;&lt;P&gt;ServiceProviderType,&lt;/P&gt;&lt;P&gt;ServiceProviderNum,&lt;/P&gt;&lt;P&gt;Hospital,&lt;/P&gt;&lt;P&gt;HospitalGroup;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Drop table &lt;STRONG&gt;tmpEWTD&lt;/STRONG&gt;; //This is important&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Note:- Now check i update and use Noconcatenate also.&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 11:47:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-in-script/m-p/639126#M476346</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-06-04T11:47:38Z</dc:date>
    </item>
  </channel>
</rss>

