<?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 in Script with Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-in-Script-with-Set-Analysis/m-p/258276#M496336</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; hei&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem you have is that the second varaible implent the first one as is writen &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this&amp;nbsp; script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; Data:&lt;BR /&gt; &lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt; &lt;BR /&gt; * &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Inline&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[&lt;BR /&gt; &lt;BR /&gt; Quantity, REGION, ID&lt;BR /&gt; 2 , A , 1&lt;BR /&gt; 2 , A , 2&lt;BR /&gt; 2 , A , 3&lt;BR /&gt; 2 , B , 4&lt;BR /&gt; 2 , B , 5&lt;BR /&gt; ]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vFilter&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt; &lt;/EM&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; ='=maxstring(REGION)';&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vSum1&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt; &lt;/EM&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; ='= Sum({$&amp;lt;REGION = {"' &amp;amp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;chr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(36) &amp;amp;'(vFilter)"}&amp;gt;} Quantity)';&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 27 Nov 2011 11:37:54 GMT</pubDate>
    <dc:creator>lironbaram</dc:creator>
    <dc:date>2011-11-27T11:37:54Z</dc:date>
    <item>
      <title>Sum in Script with Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-in-Script-with-Set-Analysis/m-p/258275#M496334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i don't understand why if i have this script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;* &lt;/P&gt;&lt;P&gt;Inline [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quantity, REGION, ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 , A , 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 , A , 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 , A , 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 , B , 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 , B , 5&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vFilter = '=maxstring(REGION)';&lt;/P&gt;&lt;P&gt;Let vSum1 = '=Sum({$&amp;lt;REGION = {"=$(vFilter)"}&amp;gt;} Quantity)';&lt;/P&gt;&lt;P&gt;Let vSum2 = '=Sum({$&amp;lt;REGION = {B}&amp;gt;} Quantity)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vSum1 = 0&lt;/P&gt;&lt;P&gt;but&lt;/P&gt;&lt;P&gt;vSum2 = 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any way to do the Sum using the result of variable vFilter?&lt;/P&gt;&lt;P&gt;p.d. I know it is possible using "Group By", but this time i need it using like explain&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Nov 2011 11:19:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-in-Script-with-Set-Analysis/m-p/258275#M496334</guid>
      <dc:creator />
      <dc:date>2011-11-27T11:19:11Z</dc:date>
    </item>
    <item>
      <title>Sum in Script with Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-in-Script-with-Set-Analysis/m-p/258276#M496336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; hei&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem you have is that the second varaible implent the first one as is writen &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this&amp;nbsp; script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; Data:&lt;BR /&gt; &lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt; &lt;BR /&gt; * &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Inline&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[&lt;BR /&gt; &lt;BR /&gt; Quantity, REGION, ID&lt;BR /&gt; 2 , A , 1&lt;BR /&gt; 2 , A , 2&lt;BR /&gt; 2 , A , 3&lt;BR /&gt; 2 , B , 4&lt;BR /&gt; 2 , B , 5&lt;BR /&gt; ]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vFilter&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt; &lt;/EM&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; ='=maxstring(REGION)';&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vSum1&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt; &lt;/EM&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; ='= Sum({$&amp;lt;REGION = {"' &amp;amp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;chr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(36) &amp;amp;'(vFilter)"}&amp;gt;} Quantity)';&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Nov 2011 11:37:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-in-Script-with-Set-Analysis/m-p/258276#M496336</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2011-11-27T11:37:54Z</dc:date>
    </item>
    <item>
      <title>Sum in Script with Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-in-Script-with-Set-Analysis/m-p/258277#M496338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, its correct but now i have other problem, i need to filter the Data table by the maxstring of REGION using a variable. I try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vRegion= '=maxstring(REGION)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data2:&lt;/P&gt;&lt;P&gt;Load Quantity as Q,&lt;/P&gt;&lt;P&gt;REGION as R,&lt;/P&gt;&lt;P&gt;ID as I&lt;/P&gt;&lt;P&gt;resident Data&lt;/P&gt;&lt;P&gt;where REGION = '=' &amp;amp; chr(36) &amp;amp;'(vRegion))'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;drop table Data;&lt;/P&gt;&lt;P&gt;rename fields Q to Quantity, R to REGION, I to ID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it doesn't work as expect, all the fields dissapear and the variables are not filled.&lt;/P&gt;&lt;P&gt;Do you know why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Nov 2011 12:03:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-in-Script-with-Set-Analysis/m-p/258277#M496338</guid>
      <dc:creator />
      <dc:date>2011-11-27T12:03:57Z</dc:date>
    </item>
    <item>
      <title>Sum in Script with Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-in-Script-with-Set-Analysis/m-p/258278#M496343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;now you want to filter the data on the fly in the load script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so you have to use group by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this script to put value in to the new varaible&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;maxregion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;load&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;maxstring&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;REGION&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MaxRegion&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Data;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vRegion&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt; &lt;/EM&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('MaxRegion',0,'maxregion');&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;drop&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Table&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; maxregion;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Nov 2011 12:41:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-in-Script-with-Set-Analysis/m-p/258278#M496343</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2011-11-27T12:41:10Z</dc:date>
    </item>
    <item>
      <title>Sum in Script with Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-in-Script-with-Set-Analysis/m-p/258279#M496344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect! Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Nov 2011 15:42:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-in-Script-with-Set-Analysis/m-p/258279#M496344</guid>
      <dc:creator />
      <dc:date>2011-11-27T15:42:20Z</dc:date>
    </item>
  </channel>
</rss>

