<?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 Set analysis with time diference in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-time-diference/m-p/438501#M163458</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've a set analysis expression where I pretend to sum the diference (HOUR_REALIZACAO-HOUR_MARCACAO), when&amp;nbsp; HOUR_REALIZACAO&amp;gt;&lt;SPAN style="font-size: 8pt;"&gt;HOUR_MARCACAO .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;In some records it works&amp;nbsp; and in others no.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I don't understand what is going wrong.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Any ideas&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Bruno&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13529966092589321" jivemacro_uid="_13529966092589321"&gt;&lt;P&gt;Sum&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Real&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Consultas&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;* $&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MonthID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;lt;=$(=Max(MonthID))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;lt;=$(=Max(Date))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(=Max(Year))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;HOUR_MARCACAO&amp;nbsp;&amp;nbsp; -= {&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(=null())&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;HOUR_REALIZACAO&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;gt;=$(Time(HOUR_MARCACAO))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;GROUP=&lt;BR /&gt;&amp;gt;} (HOUR_REALIZACAO-HOUR_MARCACAO)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Nov 2012 16:35:27 GMT</pubDate>
    <dc:creator>bruno_m_santos</dc:creator>
    <dc:date>2012-11-15T16:35:27Z</dc:date>
    <item>
      <title>Set analysis with time diference</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-time-diference/m-p/438501#M163458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've a set analysis expression where I pretend to sum the diference (HOUR_REALIZACAO-HOUR_MARCACAO), when&amp;nbsp; HOUR_REALIZACAO&amp;gt;&lt;SPAN style="font-size: 8pt;"&gt;HOUR_MARCACAO .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;In some records it works&amp;nbsp; and in others no.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I don't understand what is going wrong.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Any ideas&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Bruno&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13529966092589321" jivemacro_uid="_13529966092589321"&gt;&lt;P&gt;Sum&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Real&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Consultas&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;* $&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MonthID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;lt;=$(=Max(MonthID))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;lt;=$(=Max(Date))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(=Max(Year))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;HOUR_MARCACAO&amp;nbsp;&amp;nbsp; -= {&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(=null())&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;HOUR_REALIZACAO&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;gt;=$(Time(HOUR_MARCACAO))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;BR /&gt;GROUP=&lt;BR /&gt;&amp;gt;} (HOUR_REALIZACAO-HOUR_MARCACAO)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 16:35:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-time-diference/m-p/438501#M163458</guid>
      <dc:creator>bruno_m_santos</dc:creator>
      <dc:date>2012-11-15T16:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with time diference</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-time-diference/m-p/438502#M163459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bruno,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe your problem is &lt;STRONG&gt;HOUR_REALIZACAO = {"&amp;gt;=$(Time(HOUR_MARCACAO))"}&lt;/STRONG&gt;. An important principle of set analysis that is often misunderstood is how it treats chart dimensions. Namely, it ignores them when evaluating an expression. So, your expression &lt;STRONG&gt;Date = {"&amp;lt;=$(=Max(Date))"}&lt;/STRONG&gt; for example, will work properly since you are checking to make sure Date is less than the overall max Date, &lt;SPAN style="text-decoration: underline;"&gt;irrespective of the current chart dimension&lt;/SPAN&gt; (note that you can safely remove this expression altogether as it will always evaluate to TRUE unless Date is null). However, you can't write &lt;STRONG&gt;HOUR_REALIZACAO = {"&amp;gt;=$(Time(HOUR_MARCACAO))"}&lt;/STRONG&gt; since that tries to check the value within the current row and won't work. If you need to check this, the only way to do so would be either in the script by setting a flag, or through an IF statement in the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 20:00:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-time-diference/m-p/438502#M163459</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2012-11-15T20:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with time diference</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-time-diference/m-p/438503#M163460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vlad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are completely right. I understood my error.&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;P&gt;Bruno.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2012 10:04:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-time-diference/m-p/438503#M163460</guid>
      <dc:creator>bruno_m_santos</dc:creator>
      <dc:date>2012-11-16T10:04:41Z</dc:date>
    </item>
  </channel>
</rss>

