<?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 Join + Group By in Qlik Sense in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Join-Group-By-in-Qlik-Sense/m-p/1195682#M22553</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 am trying to translate this sql query into a load script using a qvd file. The idea is to precalculate fees for the trailing 12 months at load to speed up things. This result is used in a complex score calculation that must be precalculated, so I cannot use a calendar to do it on the fly. PositionMonthlySnapshot is a 235 millions rows table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the SQL that would do the expected behavior:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;SELECT client_sk, d.snapshot_date, sum(firmcur_management_fees) FROM bi_poc_demo.position_monthly_fact p&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;join bi_poc_demo.t12_dates d on p.snapshot_date = d.t12_date&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;group by client_sk, d.snapshot_date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the load script:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;[T12 Months]:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Load&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; Floor([Snapshot Date]) as [Snapshot Date Master],&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; Floor(MonthEnd(AddMonths([Snapshot Date], -IterNo() + 1))) as [Snapshot Date]&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Resident [Snapshot Dates]&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;While IterNo() &amp;lt;= 12;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;[Position T12 Tmp]:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;LOAD [Client ID], [IA Code ID], [Branch ID], [Security ID], Floor([Snapshot Date]), [Position Management Fees],&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;FROM 'lib://QVDLib/PositionMonthlySnapshot.qvd' (qvd);&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;INNER JOIN ([Position T12 Tmp])&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;LOAD [Snapshot Date], [Snapshot Date Master]&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;RESIDENT [T12 Months];&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;[Position T12]:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;LOAD [Client ID], [Snapshot Date Master], SUM([Position Management Fees])&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;RESIDENT [Position T12 Tmp]&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;GROUP BY [Client ID], [Snapshot Date Master];&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;Although this script would work, the join between [&lt;SPAN style="font-size: 13.3333px;"&gt;Position T12 Tmp] and [&lt;SPAN style="font-size: 13.3333px;"&gt;T12 Months&lt;/SPAN&gt;] causes a 235M x 12 table, which makes me run out of RAM. Is there a better way to do this using Qlik, or will I have to do it in the warehouse?&lt;/SPAN&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>Thu, 13 Oct 2016 13:26:11 GMT</pubDate>
    <dc:creator>maxim1500</dc:creator>
    <dc:date>2016-10-13T13:26:11Z</dc:date>
    <item>
      <title>Join + Group By in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Join-Group-By-in-Qlik-Sense/m-p/1195682#M22553</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 am trying to translate this sql query into a load script using a qvd file. The idea is to precalculate fees for the trailing 12 months at load to speed up things. This result is used in a complex score calculation that must be precalculated, so I cannot use a calendar to do it on the fly. PositionMonthlySnapshot is a 235 millions rows table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the SQL that would do the expected behavior:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;SELECT client_sk, d.snapshot_date, sum(firmcur_management_fees) FROM bi_poc_demo.position_monthly_fact p&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;join bi_poc_demo.t12_dates d on p.snapshot_date = d.t12_date&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;group by client_sk, d.snapshot_date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the load script:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;[T12 Months]:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Load&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; Floor([Snapshot Date]) as [Snapshot Date Master],&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; Floor(MonthEnd(AddMonths([Snapshot Date], -IterNo() + 1))) as [Snapshot Date]&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Resident [Snapshot Dates]&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;While IterNo() &amp;lt;= 12;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;[Position T12 Tmp]:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;LOAD [Client ID], [IA Code ID], [Branch ID], [Security ID], Floor([Snapshot Date]), [Position Management Fees],&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;FROM 'lib://QVDLib/PositionMonthlySnapshot.qvd' (qvd);&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;INNER JOIN ([Position T12 Tmp])&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;LOAD [Snapshot Date], [Snapshot Date Master]&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;RESIDENT [T12 Months];&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;[Position T12]:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;LOAD [Client ID], [Snapshot Date Master], SUM([Position Management Fees])&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;RESIDENT [Position T12 Tmp]&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;GROUP BY [Client ID], [Snapshot Date Master];&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;Although this script would work, the join between [&lt;SPAN style="font-size: 13.3333px;"&gt;Position T12 Tmp] and [&lt;SPAN style="font-size: 13.3333px;"&gt;T12 Months&lt;/SPAN&gt;] causes a 235M x 12 table, which makes me run out of RAM. Is there a better way to do this using Qlik, or will I have to do it in the warehouse?&lt;/SPAN&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>Thu, 13 Oct 2016 13:26:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-Group-By-in-Qlik-Sense/m-p/1195682#M22553</guid>
      <dc:creator>maxim1500</dc:creator>
      <dc:date>2016-10-13T13:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Join + Group By in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Join-Group-By-in-Qlik-Sense/m-p/1195683#M22554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this full script?&lt;/P&gt;&lt;P&gt;I can not see any drop table statement&lt;/P&gt;&lt;P&gt;I believe the T12Months is redundant?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the join between Position T12 tmp and the next Table?&lt;/P&gt;&lt;P&gt;Is ClientID the key?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 13:36:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-Group-By-in-Qlik-Sense/m-p/1195683#M22554</guid>
      <dc:creator>robert_mika</dc:creator>
      <dc:date>2016-10-13T13:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Join + Group By in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Join-Group-By-in-Qlik-Sense/m-p/1195684#M22555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No it's not the full script, just the part equivalent to the SQL. The T12 Table is deleted after the join. &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;T12Months &lt;/SPAN&gt;contains the 12 months for each [Snapshot Date]. The idea is to sum the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[Position Management Fees] for each T12 for each month. The expected result is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Client ID&lt;/TD&gt;&lt;TD&gt;Snapshot Date&lt;/TD&gt;&lt;TD&gt;T12 Fees&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Jan 31 2015&lt;/TD&gt;&lt;TD&gt;456.42&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Dec 31 2014&lt;/TD&gt;&lt;TD&gt;235.24&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically, I need a T12 calculation for each entry in position_monthly_fact.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 13:56:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-Group-By-in-Qlik-Sense/m-p/1195684#M22555</guid>
      <dc:creator>maxim1500</dc:creator>
      <dc:date>2016-10-13T13:56:57Z</dc:date>
    </item>
  </channel>
</rss>

