<?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 Date diff with another row in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Date-diff-with-another-row/m-p/2116492#M91110</link>
    <description>&lt;P&gt;Hi everyone, I have a table in which the data can be aggregated by the fields A and B, as in the following image:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OrbytaQliker_1-1694608787163.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/116197i6923D797CAC640A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OrbytaQliker_1-1694608787163.png" alt="OrbytaQliker_1-1694608787163.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can see in this pivot table how the data is aggregated.&lt;/P&gt;
&lt;P&gt;my request is calculate the date diff of the field date2 with the previous row (es: i m in the row 3, i should calculate the date diff of field date2 of row 3 and row2), and for&amp;nbsp; the first item of each aggregated data the date diff between date2 and date1.&lt;/P&gt;
&lt;P&gt;I'd accept both the resolution in script and in frontend.&lt;/P&gt;
&lt;P&gt;Sorry for my English and thank you very much if you can help me!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Sep 2023 12:45:32 GMT</pubDate>
    <dc:creator>OrbytaQliker</dc:creator>
    <dc:date>2023-09-13T12:45:32Z</dc:date>
    <item>
      <title>Date diff with another row</title>
      <link>https://community.qlik.com/t5/App-Development/Date-diff-with-another-row/m-p/2116492#M91110</link>
      <description>&lt;P&gt;Hi everyone, I have a table in which the data can be aggregated by the fields A and B, as in the following image:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OrbytaQliker_1-1694608787163.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/116197i6923D797CAC640A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OrbytaQliker_1-1694608787163.png" alt="OrbytaQliker_1-1694608787163.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can see in this pivot table how the data is aggregated.&lt;/P&gt;
&lt;P&gt;my request is calculate the date diff of the field date2 with the previous row (es: i m in the row 3, i should calculate the date diff of field date2 of row 3 and row2), and for&amp;nbsp; the first item of each aggregated data the date diff between date2 and date1.&lt;/P&gt;
&lt;P&gt;I'd accept both the resolution in script and in frontend.&lt;/P&gt;
&lt;P&gt;Sorry for my English and thank you very much if you can help me!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 12:45:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-diff-with-another-row/m-p/2116492#M91110</guid>
      <dc:creator>OrbytaQliker</dc:creator>
      <dc:date>2023-09-13T12:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Date diff with another row</title>
      <link>https://community.qlik.com/t5/App-Development/Date-diff-with-another-row/m-p/2116639#M91117</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;This can be done either in the script or in the layout.&lt;/P&gt;
&lt;P&gt;In the script, you would need to load your data sorted by all the key fields (A, B, C) and then chronologically by Date, and in the load, you'd use functions Previous() and Peek() to fetch the date from the last record and to verify that the last record belongs to the same set of keys (A, B, C). You can read about this technique in &lt;A href="https://www.naturalsynergies.com/q-tip-12-peek-or-previous/" target="_blank" rel="noopener"&gt;my blog&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the layout, you'd need to use the function Above() to fetch the value from the row above.&lt;/P&gt;
&lt;P&gt;To learn more advanced development techniques, check out the agenda of the &lt;A href="https://masterssummit.com" target="_blank"&gt;Masters Summit for Qlik&lt;/A&gt; - coming soon to Orlando and to Dublin!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 16:47:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-diff-with-another-row/m-p/2116639#M91117</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2023-09-13T16:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Date diff with another row</title>
      <link>https://community.qlik.com/t5/App-Development/Date-diff-with-another-row/m-p/2116844#M91126</link>
      <description>&lt;P&gt;Thank you, your suggestion works well!!!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 07:42:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-diff-with-another-row/m-p/2116844#M91126</guid>
      <dc:creator>OrbytaQliker</dc:creator>
      <dc:date>2023-09-14T07:42:57Z</dc:date>
    </item>
  </channel>
</rss>

