<?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: Group by clause with Flags in Qliksense Script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Group-by-clause-with-Flags-in-Qliksense-Script/m-p/2416645#M95191</link>
    <description>&lt;P&gt;Table3 is loading data from Table2, but in Table2 there is no field named SumBal and no field named nAvgBal (although there is a field named AvgBal). So it seems you are trying to do calculations with data that doesn't exists in Table2 when creating Table3.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Feb 2024 13:19:49 GMT</pubDate>
    <dc:creator>henrikalmen</dc:creator>
    <dc:date>2024-02-08T13:19:49Z</dc:date>
    <item>
      <title>Group by clause with Flags in Qliksense Script</title>
      <link>https://community.qlik.com/t5/App-Development/Group-by-clause-with-Flags-in-Qliksense-Script/m-p/2416621#M95186</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;I need to develop a logic in Qliksense Script with group by clause.&lt;/P&gt;
&lt;P&gt;There are multiple calculations to be done. In the Table3, I need to do a calculation and also create a flag.&lt;/P&gt;
&lt;P&gt;Below is the code. I am getting Invalid Expression for table3 for this calculation Sum(Interest)/nAvgBal/Days1.&lt;/P&gt;
&lt;P&gt;I tried this code in preceeding load as well but error is same.&lt;/P&gt;
&lt;P&gt;MainTable:&lt;BR /&gt;Select ID,DayofMonth,Balance,Interest&lt;BR /&gt;from qvd;&lt;/P&gt;
&lt;P&gt;Table1:&lt;BR /&gt;Select ID,&lt;BR /&gt;DayofMonth,&lt;BR /&gt;Sum(Balance) as SumBal,&lt;BR /&gt;Sum(Interest) as Interest&lt;BR /&gt;resident MainTable&lt;BR /&gt;group by&lt;BR /&gt;ID,&lt;BR /&gt;DayofMonth;&lt;/P&gt;
&lt;P&gt;Table2:&lt;BR /&gt;Load &lt;BR /&gt;ID,&lt;BR /&gt;Avg(SumBal) as [Avg Balance],&lt;BR /&gt;Sum(Interest) as Interest,&lt;BR /&gt;Count(SumBal) AS Days,&lt;BR /&gt;Count(SumBal)*365 AS Days1,&lt;BR /&gt;If(Avg(SumBal)=0,0,Avg(SumBal)) as AvgBal&lt;BR /&gt;Resident Table1&lt;BR /&gt;Group by &lt;BR /&gt;ID&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;Table3:&lt;BR /&gt;Select ID,&lt;BR /&gt;Avg(SumBal) as AvgBal,&lt;BR /&gt;Sum(Interest) as Interest1,&lt;BR /&gt;Count(SumBal) as Days1,&lt;BR /&gt;Sum(Interest)/nAvgBal/Days1 as InterestRate&lt;BR /&gt;Resident Table2&lt;BR /&gt;Group by &lt;BR /&gt;ID&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;Kindly help. Thanks in advance.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sunaina&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 12:42:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Group-by-clause-with-Flags-in-Qliksense-Script/m-p/2416621#M95186</guid>
      <dc:creator>SunainaUmberkar</dc:creator>
      <dc:date>2024-02-08T12:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Group by clause with Flags in Qliksense Script</title>
      <link>https://community.qlik.com/t5/App-Development/Group-by-clause-with-Flags-in-Qliksense-Script/m-p/2416645#M95191</link>
      <description>&lt;P&gt;Table3 is loading data from Table2, but in Table2 there is no field named SumBal and no field named nAvgBal (although there is a field named AvgBal). So it seems you are trying to do calculations with data that doesn't exists in Table2 when creating Table3.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 13:19:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Group-by-clause-with-Flags-in-Qliksense-Script/m-p/2416645#M95191</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2024-02-08T13:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Group by clause with Flags in Qliksense Script</title>
      <link>https://community.qlik.com/t5/App-Development/Group-by-clause-with-Flags-in-Qliksense-Script/m-p/2416646#M95192</link>
      <description>&lt;P&gt;You want to access fields which are created in this load - that's not valide because only fields which exists already in the source could be fetched. You may change your statement to:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Table3:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;load ID,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Avg(SumBal) as AvgBal,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sum(Interest) as Interest1,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Count(SumBal) as Days1,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sum(Interest) / Avg(SumBal) / Count(SumBal) as InterestRate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resident Table2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Group by&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 13:19:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Group-by-clause-with-Flags-in-Qliksense-Script/m-p/2416646#M95192</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-02-08T13:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Group by clause with Flags in Qliksense Script</title>
      <link>https://community.qlik.com/t5/App-Development/Group-by-clause-with-Flags-in-Qliksense-Script/m-p/2416656#M95195</link>
      <description>&lt;P&gt;Hello Marcus,&lt;/P&gt;
&lt;P&gt;Thanks for the quick response. I will check on this approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 13:33:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Group-by-clause-with-Flags-in-Qliksense-Script/m-p/2416656#M95195</guid>
      <dc:creator>SunainaUmberkar</dc:creator>
      <dc:date>2024-02-08T13:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Group by clause with Flags in Qliksense Script</title>
      <link>https://community.qlik.com/t5/App-Development/Group-by-clause-with-Flags-in-Qliksense-Script/m-p/2416657#M95196</link>
      <description>&lt;P&gt;Hello henrikalmen,&lt;/P&gt;
&lt;P&gt;Sorry my bad. Its typo mistake.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 13:33:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Group-by-clause-with-Flags-in-Qliksense-Script/m-p/2416657#M95196</guid>
      <dc:creator>SunainaUmberkar</dc:creator>
      <dc:date>2024-02-08T13:33:42Z</dc:date>
    </item>
  </channel>
</rss>

