<?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: Filtering using Set Analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030762#M84898</link>
    <description>&lt;P&gt;Sounds a great idea to split the time field into single integers while loading the app. Can imagine that that helps.&lt;/P&gt;
&lt;P&gt;Data looks as follows:&lt;/P&gt;
&lt;P&gt;[TIME]:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;TIME.payload_Timestamp, TIME.payload_Time, TIME.payload_Type, TIME.payload_Msg&lt;BR /&gt;26.01.2023 08:59:49.667,&amp;nbsp;08:59:49.667, Info, BlaBla&lt;BR /&gt;26.01.2023 08:59:47.664,&amp;nbsp;08:59:47.664, Info, xxxx&lt;BR /&gt;26.01.2023 08:59:47.160,&amp;nbsp;08:59:47.160, Info, yyy&lt;BR /&gt;...&lt;BR /&gt;26.01.2023 07:43:26.672 ,&amp;nbsp;07:43:26.672, Info, zzzz&lt;BR /&gt;26.01.2023 07:37:06.391,&amp;nbsp;07:37:06.391, Info, vvvvv&lt;BR /&gt;26.01.2023 06:49:45.715,&amp;nbsp;06:49:45.715, Info, wwww&lt;BR /&gt;];&lt;BR /&gt;&amp;nbsp;I've set the variables to '06:00:00.000' and '08:00:00.000' respectively.&lt;/P&gt;
&lt;P&gt;The count as a measurement column in the sheet's table always returns 0.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2023 10:05:52 GMT</pubDate>
    <dc:creator>bean</dc:creator>
    <dc:date>2023-01-27T10:05:52Z</dc:date>
    <item>
      <title>Filtering using Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030732#M84895</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I've a master dimension expression formulated which returns those entries which are in a range of daily time (e.g. a log file).&lt;/P&gt;
&lt;P&gt;The expression looks as follows and does not really perform (as expected, but it works ;-)). The desired time range is given by two variables from a dropdown list. Null values are then excluded on the sheet's table.&lt;/P&gt;
&lt;P&gt;If(&lt;BR /&gt;Timestamp#(Timestamp([TIME.payload_Time], 'hh:mm'), 'hh:mm') &amp;gt;= Timestamp#('$(vStartTime)','hh:mm:ss.fff') &lt;BR /&gt;and &lt;BR /&gt;Timestamp#(Timestamp([TIME.payload_Time], 'hh:mm'), 'hh:mm') &amp;lt;= Timestamp#('$(vEndTime)', 'hh:mm:ss.fff'), &lt;BR /&gt;Timestamp([TIME.payload_Timestamp_formatted],'DD.MM.YYYY hh:mm:ss.fff'), &lt;BR /&gt;Null()&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;In order to enhance filtering performance I tried it with a Set Analysis statement on a separate field in the table of the sheet. Whatever I do, the set always has Null entries.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;count({&lt;BR /&gt;[TIME.payload_Time] = {"&amp;gt;= Timestamp#('$(vStartTime)','hh:mm:ss.fff')"},&lt;BR /&gt;[TIME.payload_Time] = {"&amp;lt;= Timestamp#('$(vEndTime)','hh:mm:ss.fff')"}&lt;BR /&gt;&amp;gt;} [TIME.payload_Time])&lt;/P&gt;
&lt;P&gt;What goes wrong? Is there a way to debug the the Set Analysis statement? Or is there a better way to filter my table in the sheet?&lt;/P&gt;
&lt;P&gt;In the expression editor I can see that the variables resolve correctly:&lt;/P&gt;
&lt;P&gt;count({&amp;lt;[TIME.payload_Time] = {"&amp;gt;= Timestamp#('00:00.00.000','hh:mm:ss.fff')"},&lt;BR /&gt;TIME.payload_Time] = {"&amp;lt;= Timestamp#('12:00:00.000','hh:mm:ss.fff')"}&lt;BR /&gt;&amp;gt;} [TIME.payload_Time])&lt;/P&gt;
&lt;P&gt;Thanks in advance for your contribution.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 09:20:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030732#M84895</guid>
      <dc:creator>bean</dc:creator>
      <dc:date>2023-01-27T09:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering using Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030742#M84897</link>
      <description>&lt;P&gt;In general, for performance reasons, it's better to split one time field into three fields: hour/minute/second&lt;/P&gt;
&lt;P&gt;About your null results, an expression can be debugged only with the data that is supposed to operate on. You should add an example.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 09:33:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030742#M84897</guid>
      <dc:creator>luciancotea</dc:creator>
      <dc:date>2023-01-27T09:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering using Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030762#M84898</link>
      <description>&lt;P&gt;Sounds a great idea to split the time field into single integers while loading the app. Can imagine that that helps.&lt;/P&gt;
