<?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 Sum and group in load statement not working correctly in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-and-group-in-load-statement-not-working-correctly/m-p/1755717#M590764</link>
    <description>&lt;P&gt;Hi, I know there are a number of threads that have been raised regarding aggregation in QV scripting and have looked through a lot of them to try and solve my issue.&lt;/P&gt;&lt;P&gt;I have a fairly decent size data set stored in a QVD (7.5 million rows).&lt;/P&gt;&lt;P&gt;I have written a load script to extract some of this data and aggregate it together.&lt;/P&gt;&lt;P&gt;My source fields are PositionId, ForecastDate, ForecastHours&lt;/P&gt;&lt;P&gt;on my initial load into a temp table I have -&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;temp:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Load&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;PositionId, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;week(ForecastDate) as FWeek, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;ForecastHours&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;From&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;c:\datasource\data.qvd (qvd);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then have a final table -&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;final:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;PositionId,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;FWeek,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;sum(ForecastHours) as Fhours&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;resident temp&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Group by PositionId, FWeek;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Drop table temp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should be as simple as can be, if I use a simple inline table as my source (with about 15 rows) I get the correct data out. However when I use my real data source my &lt;STRONG&gt;FWeek&lt;/STRONG&gt; AND &lt;STRONG&gt;ForecastHours&lt;/STRONG&gt; are&amp;nbsp; both showing incorrect.&lt;/P&gt;&lt;P&gt;Hopefully someone has an idea of what I am doing wrong and how I can fix it.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Sun, 25 Oct 2020 17:06:11 GMT</pubDate>
    <dc:creator>chrismtb</dc:creator>
    <dc:date>2020-10-25T17:06:11Z</dc:date>
    <item>
      <title>Sum and group in load statement not working correctly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-and-group-in-load-statement-not-working-correctly/m-p/1755717#M590764</link>
      <description>&lt;P&gt;Hi, I know there are a number of threads that have been raised regarding aggregation in QV scripting and have looked through a lot of them to try and solve my issue.&lt;/P&gt;&lt;P&gt;I have a fairly decent size data set stored in a QVD (7.5 million rows).&lt;/P&gt;&lt;P&gt;I have written a load script to extract some of this data and aggregate it together.&lt;/P&gt;&lt;P&gt;My source fields are PositionId, ForecastDate, ForecastHours&lt;/P&gt;&lt;P&gt;on my initial load into a temp table I have -&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;temp:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Load&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;PositionId, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;week(ForecastDate) as FWeek, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;ForecastHours&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;From&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;c:\datasource\data.qvd (qvd);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then have a final table -&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;final:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;PositionId,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;FWeek,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;sum(ForecastHours) as Fhours&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;resident temp&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Group by PositionId, FWeek;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Drop table temp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should be as simple as can be, if I use a simple inline table as my source (with about 15 rows) I get the correct data out. However when I use my real data source my &lt;STRONG&gt;FWeek&lt;/STRONG&gt; AND &lt;STRONG&gt;ForecastHours&lt;/STRONG&gt; are&amp;nbsp; both showing incorrect.&lt;/P&gt;&lt;P&gt;Hopefully someone has an idea of what I am doing wrong and how I can fix it.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Sun, 25 Oct 2020 17:06:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-and-group-in-load-statement-not-working-correctly/m-p/1755717#M590764</guid>
      <dc:creator>chrismtb</dc:creator>
      <dc:date>2020-10-25T17:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Sum and group in load statement not working correctly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-and-group-in-load-statement-not-working-correctly/m-p/1755737#M590765</link>
      <description>check your date parts if they are actually dates / hours or just the stringsin your database</description>
      <pubDate>Mon, 26 Oct 2020 01:33:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-and-group-in-load-statement-not-working-correctly/m-p/1755737#M590765</guid>
      <dc:creator>PriyankaShivhare</dc:creator>
      <dc:date>2020-10-26T01:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sum and group in load statement not working correctly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-and-group-in-load-statement-not-working-correctly/m-p/1755738#M590766</link>
      <description>&lt;P&gt;As far as I am aware they are dates, if I just undertake the first load (temp table) the week(ForecastDate) function works correctly to return the relevant week number - would this work even with text value instead of date?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 01:55:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-and-group-in-load-statement-not-working-correctly/m-p/1755738#M590766</guid>
      <dc:creator>chrismtb</dc:creator>
      <dc:date>2020-10-26T01:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sum and group in load statement not working correctly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-and-group-in-load-statement-not-working-correctly/m-p/1755743#M590767</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/905"&gt;@chrismtb&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;For ex: Might be one&amp;nbsp;&lt;SPAN&gt;PositionId contains many years of data, and so same week numbers are falls under different years and aggregation doesn't satisfied with your requirement?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can you try with WeekName() function? And verify once.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;And also, you can share the sample data to check further..&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 04:15:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-and-group-in-load-statement-not-working-correctly/m-p/1755743#M590767</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2020-10-26T04:15:03Z</dc:date>
    </item>
  </channel>
</rss>

