<?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: Problem with a SUM in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409065#M152101</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One easy way is to create a flag in the script, and then use set analysis. See attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Oct 2012 13:55:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-10-12T13:55:59Z</dc:date>
    <item>
      <title>Problem with a SUM</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409063#M152099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;I have to do a SUM of a field&amp;nbsp; but at the moment I'm in trouble.&lt;/P&gt;&lt;P&gt;I have two tables with these fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TabA:&lt;/P&gt;&lt;P&gt;Year, Import, account&lt;/P&gt;&lt;P&gt;2012, 100, G_1020&lt;/P&gt;&lt;P&gt;2012, 120, G_1021&lt;/P&gt;&lt;P&gt;2012, 155, 3089&lt;/P&gt;&lt;P&gt;2012, 890, G_7030&lt;/P&gt;&lt;P&gt;2012, 910, 4756&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TabB:&lt;/P&gt;&lt;P&gt;Text&lt;/P&gt;&lt;P&gt;Included&lt;/P&gt;&lt;P&gt;Excluded&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the user in the designer choose field Text = excluded I don't have to sum all the fields account that starts with "G_".&lt;/P&gt;&lt;P&gt;So My result has to be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;155 + 910 = 1065&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the moment my expression is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({ $&amp;lt;Year={ 2012 }&amp;gt; } Import)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can implement it to resolve my problem.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Giampiero&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 13:41:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409063#M152099</guid>
      <dc:creator />
      <dc:date>2012-10-12T13:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a SUM</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409064#M152100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background: white;"&gt;&lt;SPAN lang="EN" style="font-family: 'Arial','sans-serif'; color: #737373; font-size: 7pt;"&gt;Try this&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN lang="EN" style="font-family: 'Arial','sans-serif'; color: #737373; font-size: 7pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN lang="EN" style="font-family: 'Arial','sans-serif'; color: #737373; font-size: 7pt;"&gt;sum({ $&amp;lt;Year={ 2012 }&amp;gt; }if(not(account like ‘G*’ and Text=’Excluded’, Import))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN lang="EN" style="font-family: 'Arial','sans-serif'; color: #737373; font-size: 7pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN lang="EN" style="font-family: 'Arial','sans-serif'; color: #737373; font-size: 7pt;"&gt;Hope this helps&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN lang="EN" style="font-family: 'Arial','sans-serif'; color: #737373; font-size: 7pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN lang="EN" style="font-family: 'Arial','sans-serif'; color: #737373; font-size: 7pt;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN lang="EN" style="font-family: 'Arial','sans-serif'; color: #737373; font-size: 7pt;"&gt;Mhatim&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 13:54:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409064#M152100</guid>
      <dc:creator />
      <dc:date>2012-10-12T13:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a SUM</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409065#M152101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One easy way is to create a flag in the script, and then use set analysis. See attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 13:55:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409065#M152101</guid>
      <dc:creator />
      <dc:date>2012-10-12T13:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a SUM</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409066#M152102</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;I suggest you to add this information in your script :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TabA:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Year, Import, account,&lt;/P&gt;&lt;P&gt;if(left(account,2)='G_','Excluded','Included')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 13:57:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409066#M152102</guid>
      <dc:creator>christophebrault</dc:creator>
      <dc:date>2012-10-12T13:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a SUM</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409067#M152103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I found the solution in this thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="loading active_link" href="https://community.qlik.com/thread/56718" title="http://community.qlik.com/thread/56718"&gt;http://community.qlik.com/thread/56718&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my expression is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(GetFieldSelections(Text) = 'Excluded'&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;$&amp;lt;Year={ 2012 }, account= {"&amp;lt;&amp;gt;account like 'G*'"}&amp;gt;} import)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Giampiero&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 13:59:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409067#M152103</guid>
      <dc:creator />
      <dc:date>2012-10-12T13:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a SUM</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409068#M152104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;It's a good idea.&lt;/P&gt;&lt;P&gt;I found the solution in the designer, but it'a a very good idea.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Giampiero&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 14:01:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409068#M152104</guid>
      <dc:creator />
      <dc:date>2012-10-12T14:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a SUM</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409069#M152105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;But if (not(....)...... it doesn't seem to work.&lt;/P&gt;&lt;P&gt;thank you so much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 14:05:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409069#M152105</guid>
      <dc:creator />
      <dc:date>2012-10-12T14:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a SUM</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409070#M152106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;It's a good idea too.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 14:07:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409070#M152106</guid>
      <dc:creator />
      <dc:date>2012-10-12T14:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a SUM</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409071#M152107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not works, needed a bit of tweeking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the following as is: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Text&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='Included',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Import&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Text&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='Excluded',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Flag&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'Non-G Account'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Import&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Mhatim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 14:20:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409071#M152107</guid>
      <dc:creator />
      <dc:date>2012-10-12T14:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a SUM</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409072#M152108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;I'll try it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 14:29:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-SUM/m-p/409072#M152108</guid>
      <dc:creator />
      <dc:date>2012-10-12T14:29:52Z</dc:date>
    </item>
  </channel>
</rss>

