<?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: Using AGGR in Load Script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-AGGR-in-Load-Script/m-p/1784333#M61131</link>
    <description>&lt;P&gt;Thanks Marcus.&lt;/P&gt;&lt;P&gt;When I try this and drop the data into a straight table it gives me every date as a maxencounterdatekey.&lt;/P&gt;&lt;P&gt;How would I just get the biggest MaxEncounterDateKey (202001009) for each patientdurablekey?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ryanfliehman_2-1613759829611.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/49478i901DE6761DBA4848/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ryanfliehman_2-1613759829611.png" alt="ryanfliehman_2-1613759829611.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Feb 2021 18:40:42 GMT</pubDate>
    <dc:creator>ryanfliehman</dc:creator>
    <dc:date>2021-02-19T18:40:42Z</dc:date>
    <item>
      <title>Using AGGR in Load Script</title>
      <link>https://community.qlik.com/t5/App-Development/Using-AGGR-in-Load-Script/m-p/1784272#M61127</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to get the the most recent BMI (using Max(EncounterDateKey) by patient (patientdurablekey).&lt;/P&gt;&lt;P&gt;When I try using aggr in my load script it keeps giving me an error right Aggr. It looks like it has something to do with the max function of my statement. Below is what I have. Does anyone have any ideas on how I might be able to rewrite or fix this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TempTableVisit:&lt;BR /&gt;LOAD&lt;BR /&gt;PatientDurableKey,&lt;BR /&gt;EncounterDateKey,&lt;BR /&gt;"M_VISIT.BODY MASS INDEX"&lt;BR /&gt;FROM [lib://Qlik Init/Prod/qvds/qvds_Facts/VisitFactRpt.qvd](qvd)&lt;BR /&gt;Where "M_VISIT.BODY MASS INDEX" &amp;gt;= '0';&lt;/P&gt;&lt;P&gt;VisitBMI:&lt;BR /&gt;LOAD&lt;BR /&gt;IF(Aggr(Max(EncounterDateKey),PatientDurableKey),"M_VISIT.BODY MASS INDEX")&lt;BR /&gt;Resident TempTableVisit;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 17:28:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-AGGR-in-Load-Script/m-p/1784272#M61127</guid>
      <dc:creator>ryanfliehman</dc:creator>
      <dc:date>2024-11-16T17:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using AGGR in Load Script</title>
      <link>https://community.qlik.com/t5/App-Development/Using-AGGR-in-Load-Script/m-p/1784286#M61129</link>
      <description>&lt;P&gt;Aggr() is an UI function. Within the script you need an aggregation load with a group by statement. In your case maybe this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VisitBMI:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Max(EncounterDateKey) as MaxEncounterDateKey, PatientDurableKey, M_VISIT.BODY MASS INDEX&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resident TempTableVisit group by PatientDurableKey, M_VISIT.BODY MASS INDEX;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2021 16:33:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-AGGR-in-Load-Script/m-p/1784286#M61129</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-02-19T16:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using AGGR in Load Script</title>
      <link>https://community.qlik.com/t5/App-Development/Using-AGGR-in-Load-Script/m-p/1784333#M61131</link>
      <description>&lt;P&gt;Thanks Marcus.&lt;/P&gt;&lt;P&gt;When I try this and drop the data into a straight table it gives me every date as a maxencounterdatekey.&lt;/P&gt;&lt;P&gt;How would I just get the biggest MaxEncounterDateKey (202001009) for each patientdurablekey?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ryanfliehman_2-1613759829611.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/49478i901DE6761DBA4848/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ryanfliehman_2-1613759829611.png" alt="ryanfliehman_2-1613759829611.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2021 18:40:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-AGGR-in-Load-Script/m-p/1784333#M61131</guid>
      <dc:creator>ryanfliehman</dc:creator>
      <dc:date>2021-02-19T18:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using AGGR in Load Script</title>
      <link>https://community.qlik.com/t5/App-Development/Using-AGGR-in-Load-Script/m-p/1784538#M61160</link>
      <description>&lt;P&gt;It means that the aggregation scope isn't suitable - just remove the other fields - maybe like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VisitBMI:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Max(EncounterDateKey) as MaxEncounterDateKey, PatientDurableKey&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resident TempTableVisit group by PatientDurableKey;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 06:49:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-AGGR-in-Load-Script/m-p/1784538#M61160</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-02-22T06:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using AGGR in Load Script</title>
      <link>https://community.qlik.com/t5/App-Development/Using-AGGR-in-Load-Script/m-p/1784761#M61172</link>
      <description>&lt;P&gt;Thanks Marcus, this ended up working.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 14:23:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-AGGR-in-Load-Script/m-p/1784761#M61172</guid>
      <dc:creator>ryanfliehman</dc:creator>
      <dc:date>2021-02-22T14:23:00Z</dc:date>
    </item>
  </channel>
</rss>

