<?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: peek the previous in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283591#M847377</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the replies guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stefan's solution is what I am expecting.&lt;/P&gt;&lt;P&gt;Just a final question. I want to &lt;STRONG&gt;connect&lt;/STRONG&gt; both the aggregated table and the Data table, so that selection on any field in Data table in UI will filter the chart based on fields from aggregated table. I created the concatenated key, but throwing error-&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Product&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;amp; '|'&amp;amp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;key&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Mar 2017 12:15:01 GMT</pubDate>
    <dc:creator>surajap123</dc:creator>
    <dc:date>2017-03-27T12:15:01Z</dc:date>
    <item>
      <title>peek the previous</title>
      <link>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283588#M847374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I want to take the sales of previous month, if there is no current month sales. I tried to do this using peek function, but it is not working.&lt;/P&gt;&lt;P&gt;In this example you can notice that Product: Pencil has no sales in Feb. So I want to pick the sales of Pencil from Jan.&lt;/P&gt;&lt;P&gt;Here is the complete script-&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Data:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;INLINE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[&lt;BR /&gt; Product, Date, Sales&lt;BR /&gt; Pen, 01/01/2017, 10&lt;BR /&gt; Pen, 02/01/2017, 10&lt;BR /&gt; Pencil, 01/01/2017, 10&lt;BR /&gt; Pencil, 02/01/2017, 10&lt;BR /&gt; Pen, 01/02/2017, 10&lt;BR /&gt; Pen, 02/02/2017, 10&lt;BR /&gt; Pencil, 01/02/2017&lt;BR /&gt; Pencil, 02/02/2017&lt;BR /&gt; ]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; AggrData:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Product&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Pd&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Sales&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)=0,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Sales&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Sales&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AggrSales&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Data&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Group&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Product&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283588#M847374</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: peek the previous</title>
      <link>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283589#M847375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You want same date previous month sale or last day of previous month? If I change your example to this, what would be the required output?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;LOAD * INLINE [&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Product, Date, Sales&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Pen, 01/01/2017, 10&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Pen, 02/01/2017, 10&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Pencil, 01/01/2017, &lt;SPAN style="color: #ff0000;"&gt;40&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Pencil, 02/01/2017, &lt;SPAN style="color: #ff0000;"&gt;50&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Pen, 01/02/2017, 10&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Pen, 02/02/2017, 10&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Pencil, 01/02/2017&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Pencil, 02/02/2017&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will it be 50 and 50 for 01/02/2017 and 02/02/2017 or will it be 40 and 50?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2017 11:17:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283589#M847375</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-27T11:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: peek the previous</title>
      <link>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283590#M847376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AggrData:&lt;/P&gt;&lt;P&gt;LOAD Product as Pd,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Month(Date) as Month,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(sum(Sales)=0, If(Peek('Pd')= Product,Peek('AggrSales')),sum(Sales)) as AggrSales&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;Group by &lt;/P&gt;&lt;P&gt;&amp;nbsp; Month(Date),Product&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Order by Product, Date ;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2017 11:34:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283590#M847376</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-03-27T11:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: peek the previous</title>
      <link>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283591#M847377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the replies guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stefan's solution is what I am expecting.&lt;/P&gt;&lt;P&gt;Just a final question. I want to &lt;STRONG&gt;connect&lt;/STRONG&gt; both the aggregated table and the Data table, so that selection on any field in Data table in UI will filter the chart based on fields from aggregated table. I created the concatenated key, but throwing error-&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Product&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;amp; '|'&amp;amp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;key&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2017 12:15:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283591#M847377</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2017-03-27T12:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: peek the previous</title>
      <link>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283592#M847378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The filters should flow through in there current form... It will form a synthetic key, but I don't see a reason why the filters from Data table won't work....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2017 12:17:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283592#M847378</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-27T12:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: peek the previous</title>
      <link>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283593#M847379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or use Month(Date) in your key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *,Product &amp;amp; '|'&amp;amp; &lt;SPAN style="color: #ff0000;"&gt;Month(Date)&lt;/SPAN&gt; as key&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; INLINE [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product, Date, Sales, Country&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pen, 01/01/2017, 10, UK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pen, 02/01/2017, 10, UK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pencil, 01/01/2017, 10, US&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pencil, 02/01/2017, 10, UK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pen, 01/02/2017, 10, US&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pen, 02/02/2017, 10, UK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pencil, 01/02/2017, , US&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pencil, 02/02/2017, , UK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pencil, 02/02/2017, 1, UK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AggrData:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Product &amp;amp; '|'&amp;amp; &lt;SPAN style="color: #ff0000;"&gt;Month(Date)&lt;/SPAN&gt; as key,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Product as pd,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Month(Date) as Month,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; if(sum(Sales)=0, If(Peek('Pd')= Product,Peek('AggrSales')),sum(Sales)) as AggrSales&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Data&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group by &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Month(Date),Product&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Order by Product, Date;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2017 12:18:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283593#M847379</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-27T12:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: peek the previous</title>
      <link>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283594#M847380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your aggregated table, you are grouping on Month, not on Date. The Date field doesn't exist anymore and cannot be used to create a key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you can do is create a Month+Product key in both the original table and in the aggregated table. That will work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2017 12:18:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283594#M847380</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-03-27T12:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: peek the previous</title>
      <link>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283595#M847381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks your so much to everyone for solution/suggestion and time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2017 12:25:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/peek-the-previous/m-p/1283595#M847381</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2017-03-27T12:25:30Z</dc:date>
    </item>
  </channel>
</rss>

