<?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 Help in Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263163#M98994</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think there are two issues:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) TotFreight is not generally known in the Load (the new name is only known after the load is done).&lt;/P&gt;&lt;P&gt;So you need to use&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;If(&lt;STRONG&gt;sum(Freight)&lt;/STRONG&gt; &amp;gt;0, 'Invoice', 'CreditNote') as InvoiceType,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) if you are using group by clause, you need to use aggregation functions for all fields that are not listed with the group by, e.g. Client Name, Address, Amount, Qty.&lt;/P&gt;&lt;P&gt;How do you want to aggregate this fields?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jan 2012 12:41:35 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-01-10T12:41:35Z</dc:date>
    <item>
      <title>Help in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263161#M98992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I am trying a script which is not working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please advise me where I am making mistake&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DeptNo,&lt;/P&gt;&lt;P&gt;DeptSub,&lt;/P&gt;&lt;P&gt;DeptLoc,&lt;/P&gt;&lt;P&gt;ClientName,&lt;/P&gt;&lt;P&gt;Address,&lt;/P&gt;&lt;P&gt;Sum(Freight) as TotFreight,&lt;/P&gt;&lt;P&gt;Amount,&lt;/P&gt;&lt;P&gt;If(TotFreight &amp;gt;0, 'Invoice', 'CreditNote') as InvoiceType,&lt;/P&gt;&lt;P&gt;Qty;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * &lt;/P&gt;&lt;P&gt;from SalesTable group by DeptNo, DeptSub, DeptLoc; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="mcePaste" id="_mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 0px; left: -10000px;"&gt;﻿&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2012 12:35:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263161#M98992</guid>
      <dc:creator />
      <dc:date>2012-01-10T12:35:57Z</dc:date>
    </item>
    <item>
      <title>Help in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263162#M98993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi You are using aggregation without using group by.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can first load the table and do the transformation and then use aggregation (Sum) on resident load.&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2012 12:38:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263162#M98993</guid>
      <dc:creator>vijay_iitkgp</dc:creator>
      <dc:date>2012-01-10T12:38:33Z</dc:date>
    </item>
    <item>
      <title>Help in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263163#M98994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think there are two issues:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) TotFreight is not generally known in the Load (the new name is only known after the load is done).&lt;/P&gt;&lt;P&gt;So you need to use&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;If(&lt;STRONG&gt;sum(Freight)&lt;/STRONG&gt; &amp;gt;0, 'Invoice', 'CreditNote') as InvoiceType,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) if you are using group by clause, you need to use aggregation functions for all fields that are not listed with the group by, e.g. Client Name, Address, Amount, Qty.&lt;/P&gt;&lt;P&gt;How do you want to aggregate this fields?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2012 12:41:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263163#M98994</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-01-10T12:41:35Z</dc:date>
    </item>
    <item>
      <title>Help in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263164#M98995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Dear Vijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply but I am using group by clause see the below and when I run it hangs the computer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SQL Select * &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from SalesTable group by DeptNo, DeptSub, DeptLoc; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2012 12:43:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263164#M98995</guid>
      <dc:creator />
      <dc:date>2012-01-10T12:43:13Z</dc:date>
    </item>
    <item>
      <title>Help in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263165#M98996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;you need to put all the fields inside group by expcept the field which is inside aggregate function&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;i.e&amp;nbsp; &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;Freight which is in side sum.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;hope this helps&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2012 12:43:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263165#M98996</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2012-01-10T12:43:58Z</dc:date>
    </item>
    <item>
      <title>Help in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263166#M98997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Dear Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per your point when I try &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(&lt;STRONG&gt;sum(Freight)&lt;/STRONG&gt; &amp;gt;0, 'Invoice', 'CreditNote') as InvoiceType, when I reload its silent for long time and hangs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the point (b) it contains many field names so that is not possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2012 12:49:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263166#M98997</guid>
      <dc:creator />
      <dc:date>2012-01-10T12:49:59Z</dc:date>
    </item>
    <item>
      <title>Help in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263167#M98998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not correct aggregation .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can not do Select * from Sales Table Group by DeptNo,DeptSub,DeptLoc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First Select the columns you require from SQL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;Select&lt;/P&gt;&lt;P&gt;A,B,C....&lt;/P&gt;&lt;P&gt;From Sales Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that find the field&amp;nbsp; which you need to aggregate Group by the fields you want .&lt;/P&gt;&lt;P&gt;Eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;A,&lt;/P&gt;&lt;P&gt;B,&lt;/P&gt;&lt;P&gt;Sum(C) AS C&lt;/P&gt;&lt;P&gt;Resident Table1 Group By A,B;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2012 12:52:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263167#M98998</guid>
      <dc:creator>vijay_iitkgp</dc:creator>
      <dc:date>2012-01-10T12:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263168#M98999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you could try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; in thte first step load everything to a new table without aggregation and create a new keyfield (&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;%DeptNo%DeptSub%DeptLoc&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sales:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;DeptNo &amp;amp; '\' &amp;amp; DeptSub &amp;amp; '\' &amp;amp;DeptLoc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as %DeptNo%DeptSub%DeptLoc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9; color: #636363; font-family: Arial; font-size: 12px;"&gt;Select *&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;from SalesTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the second step aggregate your data following the rules that every used field must be either contained within your group by statement or in any sort of aggregation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SalesAggregated:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;%DeptNo%DeptSub%DeptLoc,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(Freight)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as TotFreight,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(Amount)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as TotAmount,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(Qty)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as TotQty,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(sum(Freight) &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;&amp;gt; 0, 'Invoice', 'CreditNote')&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as InvoiceType&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;resident&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales&lt;/P&gt;&lt;P&gt;group by&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;%DeptNo%DeptSub%DeptLoc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;And please read about the basics of aggregation in SQL and/or Qlikview.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;greetings,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;Edgar&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2012 13:07:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263168#M98999</guid>
      <dc:creator>ekech_infomotio</dc:creator>
      <dc:date>2012-01-10T13:07:41Z</dc:date>
    </item>
    <item>
      <title>Help in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263169#M99000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not correct the use of the group by.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL Select *&lt;/P&gt;&lt;P&gt;from SalesTable group by DeptNo, DeptSub, DeptLoc; ---&amp;gt; Not valid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sales: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;DeptNo,&lt;/P&gt;&lt;P&gt;DeptSub,&lt;/P&gt;&lt;P&gt;DeptLoc,&lt;/P&gt;&lt;P&gt;ClientName,&lt;/P&gt;&lt;P&gt;Address,&lt;/P&gt;&lt;P&gt;Freight,&lt;/P&gt;&lt;P&gt;Amount,&lt;/P&gt;&lt;P&gt;TotFreight,&lt;/P&gt;&lt;P&gt;Qty;&lt;/P&gt;&lt;P&gt;Select * &lt;/P&gt;&lt;P&gt;from SalesTable&lt;/P&gt;&lt;P&gt;Strore Sales&amp;nbsp; Into &lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;Drop Sales&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sales1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DeptNo,&lt;/P&gt;&lt;P&gt;DeptSub,&lt;/P&gt;&lt;P&gt;DeptLoc,&lt;/P&gt;&lt;P&gt;ClientName,&lt;/P&gt;&lt;P&gt;Address,&lt;/P&gt;&lt;P&gt;Sum(Freight) as TotFreight,&lt;/P&gt;&lt;P&gt;Amount,&lt;/P&gt;&lt;P&gt;If(TotFreight &amp;gt;0, 'Invoice', 'CreditNote') as InvoiceType,&lt;/P&gt;&lt;P&gt;Qty&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM &lt;C&gt;(qvd) &lt;/C&gt;&lt;/P&gt;&lt;P&gt;group by DeptNo,DeptSub,DeptLoc,ClientName,Address,Amount,InvoiceType,,Qty&lt;/P&gt;&lt;P&gt;Strore Sales1 into &lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ivan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2012 13:18:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-Script/m-p/263169#M99000</guid>
      <dc:creator />
      <dc:date>2012-01-10T13:18:13Z</dc:date>
    </item>
  </channel>
</rss>

