<?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 Filter table based on analysis/comparing data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144024#M505866</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's an alternative approach that may be a little simpler and more flexible. Someone was asking for something very similar to what you asked for, but where they could check the status as of any date, not just as of the current date. It might be a better approach for you as well as long as your data set isn't so large as to have performance problems doing a minor calculation in the chart. Something to consider, anyway.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 May 2009 23:57:16 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2009-05-20T23:57:16Z</dc:date>
    <item>
      <title>Filter table based on analysis/comparing data</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144018#M505860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello Everyone&lt;BR /&gt;I have an interesting example and no idea how to start off....&lt;/P&gt;&lt;P&gt;I would like to produce a table which shows only 'Doors' which are 'Open' and don't have a matching 'Closed' statement, so they can be closed manually if needed.&lt;/P&gt;&lt;P&gt;Every time a door is opened it records a TimeStamp, DoorName and State.&lt;BR /&gt;State is 'Open' or 'Closed'&lt;BR /&gt;DoorName is a fixed text string per door.&lt;/P&gt;&lt;P&gt;I need to analyse the records, and match up all the 'Open' and 'Closed' states for a door, and only show doors which are in the Open state.&lt;/P&gt;&lt;P&gt;If possible i'd also like to have a calculated time field to show how long the door has been open.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Any suggestions and advice would be much appreciated!&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Peter.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 21:16:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144018#M505860</guid>
      <dc:creator>peter_turner</dc:creator>
      <dc:date>2009-05-13T21:16:39Z</dc:date>
    </item>
    <item>
      <title>Filter table based on analysis/comparing data</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144019#M505861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My initial thoughts are...&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filter the data to most recent at the top&lt;/P&gt;&lt;P&gt;Start with the first DoorName (1 of 10 possible names for example)&lt;/P&gt;&lt;P&gt;look at the first 'State' value for that Door.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If its 'Closed'&lt;BR /&gt;Then that Door is OK, ignore and move onto the next Door.&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;If its 'Open' then flag it somehow.&lt;BR /&gt;Compare its timestamp with the current now(0) time, and produce a time value.&lt;/P&gt;&lt;P style="margin-bottom:0cm;"&gt;Move onto the next Door and repeat&lt;/P&gt;&lt;P style="margin-bottom:0cm;"&gt;&lt;/P&gt;&lt;P style="margin-bottom:0cm;"&gt;This can lead onto producing average time between 'Open' and 'Closed' messages, and maybe even an alert if this calculated time is over a set threshold.&lt;/P&gt;&lt;P style="margin-bottom:0cm;"&gt;&lt;/P&gt;&lt;P style="margin-bottom:0cm;"&gt;Thanks,&lt;BR /&gt;Peter.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 21:25:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144019#M505861</guid>
      <dc:creator>peter_turner</dc:creator>
      <dc:date>2009-05-13T21:25:51Z</dc:date>
    </item>
    <item>
      <title>Filter table based on analysis/comparing data</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144020#M505862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's one approach that I think would work. It could probably be done somewhat simpler than this, though.&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;DoorLog:&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;LOAD DoorName,TimeStamp,State&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;&amp;lt;your source&amp;gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;DoorState:&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;LOAD&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;DoorName&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,max(TimeStamp) as TimeStamp&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;RESIDENT DoorLog&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;GROUP BY DoorName&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;LEFT JOIN LOAD DoorName,TimeStamp,State&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;RESIDENT DoorLog&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;DROP TABLE DoorLog&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;OpenDoor:&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;LOAD&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;DoorName&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,TimeStamp&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,now()-TimeStamp as Duration&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;RESIDENT DoorState&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;WHERE State = 'Open'&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;DROP TABLE DoorState&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2009 00:48:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144020#M505862</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-05-14T00:48:48Z</dc:date>
    </item>
    <item>
      <title>Filter table based on analysis/comparing data</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144021#M505863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello John,&lt;BR /&gt;&lt;BR /&gt;Thanks for the script, thats exactly what i was looking for as the first part of my example.&lt;BR /&gt;I'm still learning but think i understand what is happening...&lt;BR /&gt;DoorLog:&lt;BR /&gt;LOAD DoorName,TimeStamp,State&lt;BR /&gt;&amp;lt;your source&amp;gt;&lt;BR /&gt;;&lt;BR /&gt;/*&lt;BR /&gt;Normal load of data&lt;BR /&gt;*/&lt;BR /&gt;&lt;BR /&gt;DoorState:&lt;BR /&gt;LOAD&lt;BR /&gt; DoorName&lt;BR /&gt;,max(TimeStamp) as TimeStamp&lt;BR /&gt;RESIDENT DoorLog&lt;BR /&gt;GROUP BY DoorName&lt;BR /&gt;;&lt;BR /&gt;/*&lt;BR /&gt;Group by DoorName and return the highest TimeStamp value for that grouping&lt;BR /&gt;*/&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;LEFT JOIN LOAD DoorName,TimeStamp,State&lt;BR /&gt;RESIDENT DoorLog&lt;BR /&gt;;&lt;BR /&gt;DROP TABLE DoorLog&lt;BR /&gt;;&lt;BR /&gt;/*&lt;BR /&gt;Add the 3 fields to the DoorState table, replace the old TimeStamp with the calulated value&lt;BR /&gt;*/&lt;BR /&gt;&lt;BR /&gt;OpenDoor:&lt;BR /&gt;LOAD&lt;BR /&gt; DoorName&lt;BR /&gt;,TimeStamp&lt;BR /&gt;,now()-TimeStamp as Duration&lt;BR /&gt;RESIDENT DoorState&lt;BR /&gt;WHERE State = 'Open'&lt;BR /&gt;;&lt;BR /&gt;DROP TABLE DoorState&lt;BR /&gt;;&lt;BR /&gt;/*&lt;BR /&gt;Create a new table with all the data for viewing on screen&lt;BR /&gt;Only where the 'door' is open&lt;BR /&gt;*/&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Developing this example forward, i need to try and create a table that looks like this:&lt;BR /&gt;&lt;BR /&gt;DoorName StartTimeStamp Duration State&lt;BR /&gt;Front 14/05/2009 01:01:03 02:00:00 Open&lt;BR /&gt;Back 14/05/2009 01:01:02 00:02:00 Closed&lt;BR /&gt;Side 14/05/2009 01:01:01 00:03:00 Closed&lt;BR /&gt;Front 13/05/2009 23:50:03 00:01:00 Closed&lt;BR /&gt;(and all the other times a door has been 'open' 'closed'&lt;BR /&gt;&lt;BR /&gt;I think this Would involve...&lt;BR /&gt;grouping the DoorName&lt;BR /&gt;calculating the time between a 'Open' event and the next 'Closed' event&lt;BR /&gt;If there was no 'Closed' event, then just show the time since the message (so someone can go fix the door)&lt;BR /&gt;&lt;BR /&gt;My source data would be in a table looking like this:&lt;BR /&gt;DoorName TimeStamp State&lt;BR /&gt;Back 14/05/2009 02:02:02 Closed&lt;BR /&gt;Side 14/05/2009 02:02:01 Closed&lt;BR /&gt;Front 14/05/2009 01:01:03 Open&lt;BR /&gt;Back 14/05/2009 01:01:02 Open&lt;BR /&gt;Side 14/05/2009 01:01:01 Open&lt;BR /&gt;&lt;BR /&gt;Any insight/ideas would be greatly appricated.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Peter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2009 18:15:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144021#M505863</guid>
      <dc:creator>peter_turner</dc:creator>
      <dc:date>2009-05-14T18:15:38Z</dc:date>
    </item>
    <item>
      <title>Filter table based on analysis/comparing data</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144022#M505864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like the attached?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2009 04:32:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144022#M505864</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-05-15T04:32:43Z</dc:date>
    </item>
    <item>
      <title>Filter table based on analysis/comparing data</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144023#M505865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Thanks for the example file, thats the sort of thing i was looking for!&lt;/P&gt;&lt;P&gt;It's helped alot with my project, I just need to add afew more conditions on the If( statement to match 'doors', and thats sorted.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Peter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 23:13:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144023#M505865</guid>
      <dc:creator>peter_turner</dc:creator>
      <dc:date>2009-05-20T23:13:36Z</dc:date>
    </item>
    <item>
      <title>Filter table based on analysis/comparing data</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144024#M505866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's an alternative approach that may be a little simpler and more flexible. Someone was asking for something very similar to what you asked for, but where they could check the status as of any date, not just as of the current date. It might be a better approach for you as well as long as your data set isn't so large as to have performance problems doing a minor calculation in the chart. Something to consider, anyway.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 23:57:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-table-based-on-analysis-comparing-data/m-p/144024#M505866</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-05-20T23:57:16Z</dc:date>
    </item>
  </channel>
</rss>

