<?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: If - Then - ElseIf - EndIf in Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378461#M420559</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at this I have two things to say&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) I am not surprised that the load times are high. Aggregations in the script can take a lot of toll and depending on the number or rows you are aggregating on, it can last hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) So, are you looking to load this just one time instead of loading the same table thrice? It is def. possible, but you will have to test if you see any performance gains or not because earlier you were breaking down the aggregations into three parts (lets say 100k, 100k, 100k) whereas the combined will do the same aggregation on 300k rows. Where are you creating your Source_Table in the above script? I did not see that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 21 Oct 2017 11:17:49 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-10-21T11:17:49Z</dc:date>
    <item>
      <title>If - Then - ElseIf - EndIf in Script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378453#M420551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to figure out if this is even possible. I haven't had any luck on my own using the following routine and any similar. I'm trying to apply logic on a resident table and make field values based on the initial logic. I realize the following is probably not syntactically correct. Assume the variables are valued values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anything like this possible without loading the resident table 3x to get the desired result?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Summary_Data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;NoConcatenate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;If &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country = 'US' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Date &amp;gt;= '$(vStartOneDate)' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Date &amp;lt;= '$(vTableOneDate)' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Then&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; App,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'One' as Source_Table&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Else If &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country = 'US' &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Date &amp;gt;= '$(vStartTwoDate)' &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Date &amp;lt;= '$(vTableTwoDate)' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; App,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Two' as Source_Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Else If &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country = 'US' &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Date &amp;gt;= '$(vStartThreeDate)' &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Date &amp;lt;= '$(vTableThreeDate)' &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; App,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Three' as Source_Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;End If&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Resident Detailed_Data;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2017 22:31:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378453#M420551</guid>
      <dc:creator>johnca</dc:creator>
      <dc:date>2017-10-16T22:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: If - Then - ElseIf - EndIf in Script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378454#M420552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe no, You have to load 3 times for that &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 01:04:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378454#M420552</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-10-17T01:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: If - Then - ElseIf - EndIf in Script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378455#M420553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try below.&lt;/P&gt;&lt;P&gt;If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country = 'US'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Date &amp;gt;= '$(vStartOneDate)'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Date &amp;lt;= '$(vTableOneDate)'&lt;/P&gt;&lt;P&gt;Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD Product,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; App,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'One' as Source_Table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident Detailed_Data;&lt;/P&gt;&lt;P&gt;Else If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country = 'US'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Date &amp;gt;= '$(vStartTwoDate)'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Date &amp;lt;= '$(vTableTwoDate)'&lt;/P&gt;&lt;P&gt;Then Load &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; App,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Two' as Source_Table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident Detailed_Data;&lt;/P&gt;&lt;P&gt;Else If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country = 'US'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Date &amp;gt;= '$(vStartThreeDate)'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Date &amp;lt;= '$(vTableThreeDate)'&lt;/P&gt;&lt;P&gt;Then Load &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; App,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Three' as Source_Table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident Detailed_Data;&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 10:53:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378455#M420553</guid>
      <dc:creator />
      <dc:date>2017-10-17T10:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: If - Then - ElseIf - EndIf in Script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378456#M420554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Since you are updating the Source_Table field with three different values, you have to load the resident table thrice while concatenating all three.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 11:19:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378456#M420554</guid>
      <dc:creator>madhumitha</dc:creator>
      <dc:date>2017-10-17T11:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: If - Then - ElseIf - EndIf in Script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378457#M420555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Summary_Data:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NoConcatenate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; App,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Country = 'US' and Date &amp;gt;= '$(vStartOneDate)' and Date &amp;lt;= '$(vTableOneDate)', 'One',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Country = 'US' and Date &amp;gt;= '$(vStartTwoDate)' and Date &amp;lt;= '$(vTableTwoDate)', 'Two',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Country = 'US' and Date &amp;gt;= '$(vStartThreeDate)' and Date &amp;lt;= '$(vTableThreeDate)', 'Three'))) as Source_Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Resident Detailed_Data;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 11:37:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378457#M420555</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-10-17T11:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: If - Then - ElseIf - EndIf in Script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378458#M420556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I mis-wrote my sample code. I also needed to add counts of things based on the date ranges, so would need to add a group by. The entire effort was to try and speed up the load by reading the resident table once. Based on my initial sample code I believe Sunny had the right idea, but with the embedded if statements on several fields probably slows it down. Will try any way. The actual resident table has about 30 days of ~500,000 rows, or 15M rows. It now takes 18 minutes per load for each (3) type so i all about 55 minutes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 15:43:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378458#M420556</guid>
      <dc:creator>johnca</dc:creator>
      <dc:date>2017-10-17T15:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: If - Then - ElseIf - EndIf in Script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378459#M420557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you show the script you are running right now?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 23:32:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378459#M420557</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-10-17T23:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: If - Then - ElseIf - EndIf in Script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378460#M420558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny, I think I can show it in it's raw form. Nothing confidential. Each residential load (3x) take 15-18 minutes) and the second 2 concatenate to the first. THANKS for taking a look...John&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//US NMC data&lt;/P&gt;&lt;P&gt;TRACE Generating US NMC summary data...;&lt;/P&gt;&lt;P&gt;Summary_Data:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vUS_NMC_TableDate)' as MS_Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vUS_NMC_SummaryType)' as MS_Summary_Type,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UA as MS_UA,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; App as MS_App,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country as MS_Country,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product as MS_Product,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NMC_Acct_Num as MS_NMC_Acct_Num,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Msg_Type as MS_Msg_Type,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Transport as MS_Transport,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(distinct UA) as MS_Units,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Transactions) as MS_Transactions, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Bytes) as MS_Bytes,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(distinct if(SAT_Trans &amp;gt; 0, UA)) as MS_SAT_Units,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(SAT_Trans) as MS_SAT_Trans,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(SAT_Bytes) as MS_SAT_Bytes,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(distinct if(OVT_Trans &amp;gt; 0, UA)) as MS_OVT_Units,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(OVT_Trans) as MS_OVT_Trans,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(OVT_Bytes) as MS_OVT_Bytes,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(distinct if(WIFI_Trans &amp;gt; 0, UA)) as MS_WIFI_Units,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(WIFI_Trans) as MS_WIFI_Trans,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(WIFI_Bytes) as MS_WIFI_Bytes&lt;/P&gt;&lt;P&gt;Resident Detailed_Data&lt;/P&gt;&lt;P&gt;Where Country = 'US'&lt;/P&gt;&lt;P&gt;and Date &amp;gt;= '$(vUS_NMC_SummaryStartDate)'&lt;/P&gt;&lt;P&gt;and Date &amp;lt;= '$(vUS_NMC_TableDate)'&lt;/P&gt;&lt;P&gt;//NMC App values are numeric&lt;/P&gt;&lt;P&gt;and IsNum(App)&lt;/P&gt;&lt;P&gt;Group by UA, App, Country, Product, NMC_Acct_Num, Msg_Type, Transport;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//US NGB data&lt;/P&gt;&lt;P&gt;TRACE Generating US NGB summary data...;&lt;/P&gt;&lt;P&gt;NGB_Summary_Data:&lt;/P&gt;&lt;P&gt;Concatenate (Summary_Data)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vUS_NGB_TableDate)' as MS_Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vUS_NGB_SummaryType)' as MS_Summary_Type,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UA as MS_UA,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; App as MS_App,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country as MS_Country,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product as MS_Product,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NMC_Acct_Num as MS_NMC_Acct_Num,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Msg_Type as MS_Msg_Type,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Transport as MS_Transport,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(distinct UA) as MS_Units,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Transactions) as MS_Transactions, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Bytes) as MS_Bytes,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(distinct if(SAT_Trans &amp;gt; 0, UA)) as MS_SAT_Units,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(SAT_Trans) as MS_SAT_Trans,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(SAT_Bytes) as MS_SAT_Bytes,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(distinct if(OVT_Trans &amp;gt; 0, UA)) as MS_OVT_Units,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(OVT_Trans) as MS_OVT_Trans,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(OVT_Bytes) as MS_OVT_Bytes,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(distinct if(WIFI_Trans &amp;gt; 0, UA)) as MS_WIFI_Units,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(WIFI_Trans) as MS_WIFI_Trans,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(WIFI_Bytes) as MS_WIFI_Bytes&lt;/P&gt;&lt;P&gt;Resident Detailed_Data&lt;/P&gt;&lt;P&gt;Where Country = 'US'&lt;/P&gt;&lt;P&gt;and Date &amp;gt;= '$(vUS_NGB_SummaryStartDate)'&lt;/P&gt;&lt;P&gt;and Date &amp;lt;= '$(vUS_NGB_TableDate)'&lt;/P&gt;&lt;P&gt;//NMC App values are text&lt;/P&gt;&lt;P&gt;and IsText(App)&lt;/P&gt;&lt;P&gt;Group by UA, App, Country, Product, NMC_Acct_Num, Msg_Type, Transport;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//CA data &lt;/P&gt;&lt;P&gt;TRACE Generating CA summary data...;&lt;/P&gt;&lt;P&gt;CA_Summary_Data:&lt;/P&gt;&lt;P&gt;Concatenate (Summary_Data)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vCATableDate)' as MS_Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vCA_SummaryType)' as MS_Summary_Type,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UA as MS_UA,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; App as MS_App,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country as MS_Country,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product as MS_Product,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NMC_Acct_Num as MS_NMC_Acct_Num,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Msg_Type as MS_Msg_Type,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Transport as MS_Transport,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(distinct UA) as MS_Units,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Transactions) as MS_Transactions, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Bytes) as MS_Bytes,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(distinct if(SAT_Trans &amp;gt; 0, UA)) as MS_SAT_Units,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(SAT_Trans) as MS_SAT_Trans,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(SAT_Bytes) as MS_SAT_Bytes,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(distinct if(OVT_Trans &amp;gt; 0, UA)) as MS_OVT_Units,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(OVT_Trans) as MS_OVT_Trans,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(OVT_Bytes) as MS_OVT_Bytes,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(distinct if(WIFI_Trans &amp;gt; 0, UA)) as MS_WIFI_Units,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(WIFI_Trans) as MS_WIFI_Trans,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(WIFI_Bytes) as MS_WIFI_Bytes&lt;/P&gt;&lt;P&gt;Resident Detailed_Data&lt;/P&gt;&lt;P&gt;Where Country = 'CA'&lt;/P&gt;&lt;P&gt;and Date &amp;gt;= '$(vCA_SummaryStartDate)'&lt;/P&gt;&lt;P&gt;and Date &amp;lt;= '$(vCATableDate)'&lt;/P&gt;&lt;P&gt;Group by UA, App, Country, Product, NMC_Acct_Num, Msg_Type, Transport; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 18:31:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378460#M420558</guid>
      <dc:creator>johnca</dc:creator>
      <dc:date>2017-10-18T18:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: If - Then - ElseIf - EndIf in Script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378461#M420559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at this I have two things to say&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) I am not surprised that the load times are high. Aggregations in the script can take a lot of toll and depending on the number or rows you are aggregating on, it can last hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) So, are you looking to load this just one time instead of loading the same table thrice? It is def. possible, but you will have to test if you see any performance gains or not because earlier you were breaking down the aggregations into three parts (lets say 100k, 100k, 100k) whereas the combined will do the same aggregation on 300k rows. Where are you creating your Source_Table in the above script? I did not see that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Oct 2017 11:17:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378461#M420559</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-10-21T11:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: If - Then - ElseIf - EndIf in Script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378462#M420560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;This IF structure will not work, you must use the alternative that is used in graphics,&lt;STRONG&gt; IF (&amp;lt;Condition&amp;gt;, True, false)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Oct 2017 16:38:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378462#M420560</guid>
      <dc:creator>uroboros</dc:creator>
      <dc:date>2017-10-21T16:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: If - Then - ElseIf - EndIf in Script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378463#M420561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny, that's kind of what we figured, but still wanted another set of eyes. Now 15 minutes per run or 45 total. I have seen longer as you've mentioned. It's still faster than having it in the users' front end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I'm not certain of the number of rows in the source table (this is a contemporary's project) but I believe it is in the 10's of million of rows. &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;The source table is created reading a database on a daily basis.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I (and my cohort) appreciate the thought provided.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;John&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Oct 2017 18:26:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378463#M420561</guid>
      <dc:creator>johnca</dc:creator>
      <dc:date>2017-10-22T18:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: If - Then - ElseIf - EndIf in Script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378464#M420562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could start by trying to remove the IF functions from the Count() aggregation functions. Since you're reading everything from an internal table, it would be better to create field copies that have their value set to NULL if the condition xxx&amp;lt;=0 is fulfilled during the initial LOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thought: set one of three flags to 0/1 if the condition is fulfilled, and use Sum() instead of Count() to create the counts. Sum() is way faster than Count(). However the DISTINCT keyword may force you to create a complex version of this simple expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Oct 2017 07:32:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-ElseIf-EndIf-in-Script/m-p/1378464#M420562</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-10-23T07:32:18Z</dc:date>
    </item>
  </channel>
</rss>

