<?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: Distinct Timestamp not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Distinct-Timestamp-not-working/m-p/571944#M213087</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't need a GROUP BY clause, but I just don't understand why the DISTINCT isn't working to only add a timestamp to the Calendar table once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;AllKPICalendar:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;Load &lt;STRONG style="text-decoration: underline;"&gt;DISTINCT&lt;/STRONG&gt; AllKPITimestamp,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DayName( AllKPITimestamp ) as AllKPIDay,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year( AllKPITimestamp ) as AllKPIYear,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthName( AllKPITimestamp ) as AllKPIMonth,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date( WeekStart( AllKPITimestamp ), 'M/D/YYYY' ) as AllKPIWeek&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RESIDENT AllKPIs;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Mar 2014 17:51:03 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-03-27T17:51:03Z</dc:date>
    <item>
      <title>Distinct Timestamp not working</title>
      <link>https://community.qlik.com/t5/QlikView/Distinct-Timestamp-not-working/m-p/571942#M213085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table of logs that contain a timestamp that I am rounding to the nearest hour:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;AllKPIs:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Load timestamp( ceil( STARTTIME, 1/24 ) ) as AllKPITimestamp,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; etc...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I fill in that table so it includes every hour from start to end:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;AllKPIMinMaxDate:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Load Min( AllKPITimestamp ) as AllKPIMinTime, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max( AllKPITimestamp ) as AllKPIMaxTime &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident AllKPIs;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Let vAllKPIMinDate = Peek('AllKPIMinTime',-1,'AllKPIMinMaxTime') - 1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Let vAllKPIMaxDate = Peek('AllKPIMaxTime',-1,'AllKPIMinMaxTime');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FOR vHourStep = MakeTime(0) to MakeTime(23) STEP MakeTime(1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;JOIN (AllKPIs)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD timestamp( $(vAllKPIMinDate) + IterNo() + $(vHourStep) ) as AllKPITimestamp&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AUTOGENERATE 1 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHILE $(vAllKPIMinDate) + IterNo() &amp;lt;= $(vAllKPIMaxDate);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NEXT vHourStep&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I create a calendar object to handle the unique dates:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;AllKPICalendar:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Load DISTINCT AllKPITimestamp,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DayName( AllKPITimestamp ) as AllKPIDay,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year( AllKPITimestamp ) as AllKPIYear,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthName( AllKPITimestamp ) as AllKPIMonth,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date( WeekStart( AllKPITimestamp ), 'M/D/YYYY' ) as AllKPIWeek&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RESIDENT AllKPIs;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //GROUP BY AllKPITimestamp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that when I chart by AllKPITimestamp it has duplicate timestamps (Day, Year, Month and Week are all distinct). I then tried to add the GROUP BY to my LOAD but that is giving me an error when I run Reload: "Aggregation expressions required by GROUP BY clause"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2014 16:52:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Distinct-Timestamp-not-working/m-p/571942#M213085</guid>
      <dc:creator />
      <dc:date>2014-03-27T16:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Timestamp not working</title>
      <link>https://community.qlik.com/t5/QlikView/Distinct-Timestamp-not-working/m-p/571943#M213086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you want a Group by clause? You're not using an aggregation function like sum, max, min or avg, so there's nothing that needs to be grouped so an aggregated value can be calculated for each group.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2014 17:27:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Distinct-Timestamp-not-working/m-p/571943#M213086</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-03-27T17:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Timestamp not working</title>
      <link>https://community.qlik.com/t5/QlikView/Distinct-Timestamp-not-working/m-p/571944#M213087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't need a GROUP BY clause, but I just don't understand why the DISTINCT isn't working to only add a timestamp to the Calendar table once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;AllKPICalendar:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;Load &lt;STRONG style="text-decoration: underline;"&gt;DISTINCT&lt;/STRONG&gt; AllKPITimestamp,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DayName( AllKPITimestamp ) as AllKPIDay,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year( AllKPITimestamp ) as AllKPIYear,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthName( AllKPITimestamp ) as AllKPIMonth,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date( WeekStart( AllKPITimestamp ), 'M/D/YYYY' ) as AllKPIWeek&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RESIDENT AllKPIs;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2014 17:51:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Distinct-Timestamp-not-working/m-p/571944#M213087</guid>
      <dc:creator />
      <dc:date>2014-03-27T17:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Timestamp not working</title>
      <link>https://community.qlik.com/t5/QlikView/Distinct-Timestamp-not-working/m-p/571945#M213088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Uhm... by rounding the log times up to the hour you create potentially 24 timestamps per day. And you wonder why you have more than one timestamp per day in your calendar table? Or am I misunderstanding you again?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2014 18:22:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Distinct-Timestamp-not-working/m-p/571945#M213088</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-03-27T18:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Timestamp not working</title>
      <link>https://community.qlik.com/t5/QlikView/Distinct-Timestamp-not-working/m-p/571946#M213089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am wondering why my hours are repeating.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="56065" alt="RepeatedHours.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/56065_RepeatedHours.jpg" style="width: 620px; height: 102px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2014 18:27:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Distinct-Timestamp-not-working/m-p/571946#M213089</guid>
      <dc:creator />
      <dc:date>2014-03-27T18:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Timestamp not working</title>
      <link>https://community.qlik.com/t5/QlikView/Distinct-Timestamp-not-working/m-p/571947#M213090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps the issue described in this blog post is causing it: &lt;A _jive_internal="true" class="font-color-normal" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/12/17/rounding-errors" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #3d3d3d;"&gt;Rounding Errors&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You could check that by adding that timestamp field to a listbox and format it as a number. If you see small differences in the digits far behind the decimal point you probably have your explanation. What you could try is using the floor function too. Something like timestamp(floor(ceil(STARTTIME, 1/24),0.000000001)).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2014 18:44:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Distinct-Timestamp-not-working/m-p/571947#M213090</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-03-27T18:44:23Z</dc:date>
    </item>
  </channel>
</rss>

