<?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 Creating a flag for the last two months in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Creating-a-flag-for-the-last-two-months/m-p/1994475#M82322</link>
    <description>&lt;P&gt;Hello everybody,&amp;nbsp;I'm new to qlikview,&lt;BR /&gt;I need to create a flag field for customers who have used the same product in the last two months.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;in my load, I created a temporary table and thought of using the peek function, for her to check and create the flag for me. However, it's not working:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TEMP__1:
LOAD NR_CLIENT,
	 DT_INT_DISP,
	 DT_FINISH_DISP,
	 RowNo()
RESIDENT CLIENT_PRODUCT_DISP
WHERE NR_SEQ_PRODUCT=1
ORDER BY NR_CLIENT,
		 DT_INT_DISP ASC;


TEMP_2:
LOAD NR_CLIENT,
	 DT_INT_DISP,
	 DT_FINISH_DISP,
	 IF(NR_CLIENT=PEEK(NR_CLIENT),
		IF(DT_INT_DISP-PEEK(DT_FINISH_DISP),-2)'YES','NO'),'NO') AS FL_CLIENT_2,
		ROWNO(),
		Resident TMP_1
Order by NR_CLIENT, 
		 DT_INT_DISP ASC;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2022 13:32:24 GMT</pubDate>
    <dc:creator>lucasx15</dc:creator>
    <dc:date>2022-10-19T13:32:24Z</dc:date>
    <item>
      <title>Creating a flag for the last two months</title>
      <link>https://community.qlik.com/t5/App-Development/Creating-a-flag-for-the-last-two-months/m-p/1994475#M82322</link>
      <description>&lt;P&gt;Hello everybody,&amp;nbsp;I'm new to qlikview,&lt;BR /&gt;I need to create a flag field for customers who have used the same product in the last two months.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;in my load, I created a temporary table and thought of using the peek function, for her to check and create the flag for me. However, it's not working:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TEMP__1:
LOAD NR_CLIENT,
	 DT_INT_DISP,
	 DT_FINISH_DISP,
	 RowNo()
RESIDENT CLIENT_PRODUCT_DISP
WHERE NR_SEQ_PRODUCT=1
ORDER BY NR_CLIENT,
		 DT_INT_DISP ASC;


TEMP_2:
LOAD NR_CLIENT,
	 DT_INT_DISP,
	 DT_FINISH_DISP,
	 IF(NR_CLIENT=PEEK(NR_CLIENT),
		IF(DT_INT_DISP-PEEK(DT_FINISH_DISP),-2)'YES','NO'),'NO') AS FL_CLIENT_2,
		ROWNO(),
		Resident TMP_1
Order by NR_CLIENT, 
		 DT_INT_DISP ASC;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 13:32:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Creating-a-flag-for-the-last-two-months/m-p/1994475#M82322</guid>
      <dc:creator>lucasx15</dc:creator>
      <dc:date>2022-10-19T13:32:24Z</dc:date>
    </item>
  </channel>
</rss>

