<?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: Sum sales last hour in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-sales-last-hour/m-p/333037#M122733</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Matt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your transdate are not recognized as timestamp data type, adjust your standard format to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET TimestampFormat='M/D/YYYY h:mm';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or use timestamp#() function with an appropriate format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, you are using hour(transdate) for transhour, which is not a time format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could use hour(), but then you need to use hour() also in your search expression in the set modifier:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum({&amp;lt;transdate = {'&amp;gt;$(=date(today(0)))'}, transhour = {'&amp;gt;=$(&lt;STRONG&gt;=hour(&lt;/STRONG&gt;now(0)-(1/24)))'} &amp;gt;} transactioncount)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: and since your transdate is a timestamp, you could also just use:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum({&amp;lt;transdate = {"&amp;gt;=$(=(now(0)-(1/24)))"} &amp;gt;} transactioncount)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will also handle your day changes correctly (I believe the first version will not handle the first hour of a day correctly).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Jun 2012 10:38:36 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-06-01T10:38:36Z</dc:date>
    <item>
      <title>Sum sales last hour</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-sales-last-hour/m-p/333036#M122732</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;I'm struggling to use set analysis to sum sales over the last hour. I'm currently using the following expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;=&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;&lt;STRONG&gt;sum&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;&lt;STRONG&gt;transdate&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; = {&lt;/SPAN&gt;'&amp;gt;$(=date(today(0)))'&lt;SPAN class="s1"&gt;}, &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;&lt;STRONG&gt;transhour&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; = {&lt;/SPAN&gt;'&amp;gt;$(=time(now(0)-(1/24)))'&lt;SPAN class="s1"&gt;} &amp;gt;} &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;&lt;STRONG&gt;sales&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;Instead of summing sales last hour, it's summing today's sales. Once I get this to work, my goal is to create a sales alert to notify me if the last hours sales are below a certain threshold.&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;Any ideas where I'm going wrong? I've attached an example below. The example is in the text box on the left.&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;Best,&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2012 09:58:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-sales-last-hour/m-p/333036#M122732</guid>
      <dc:creator />
      <dc:date>2012-06-01T09:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sum sales last hour</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-sales-last-hour/m-p/333037#M122733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Matt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your transdate are not recognized as timestamp data type, adjust your standard format to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET TimestampFormat='M/D/YYYY h:mm';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or use timestamp#() function with an appropriate format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, you are using hour(transdate) for transhour, which is not a time format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could use hour(), but then you need to use hour() also in your search expression in the set modifier:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum({&amp;lt;transdate = {'&amp;gt;$(=date(today(0)))'}, transhour = {'&amp;gt;=$(&lt;STRONG&gt;=hour(&lt;/STRONG&gt;now(0)-(1/24)))'} &amp;gt;} transactioncount)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: and since your transdate is a timestamp, you could also just use:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum({&amp;lt;transdate = {"&amp;gt;=$(=(now(0)-(1/24)))"} &amp;gt;} transactioncount)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will also handle your day changes correctly (I believe the first version will not handle the first hour of a day correctly).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2012 10:38:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-sales-last-hour/m-p/333037#M122733</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-06-01T10:38:36Z</dc:date>
    </item>
  </channel>
</rss>

