<?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: Load only last x records in a chart for each id in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-only-last-x-records-in-a-chart-for-each-id/m-p/936889#M323403</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rank() or Max() or somthing similar could help you here I believe. Tyr to share a sample qvw (with sample data) and explain the expected output to get the faster solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Aug 2015 09:35:34 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2015-08-31T09:35:34Z</dc:date>
    <item>
      <title>Load only last x records in a chart for each id</title>
      <link>https://community.qlik.com/t5/QlikView/Load-only-last-x-records-in-a-chart-for-each-id/m-p/936888#M323402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Hello together,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I need you help regarding the following situation:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I have a table which contains laboratory information for patients. Each patient has a unique id and can have more than one value for a laboratory parameter. I want to show for each patient in a chart the average value for a special laboratory parameter. This works for me by using the following code in the expression of the chart: "avg(aggr(if(Parameter=Para4PatOverview,Value),Value,PatientID))"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;The variable 'Para4PatOverview' contains the selected laboratory parameter.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Now to my problem: I need to show in the chart only the last ex. 6 values of a laparotomy parameter for each patient based on the date of the value (the date information is in the same table).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I can't find a way to perform this query for the last values in the chart so I have tried to do this with the load script:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;“valuesForPatientOverviewWF:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;First 6&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;LOAD *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Resident Values order by Values.Date desc;“&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;But with this load script I only get the last "overall" values but I need to get the last values for each patient.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Many thanks for any advice/help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 09:20:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-only-last-x-records-in-a-chart-for-each-id/m-p/936888#M323402</guid>
      <dc:creator>daniel1990xyz</dc:creator>
      <dc:date>2015-08-31T09:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Load only last x records in a chart for each id</title>
      <link>https://community.qlik.com/t5/QlikView/Load-only-last-x-records-in-a-chart-for-each-id/m-p/936889#M323403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rank() or Max() or somthing similar could help you here I believe. Tyr to share a sample qvw (with sample data) and explain the expected output to get the faster solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 09:35:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-only-last-x-records-in-a-chart-for-each-id/m-p/936889#M323403</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2015-08-31T09:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Load only last x records in a chart for each id</title>
      <link>https://community.qlik.com/t5/QlikView/Load-only-last-x-records-in-a-chart-for-each-id/m-p/936890#M323404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in script, load your table (source),&lt;/P&gt;&lt;P&gt;then add a counter (Id, restart from 1 when patient or parameter change)&lt;/P&gt;&lt;P&gt;and filter &amp;lt;= 6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;source:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;...........&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;final:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;load * &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;where Id &amp;lt;= 6;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;noconcatenate load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #3d3d3d; font-size: 13.3333px; font-family: Arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PatientID,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #3d3d3d; font-size: 13.3333px; font-family: Arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: Arial, sans-serif; font-size: 13.3333px;"&gt;Parameter,&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style=": ; color: #3d3d3d; font-size: 13.3333px; font-family: Arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date,&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style=": ; color: #3d3d3d; font-size: 13.3333px; font-family: Arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style=": ; color: #3d3d3d; font-size: 13.3333px; font-family: Arial, sans-serif;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Peek(&lt;SPAN style="color: #3d3d3d; font-family: Arial, sans-serif; font-size: 13.3333px;"&gt;PatientID&lt;/SPAN&gt;)&amp;lt;&amp;gt; &lt;SPAN style="color: #3d3d3d; font-family: Arial, sans-serif; font-size: 13.3333px;"&gt;PatientID or &lt;SPAN style="color: #3d3d3d; font-family: Arial, sans-serif; font-size: 13.3333px;"&gt;Peek(&lt;SPAN style="color: #3d3d3d; font-family: Arial, sans-serif; font-size: 13.3333px;"&gt;Parameter&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: Arial, sans-serif; font-size: 13.3333px;"&gt;)&amp;lt;&amp;gt; &lt;SPAN style="color: #3d3d3d; font-family: Arial, sans-serif; font-size: 13.3333px;"&gt;Parameter&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;, 1, Peek(Id)+1) as Id&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style=": ; color: #3d3d3d; font-size: 13.3333px; font-family: Arial, sans-serif;"&gt;resident source&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style=": ; color: #3d3d3d; font-size: 13.3333px; font-family: Arial, sans-serif;"&gt;order by&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: Arial, sans-serif; font-size: 13.3333px;"&gt;PatientID,&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM style="color: #3d3d3d; font-size: 13.3333px; font-family: Arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: Arial, sans-serif; font-size: 13.3333px;"&gt;Parameter,&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: Arial, sans-serif; font-size: 13.3333px;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; Date desc;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: Arial, sans-serif; font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: Arial, sans-serif; font-size: 13.3333px;"&gt;&lt;EM&gt;drop table source;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 09:43:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-only-last-x-records-in-a-chart-for-each-id/m-p/936890#M323404</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-08-31T09:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Load only last x records in a chart for each id</title>
      <link>https://community.qlik.com/t5/QlikView/Load-only-last-x-records-in-a-chart-for-each-id/m-p/936891#M323405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Massimo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much that solved my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 12:43:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-only-last-x-records-in-a-chart-for-each-id/m-p/936891#M323405</guid>
      <dc:creator>daniel1990xyz</dc:creator>
      <dc:date>2015-08-31T12:43:58Z</dc:date>
    </item>
  </channel>
</rss>

