<?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 Problem counting the last modified data only in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-counting-the-last-modified-data-only/m-p/162043#M35691</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to count number of HouseNumber's online at a certain date. However due to the fact that my data changes over time for a specific HouseNumber I only want to look at the last modified value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;Content_tmp:&lt;BR /&gt;LOAD ContentAccountId as EntriqId,&lt;BR /&gt;ItemId,&lt;BR /&gt;if(right(ItemId,4)&amp;lt;&amp;gt;'_trl', left(ItemId, 6)) as HouseNumber,&lt;BR /&gt;//if(right(ItemId,4) = '_trl', 'True', 'False') as Trailer,&lt;BR /&gt;MediaType,&lt;BR /&gt;Affiliate,&lt;BR /&gt;if(Country='SE', 'Sweden', if(Country='NO', 'Norway', if(Country='FI', 'Finland', if(Country='DK', 'Denmark', 'Unknown')))) as Country,&lt;BR /&gt;ReleaseDate,&lt;BR /&gt;ReleaseEnd,&lt;BR /&gt;date(Date#(Left(ModifyDate, 10), 'YYYY-MM-DD')) as ModifyDate&lt;BR /&gt;FROM $(DataPath)ReleaseDateIncremental_$(Date_test)*.csv (ansi, txt, delimiter is ',', embedded labels, msq);&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;And my chart property expression look something like this for Sweden,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Count(Distinct If(Country='Sweden' AND OrderDate&amp;gt;=ReleaseDateStart AND OrderDate&amp;lt;=ReleaseDateEnd, HouseNumber))&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;OrderDate is the date I choose and want to know the amount of HouseNumbers.&lt;/P&gt;&lt;P&gt;I'm running Qlikview 8.5 at the moment.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Mar 2011 15:29:36 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-15T15:29:36Z</dc:date>
    <item>
      <title>Problem counting the last modified data only</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-counting-the-last-modified-data-only/m-p/162043#M35691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to count number of HouseNumber's online at a certain date. However due to the fact that my data changes over time for a specific HouseNumber I only want to look at the last modified value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;Content_tmp:&lt;BR /&gt;LOAD ContentAccountId as EntriqId,&lt;BR /&gt;ItemId,&lt;BR /&gt;if(right(ItemId,4)&amp;lt;&amp;gt;'_trl', left(ItemId, 6)) as HouseNumber,&lt;BR /&gt;//if(right(ItemId,4) = '_trl', 'True', 'False') as Trailer,&lt;BR /&gt;MediaType,&lt;BR /&gt;Affiliate,&lt;BR /&gt;if(Country='SE', 'Sweden', if(Country='NO', 'Norway', if(Country='FI', 'Finland', if(Country='DK', 'Denmark', 'Unknown')))) as Country,&lt;BR /&gt;ReleaseDate,&lt;BR /&gt;ReleaseEnd,&lt;BR /&gt;date(Date#(Left(ModifyDate, 10), 'YYYY-MM-DD')) as ModifyDate&lt;BR /&gt;FROM $(DataPath)ReleaseDateIncremental_$(Date_test)*.csv (ansi, txt, delimiter is ',', embedded labels, msq);&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;And my chart property expression look something like this for Sweden,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Count(Distinct If(Country='Sweden' AND OrderDate&amp;gt;=ReleaseDateStart AND OrderDate&amp;lt;=ReleaseDateEnd, HouseNumber))&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;OrderDate is the date I choose and want to know the amount of HouseNumbers.&lt;/P&gt;&lt;P&gt;I'm running Qlikview 8.5 at the moment.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2011 15:29:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-counting-the-last-modified-data-only/m-p/162043#M35691</guid>
      <dc:creator />
      <dc:date>2011-03-15T15:29:36Z</dc:date>
    </item>
    <item>
      <title>Problem counting the last modified data only</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-counting-the-last-modified-data-only/m-p/162044#M35692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;Hopefully this will provide you with a starting point:&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;I'm doing something similar with Insurance policies that change over time but this should work with any dimension value that has multiple date / time-stamped entries against it.&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;When you load you're data (or via a resident load if from a qvd) order it in the following way along with the shown preceding load statement to derive a 'CurrentRecordInd' (or 'Last_Modified_Record_Ind' in your case):&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;Data:&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;Load *,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;If(previous(HouseNumber)=HouseNumber,0,1) as Last_Modified_Record_Ind;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;Load *;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;From XYZ.xls Order By HouseNumber Asc, Date Desc;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;(Script isn't checked)&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;Essentially what we're doing is grouping all the entries that relate to a particular house together and then sorting them in descending order to place the most recent at the top within the house number grouping. Using the 'Previous' statement allows us to check if the line we're looking at is a new house number - if it is it must be the most recent as they're sorted in descending order. Conversely if the previous House Number is the same as the current record then it must be a more recent entry and therefore should return '0'.&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;It's a simple principal that I've probably explained terribly but the key things are the sorting of the data and the 'previous' function in a preceding load.&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;Hope that helps,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;Matt - Visual Analytics Ltd&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2011 16:36:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-counting-the-last-modified-data-only/m-p/162044#M35692</guid>
      <dc:creator>matt_crowther</dc:creator>
      <dc:date>2011-03-15T16:36:32Z</dc:date>
    </item>
    <item>
      <title>Problem counting the last modified data only</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-counting-the-last-modified-data-only/m-p/162045#M35693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, that helped me half way.&lt;/P&gt;&lt;P&gt;How do I do it in the graph expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Mar 2011 08:57:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-counting-the-last-modified-data-only/m-p/162045#M35693</guid>
      <dc:creator />
      <dc:date>2011-03-16T08:57:15Z</dc:date>
    </item>
    <item>
      <title>Problem counting the last modified data only</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-counting-the-last-modified-data-only/m-p/162046#M35694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not fully understanding the data I'd be looking for something like this:&lt;/P&gt;&lt;P&gt;Count(Distinct If(Country='Sweden' AND OrderDate&amp;gt;=ReleaseDateStart AND OrderDate&amp;lt;=ReleaseDateEnd AND Last_Modified_Record_Ind=1, HouseNumber))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Mar 2011 09:50:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-counting-the-last-modified-data-only/m-p/162046#M35694</guid>
      <dc:creator>matt_crowther</dc:creator>
      <dc:date>2011-03-16T09:50:26Z</dc:date>
    </item>
  </channel>
</rss>

