<?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: add new record to a dimension - aggr function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421719#M1164656</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;Maybe you can get a help from this sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Janzen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Oct 2012 03:30:54 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-10-17T03:30:54Z</dc:date>
    <item>
      <title>add new record to a dimension - aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421718#M1164655</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;Please see attached qvw for a working example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem: I have a field - Division - that has 5 different data values (div1 - div5). It is QV 101 to get a bar chart that would display today's and yesterday's sales broken by each division. However, I would like to add another bar - All - that would sum up all divisions and furhter display each divisions sales. I assume aggr would do it but I am a bit stuck. Getting this to work by defining a number of expressions is fine, however, not a desired approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help/suggestion is appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2012 02:42:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421718#M1164655</guid>
      <dc:creator />
      <dc:date>2012-10-17T02:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: add new record to a dimension - aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421719#M1164656</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;Maybe you can get a help from this sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Janzen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2012 03:30:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421719#M1164656</guid>
      <dc:creator />
      <dc:date>2012-10-17T03:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: add new record to a dimension - aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421720#M1164657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Janzen,&lt;/P&gt;&lt;P&gt;Had to change to helpful. Started playing further and it is not as straightforward as it seems. I forgot to mention i also have month selection. Please see update file. If I add All to the inline table, sum(total) does not work after month selection.&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2012 03:59:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421720#M1164657</guid>
      <dc:creator />
      <dc:date>2012-10-17T03:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: add new record to a dimension - aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421721#M1164658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of adding 'All' to the inline table, build a division group table, and use division group as the chart dimension.&amp;nbsp; Go back to using sum(today) and sum(yesterday) for the expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DivisionGroups:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;text(fieldvalue('Division',recno())) as DivisionGroup&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,text(fieldvalue('Division',recno())) as Division&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;AUTOGENERATE fieldvaluecount('Division')&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CONCATENATE (DivisionGroups)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;'All' as DivisionGroup&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,text(fieldvalue('Division',recno())) as Division&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;AUTOGENERATE fieldvaluecount('Division')&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2012 21:24:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421721#M1164658</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2012-10-17T21:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: add new record to a dimension - aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421722#M1164659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks John.&lt;/P&gt;&lt;P&gt;I solved the issue by:&lt;/P&gt;&lt;P&gt;1) creating a temp table where I loaded certain fields from e.g. table A&lt;/P&gt;&lt;P&gt;2) inner joined 'ALL' to the temp table&lt;/P&gt;&lt;P&gt;3) concatenated table A with values from the temp table&lt;/P&gt;&lt;P&gt;4) dropped the temp table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you outlined is new to me and I need to spend some time to figure it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 17:03:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421722#M1164659</guid>
      <dc:creator />
      <dc:date>2012-10-18T17:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: add new record to a dimension - aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421723#M1164660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the script is confusing, for now just worry about understanding the underlying idea, which is to create this new table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DivisionGroups:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DivisionGroup&amp;nbsp; Division&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;All&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Div1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;All&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Div2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;All&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Div3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;All&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Div4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;All&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Div5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Div1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Div1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Div2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Div2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Div3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Div3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Div4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Div4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Div5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Div5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use Division in a bar chart, it will behave normally.&amp;nbsp; If you instead use DivisionGroup, you'll get an additional bar that has the total.&amp;nbsp; A big advantage over what you ended up doing is that instead of each Division requiring two rows in the &lt;EM&gt;original &lt;/EM&gt;(large) table, each only requires two rows in this &lt;EM&gt;new &lt;/EM&gt;(tiny) table.&amp;nbsp; So it's far less data overall, and will load faster.&amp;nbsp; I would also expect it to perform better in charts, but I'm less certain about that, and only testing on a large data model would let you know for sure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script I wrote is a high-performance way to build this new table without resorting to hardcoding with an inline load.&amp;nbsp; The fieldvalue() function can grab all existing field values without referring to any underlying table, and so it doesn't have to loop through all the rows of your main data.&amp;nbsp; While this specific approach is secondary to the basic idea of the table above, I fairly routinely need to know all the values of a field in script, and this is a very fast way to handle that requirement, so it's something to get familiar with.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 17:25:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421723#M1164660</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2012-10-18T17:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: add new record to a dimension - aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421724#M1164661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your explanation! I played around with your suggestion in my original application and it is much more favourable than what I created. With your approach I am creating far less records in the original table and the end product (from the front end perspective) is the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2012 15:42:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/add-new-record-to-a-dimension-aggr-function/m-p/421724#M1164661</guid>
      <dc:creator />
      <dc:date>2012-10-19T15:42:11Z</dc:date>
    </item>
  </channel>
</rss>

