<?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 Find ids repeated within 24 hours in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Find-ids-repeated-within-24-hours/m-p/740426#M264456</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm struggling with a challenging task.&lt;/P&gt;&lt;P&gt;I have a simple table&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="176" style="border: 1px solid #000000; width: 412px; height: 132px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Timestamp&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;other attributes&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10.10.10 10:10:10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10.10.10 20:20:20&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;11.10.10 10:20:10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10.10.10 05:10:10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10.10.10 10:10:10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;12.10.10 10:10:10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to find all the code-timestamp pairs where the code repeats itself within 24 hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, eventually, my resulting table would look something like this:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="101" style="border: 1px solid #000000; width: 413px; height: 14px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Timestamp&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10.10.10 10:10:10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10.10.10 20:20:20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10.10.10 05:10:10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas or hints are welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Jan 2015 12:17:57 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-01-06T12:17:57Z</dc:date>
    <item>
      <title>Find ids repeated within 24 hours</title>
      <link>https://community.qlik.com/t5/QlikView/Find-ids-repeated-within-24-hours/m-p/740426#M264456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm struggling with a challenging task.&lt;/P&gt;&lt;P&gt;I have a simple table&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="176" style="border: 1px solid #000000; width: 412px; height: 132px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Timestamp&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;other attributes&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10.10.10 10:10:10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10.10.10 20:20:20&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;11.10.10 10:20:10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10.10.10 05:10:10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10.10.10 10:10:10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;12.10.10 10:10:10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to find all the code-timestamp pairs where the code repeats itself within 24 hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, eventually, my resulting table would look something like this:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="101" style="border: 1px solid #000000; width: 413px; height: 14px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Timestamp&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10.10.10 10:10:10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10.10.10 20:20:20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10.10.10 05:10:10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas or hints are welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 12:17:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-ids-repeated-within-24-hours/m-p/740426#M264456</guid>
      <dc:creator />
      <dc:date>2015-01-06T12:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Find ids repeated within 24 hours</title>
      <link>https://community.qlik.com/t5/QlikView/Find-ids-repeated-within-24-hours/m-p/740427#M264457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this or similar in your load script (not tested)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first sort on Code/Timestamp&lt;/P&gt;&lt;P&gt;load * where Diff_Hours &amp;lt;=24;&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;if( Previous(Code)=Code, TimeStamp-previous(TimeStamp)*24 ) as diff_hours,&lt;/P&gt;&lt;P&gt;if( Previous(Code)=Code, previous(Code)) as Prev_Code,&lt;/P&gt;&lt;P&gt;f( Previous(Code)=Code, previous(TimeStamp)) as Prev_TimeStamp&lt;/P&gt;&lt;P&gt;resident Table_Input;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hth&lt;/P&gt;&lt;P&gt;F.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 12:27:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-ids-repeated-within-24-hours/m-p/740427#M264457</guid>
      <dc:creator />
      <dc:date>2015-01-06T12:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find ids repeated within 24 hours</title>
      <link>https://community.qlik.com/t5/QlikView/Find-ids-repeated-within-24-hours/m-p/740428#M264458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all are you able to load your TIMESTAMP column in proper date time format . If yes share your sample qvw.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 12:32:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-ids-repeated-within-24-hours/m-p/740428#M264458</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-06T12:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Find ids repeated within 24 hours</title>
      <link>https://community.qlik.com/t5/QlikView/Find-ids-repeated-within-24-hours/m-p/740429#M264459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in SQL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select Code, Timestamp, count(*) from yourtable&lt;/P&gt;&lt;P&gt;group by Code, Timestamp&lt;/P&gt;&lt;P&gt;having count(*)&amp;gt;1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in qlikview (but not certain)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--This is a condition only for unique data to appear&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=if(aggr(NODISTINCT count(Code,TimeStamp),Code,TimeStamp)&amp;gt;1,1,0)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Another good thread: &lt;A href="https://community.qlik.com/thread/70101"&gt;Find duplicate records&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Regards&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;André Gomes&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 12:33:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-ids-repeated-within-24-hours/m-p/740429#M264459</guid>
      <dc:creator>agomes1971</dc:creator>
      <dc:date>2015-01-06T12:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Find ids repeated within 24 hours</title>
      <link>https://community.qlik.com/t5/QlikView/Find-ids-repeated-within-24-hours/m-p/740430#M264460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;Load *,Left(Timestamp,8) As Dt;&lt;/P&gt;&lt;P&gt;Load Code,Date#(Timestamp,'DD.MM.YY hh:mm:ss') As Timestamp Inline [&lt;/P&gt;&lt;P&gt;Code,Timestamp&lt;/P&gt;&lt;P&gt;1000,10.10.10 10:10:10&lt;/P&gt;&lt;P&gt;1000,10.10.10 20:20:20&lt;/P&gt;&lt;P&gt;1000,11.10.10 10:20:10&lt;/P&gt;&lt;P&gt;2000,10.10.10 05:10:10&lt;/P&gt;&lt;P&gt;2000,10.10.10 10:10:10&lt;/P&gt;&lt;P&gt;2000,12.10.10 10:10:10 ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Final:&lt;/P&gt;&lt;P&gt;Load * Where Cnt &amp;gt; 1;&lt;/P&gt;&lt;P&gt;LOAD Code,Dt,Sum(1) As Cnt Resident Temp Group By Code,Dt;&lt;/P&gt;&lt;P&gt;Inner Join(Final)&lt;/P&gt;&lt;P&gt;Load Code,Dt,Timestamp Resident Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Temp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 13:17:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-ids-repeated-within-24-hours/m-p/740430#M264460</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2015-01-06T13:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Find ids repeated within 24 hours</title>
      <link>https://community.qlik.com/t5/QlikView/Find-ids-repeated-within-24-hours/m-p/740431#M264461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I solved the problem in the load script.&lt;/DIV&gt;&lt;DIV&gt;I wonder if it was possible to solve it just on the expression level in the chart.&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Currently, what I do is:&lt;/DIV&gt;&lt;DIV&gt;1) load data from file&lt;/DIV&gt;&lt;DIV&gt;2) sort the data by "code, timestamp desc"&lt;/DIV&gt;&lt;DIV&gt;3) add fields&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;previous &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;code&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;next_code&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;previous&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;timestamp&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;next_recdate&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;4) end up with this data table:&lt;/DIV&gt;&lt;DIV&gt;&lt;IMG alt="tbl.png" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/74671_tbl.png" style="width: 620px; height: 383px;" /&gt;&lt;/DIV&gt;&lt;DIV&gt;5) create a chart with code and recdate as dimensions and this expression:&lt;/DIV&gt;&lt;DIV&gt;&lt;P&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: #800000; font-size: 8pt;"&gt;code&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;next_code&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;next_recdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;recdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;= 1,1,0) &lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 14:20:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-ids-repeated-within-24-hours/m-p/740431#M264461</guid>
      <dc:creator />
      <dc:date>2015-01-06T14:20:18Z</dc:date>
    </item>
  </channel>
</rss>