&lt;P&gt;Data looks as follows:&lt;/P&gt;
&lt;P&gt;[TIME]:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;TIME.payload_Timestamp, TIME.payload_Time, TIME.payload_Type, TIME.payload_Msg&lt;BR /&gt;26.01.2023 08:59:49.667,&amp;nbsp;08:59:49.667, Info, BlaBla&lt;BR /&gt;26.01.2023 08:59:47.664,&amp;nbsp;08:59:47.664, Info, xxxx&lt;BR /&gt;26.01.2023 08:59:47.160,&amp;nbsp;08:59:47.160, Info, yyy&lt;BR /&gt;...&lt;BR /&gt;26.01.2023 07:43:26.672 ,&amp;nbsp;07:43:26.672, Info, zzzz&lt;BR /&gt;26.01.2023 07:37:06.391,&amp;nbsp;07:37:06.391, Info, vvvvv&lt;BR /&gt;26.01.2023 06:49:45.715,&amp;nbsp;06:49:45.715, Info, wwww&lt;BR /&gt;];&lt;BR /&gt;&amp;nbsp;I've set the variables to '06:00:00.000' and '08:00:00.000' respectively.&lt;/P&gt;
&lt;P&gt;The count as a measurement column in the sheet's table always returns 0.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 10:05:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030762#M84898</guid>
      <dc:creator>bean</dc:creator>
      <dc:date>2023-01-27T10:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering using Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030784#M84900</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;=count({&amp;lt; TIME.payload_Time = {"&amp;gt;=$(Time#(vStartTime,'hh:mm:ss.fff'))&amp;lt;=$(Time#(vEndTime,'hh:mm:ss.fff'))"}&amp;gt;} [TIME.payload_Time])&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 10:52:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030784#M84900</guid>
      <dc:creator>luciancotea</dc:creator>
      <dc:date>2023-01-27T10:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering using Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030830#M84905</link>
      <description>&lt;P&gt;Thanks so far ... but the count is still zero per line. I would expect a 1 when the row fulfills the filtercriteria.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Further I tried the following with the same result:&lt;/P&gt;
&lt;P&gt;=count({&amp;lt;[TIME.payload_Time] = {"&amp;gt;=Time#('$(vStartTime)','hh:mm:ss.fff')&amp;lt;=Time#('$(vEndTime)','hh:mm:ss.fff')"}&amp;gt;} [TIME.payload_Time])&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 12:52:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030830#M84905</guid>
      <dc:creator>bean</dc:creator>
      <dc:date>2023-01-27T12:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering using Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030831#M84906</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then this:&lt;/P&gt;
&lt;P&gt;=count({&amp;lt; TIME.payload_Time = {"&amp;gt;=$(&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt;Time#(vStartTime,'hh:mm:ss.fff'))&amp;lt;=$(&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt;Time#(vEndTime,'hh:mm:ss.fff'))"}&amp;gt;} [TIME.payload_Time])&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 13:01:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030831#M84906</guid>
      <dc:creator>luciancotea</dc:creator>
      <dc:date>2023-01-27T13:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering using Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030918#M84910</link>
      <description>&lt;P&gt;Thanks ... quite comprehensive synthax &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;Unfortunately still get the same result. The count still sees zero.&lt;/P&gt;
&lt;P&gt;However the expression editor resolves the where clause as follows, which looks o.k. to me:&lt;BR /&gt;=count({&amp;lt;[TIME.payload_Time] = {"&amp;gt;='06:00:00.000'&amp;lt;='09:00:00.000'"}&amp;gt;} [TIME.payload_Time])&lt;/P&gt;
&lt;P&gt;So I entered directly the following statement as expression to simplify the problem:&lt;BR /&gt;=count({&amp;lt;[TIME.payload_Time] = {"&amp;gt;='06:00:00.000'"}&amp;gt;} [TIME.payload_Time])&lt;BR /&gt;and updated the load script to ensure having a time in the second column.&lt;/P&gt;
&lt;P&gt;SET TimeFormat='hh:mm:ss[.fff]';&lt;BR /&gt;SET DateFormat='DD.MM.YYYY';&lt;BR /&gt;SET TimestampFormat='DD.MM.YYYY hh:mm:ss[.fff]';&lt;/P&gt;
&lt;P&gt;[TMP]:&lt;BR /&gt;LOAD * Inline [&lt;BR /&gt;payload_Timestamp, payload_Time, payload_Type, payload_Msg&lt;BR /&gt;26.01.2023 08:59:49.667,&amp;nbsp;08:59:49.667, Info, BlaBla&lt;BR /&gt;26.01.2023 08:59:47.664,&amp;nbsp;08:59:47.664, Info, xxxx&lt;BR /&gt;26.01.2023 08:59:47.160,&amp;nbsp;08:59:47.160, Info, yyy&lt;BR /&gt;26.01.2023 07:43:26.672,&amp;nbsp;07:43:26.672, Info, zzzz&lt;BR /&gt;26.01.2023 07:37:06.391,&amp;nbsp;07:37:06.391, Info, vvvvv&lt;BR /&gt;26.01.2023 06:49:45.715,&amp;nbsp;06:49:45.715, Info, wwww&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;[TIME]:&lt;BR /&gt;LOAD &lt;BR /&gt;Timestamp#(payload_Timestamp,'DD.MM.YYYY hh:mm:ss.fff') AS TIME.payload_Timestamp,&lt;BR /&gt;Time#(payload_Time,'hh:mm:ss.fff') AS TIME.payload_Time,&lt;BR /&gt;payload_Type AS TIME.payload_Type,&lt;BR /&gt;payload_Msg AS TIME.payload_Msg&lt;BR /&gt;RESIDENT TMP;&lt;/P&gt;
&lt;P&gt;To me it looks like the comparison operator has some trouble with Time(). There are &lt;A href="https://community.qlik.com/t5/New-to-Qlik-Sense/Timestamp-comparison-in-the-set-expression-by-getting-date-only/td-p/1670710" target="_self"&gt;similar solutions&lt;/A&gt; as you told me using Timestamp().&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 15:15:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-using-Set-Analysis/m-p/2030918#M84910</guid>
      <dc:creator>bean</dc:creator>
      <dc:date>2023-01-27T15:15:15Z</dc:date>
    </item>
  </channel>
</rss>

