<?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: How to get the ID in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-get-the-ID/m-p/807036#M284889</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Isaac, for getting the id from the first date of each Month and Year loaded you can use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dates_tmp:&lt;/P&gt;&lt;P&gt;LOAD If(Peek(Month)=Month and Peek(Year)=Year, Peek(Id), Id) as Id,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year;&lt;/P&gt;&lt;P&gt;LOAD Id, Date(Date) as Date, Month(Date) as Month, Year(Date) as Year;&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;Id,Date&lt;/P&gt;&lt;P&gt;1,2013-1-1&lt;/P&gt;&lt;P&gt;2,2013-1-2&lt;/P&gt;&lt;P&gt;3,2013-1-3&lt;/P&gt;&lt;P&gt;4,2014-3-1&lt;/P&gt;&lt;P&gt;5,2014-3-2&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dates:&lt;/P&gt;&lt;P&gt;NoConcatenate LOAD Id, Date Resident Dates_tmp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Dates_tmp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Feb 2015 15:40:54 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2015-02-02T15:40:54Z</dc:date>
    <item>
      <title>How to get the ID</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-the-ID/m-p/807035#M284888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one qvd which stores the following data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Id,Date&lt;/P&gt;&lt;P&gt;1,2013-1-1&lt;/P&gt;&lt;P&gt;2,2013-1-2&lt;/P&gt;&lt;P&gt;3,2013-1-3&lt;/P&gt;&lt;P&gt;4,2014-3-1&lt;/P&gt;&lt;P&gt;5,2014-3-1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want is: if the dates are within the same month and the same year, I want to apply the ID from the first day of the month to other date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result should be&lt;/P&gt;&lt;P&gt;Id,Date&lt;/P&gt;&lt;P&gt;1,2013-1-1&lt;/P&gt;&lt;P&gt;1,2013-1-2&lt;/P&gt;&lt;P&gt;1,2013-1-3&lt;/P&gt;&lt;P&gt;4,2014-3-1&lt;/P&gt;&lt;P&gt;4,2014-3-3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I achieve it?&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 15:20:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-the-ID/m-p/807035#M284888</guid>
      <dc:creator />
      <dc:date>2015-02-02T15:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the ID</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-the-ID/m-p/807036#M284889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Isaac, for getting the id from the first date of each Month and Year loaded you can use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dates_tmp:&lt;/P&gt;&lt;P&gt;LOAD If(Peek(Month)=Month and Peek(Year)=Year, Peek(Id), Id) as Id,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year;&lt;/P&gt;&lt;P&gt;LOAD Id, Date(Date) as Date, Month(Date) as Month, Year(Date) as Year;&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;Id,Date&lt;/P&gt;&lt;P&gt;1,2013-1-1&lt;/P&gt;&lt;P&gt;2,2013-1-2&lt;/P&gt;&lt;P&gt;3,2013-1-3&lt;/P&gt;&lt;P&gt;4,2014-3-1&lt;/P&gt;&lt;P&gt;5,2014-3-2&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dates:&lt;/P&gt;&lt;P&gt;NoConcatenate LOAD Id, Date Resident Dates_tmp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Dates_tmp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 15:40:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-the-ID/m-p/807036#M284889</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-02-02T15:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the ID</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-the-ID/m-p/807037#M284890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;BR /&gt;load * inline [&lt;BR /&gt;Id,Date&lt;BR /&gt;1,2013-1-1&lt;BR /&gt;2,2013-1-2&lt;BR /&gt;3,2013-1-3&lt;BR /&gt;4,2014-3-1&lt;BR /&gt;5,2014-3-1&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Result:&lt;BR /&gt;LOAD&lt;BR /&gt; Id,&lt;BR /&gt; Date,&lt;BR /&gt; &lt;STRONG&gt;if(month(Date)=month(Previous(Date)), peek('ID'),Id) as ID&lt;/STRONG&gt;&lt;BR /&gt;Resident data&lt;BR /&gt;&lt;STRONG&gt;ORDER BY Date;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 15:50:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-the-ID/m-p/807037#M284890</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-02T15:50:38Z</dc:date>
    </item>
  </channel>
</rss>

