<?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: VB QlikView - Sum Function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029171#M639869</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nope, it hasn't - it's a complete different layer. But again what's the aim? I have the feeling that you runs in a wrong direction ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Feb 2016 10:47:21 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2016-02-26T10:47:21Z</dc:date>
    <item>
      <title>VB QlikView - Sum Function</title>
      <link>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029167#M639865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use VB in the QlikView. I have variable with field name, so as part of the code I want to sum all the values in this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should be so simple (at least it is in VBA Excel), but I spent an hour on it and can't make it works... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Andrzej&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 15:01:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029167#M639865</guid>
      <dc:creator />
      <dc:date>2016-02-25T15:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: VB QlikView - Sum Function</title>
      <link>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029168#M639866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's your aim? I would rather not try to aggregate qlikview fields with vbs macros.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 16:32:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029168#M639866</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-02-25T16:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: VB QlikView - Sum Function</title>
      <link>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029169#M639867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will be the part of the bigger script (I hope). As QlikView is a data visualization tool with the good support for the analyses, I would expect that VB would have the simple sum function...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 08:20:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029169#M639867</guid>
      <dc:creator />
      <dc:date>2016-02-26T08:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: VB QlikView - Sum Function</title>
      <link>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029170#M639868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I cracked it. Basically I couldn't find sum function, so I had to simulate it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;dim dSum&lt;/P&gt;&lt;P&gt;dim vYear&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set vMinYear=ActiveDocument.Variables("vMinYear")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vYear=vMinYear.GetContent.String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set val=ActiveDocument.Fields(vYear).GetPossibleValues(1000)&lt;/P&gt;&lt;P&gt;&amp;nbsp; for i=0 to val.Count-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dSum = dSum + cDbl(val.Item(i).Text)&lt;/P&gt;&lt;P&gt;&amp;nbsp; next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;msgbox(dSum)&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 08:42:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029170#M639868</guid>
      <dc:creator />
      <dc:date>2016-02-26T08:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: VB QlikView - Sum Function</title>
      <link>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029171#M639869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nope, it hasn't - it's a complete different layer. But again what's the aim? I have the feeling that you runs in a wrong direction ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 10:47:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029171#M639869</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-02-26T10:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: VB QlikView - Sum Function</title>
      <link>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029172#M639870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Marcus Sommer &amp;amp;lt;span class=&amp;amp;quot;icon-status-icon icon-mvp&amp;amp;quot; title=&amp;amp;quot;Mvp&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/span&amp;amp;gt; wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Nope, it hasn't - it's a complete different layer. But again what's the aim? I have the feeling that you runs in a wrong direction ...&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;

&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok... I have columns that named by years (2014, 2015, 2016 etc). I have slider where I can select years I want to have report for. So I need to sum all columns that are selected in slider. I found solution how to make this sum, but by some reason the ".GetPossibleValues(1000)" doesn't come up with the same number of possible items as the "GetPossibleValues" Function in the report. Trying to figure out what is wrong...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Feb 2016 11:15:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029172#M639870</guid>
      <dc:creator />
      <dc:date>2016-02-29T11:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: VB QlikView - Sum Function</title>
      <link>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029173#M639871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This s highly inefficient - QlikView will do that with a single expression several orders of magnitude faster...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Feb 2016 21:20:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029173#M639871</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2016-02-29T21:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: VB QlikView - Sum Function</title>
      <link>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029174#M639872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub Test&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MsgBox(ActiveDocument.Evaluate("Sum($(vField))"))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Feb 2016 22:55:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029174#M639872</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-29T22:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: VB QlikView - Sum Function</title>
      <link>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029175#M639873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;don't go in that direction.&lt;/P&gt;&lt;P&gt;Forget about VB at all in this case.&lt;/P&gt;&lt;P&gt;Instead post a small sample application and your expected result in case of some selections.&lt;/P&gt;&lt;P&gt;Maybe you can use a crosstable load to convert your multiple year columns into one year field and use this one to perform your selections.&lt;/P&gt;&lt;P&gt;There surely are many possibilities to meet your requirements, none of them needing VB scripts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&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;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Feb 2016 23:21:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029175#M639873</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2016-02-29T23:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: VB QlikView - Sum Function</title>
      <link>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029176#M639874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Marco. I would use a crosstable load or some other approach to make a Year field. Then select the years like any other field, and sum like any other sum. Where at all practical, I prefer my complexity be in my load script, not in the front end, and definitely not in macros.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Feb 2016 23:51:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029176#M639874</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-02-29T23:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: VB QlikView - Sum Function</title>
      <link>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029177#M639875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, for all your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the Sample file. In real Data source I have about 100 columns, should I create 2 table to keep those years separately for Xtable? and most important hot to properly create it? I saw few post about this, but still don't completely understand it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Andrzej&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 08:23:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029177#M639875</guid>
      <dc:creator />
      <dc:date>2016-03-01T08:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: VB QlikView - Sum Function</title>
      <link>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029178#M639876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all one more time. CrossTable does the work. Need to redesign some of the field I had in the Report it self, but this is the simple issue now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 11:32:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-QlikView-Sum-Function/m-p/1029178#M639876</guid>
      <dc:creator />
      <dc:date>2016-03-01T11:32:31Z</dc:date>
    </item>
  </channel>
</rss>

