<?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: How to sum 2 fields in an IF statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074784#M466365</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;=If(Environment='INTERNAL ', Avg(TOTAL &amp;lt;Product&amp;gt; {$&amp;lt; Enviornment={"INTERNAL"}&amp;gt;} ScoreA),&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp; If(&lt;SPAN style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;Environment&lt;/SPAN&gt;='EXTERNAL ', Avg(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;TOTAL &amp;lt;Product&amp;gt;&lt;/SPAN&gt;{$&amp;lt; &lt;SPAN style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;Environment&lt;/SPAN&gt;={'EXTERNAL'}&amp;gt;} &lt;SPAN style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;ScoreB&lt;/SPAN&gt;),&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp; RangeAvg(&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Avg(TOTAL &amp;lt;Product&amp;gt; {$&amp;lt; Enviornment={"INTERNAL"}&amp;gt;} ScoreA), &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Avg(&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;TOTAL &amp;lt;Product&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;{$&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: inherit; font-style: inherit; font-size: 13.3333px;"&gt;Environment&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;={'EXTERNAL'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: inherit; font-style: inherit; font-size: 13.3333px;"&gt;ScoreB&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Feb 2016 20:00:16 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-02-08T20:00:16Z</dc:date>
    <item>
      <title>How to sum 2 fields in an IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074779#M466360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="sum 2 fields.PNG" class="jive-image image-1" src="/legacyfs/online/113923_sum 2 fields.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Environ is Internal, I want the avg of Score A, If env is External, I want Avg of ScoreB, If its both, I want the avg of&lt;/P&gt;&lt;P&gt;scoreA and scoreB. how to write the IF statement as an expn in Straight Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(Environment='INTERNAL ',avg({$&amp;lt; Enviornment={"INTERNAL"}&amp;gt;} ScoreA),&lt;/P&gt;&lt;P&gt;if(&lt;SPAN style="font-size: 13.3333px;"&gt;Environment&lt;/SPAN&gt;='EXTERNAL ', avg({$&amp;lt; &lt;SPAN style="font-size: 13.3333px;"&gt;Environment&lt;/SPAN&gt;={'EXTERNAL'}&amp;gt;} &lt;SPAN style="font-size: 13.3333px;"&gt;ScoreB&lt;/SPAN&gt;),&lt;/P&gt;&lt;P&gt;avg(sum(.........))) I am stuck here, any help would be appreciated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 19:41:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074779#M466360</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-08T19:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum 2 fields in an IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074780#M466361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As per above example, what is the value of ScoreA average.. ScoreB average and what is ScoreAandB both average..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 19:45:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074780#M466361</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2016-02-08T19:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum 2 fields in an IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074781#M466362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finding it difficult to understand what is your expected output from the given sample?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 19:46:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074781#M466362</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-08T19:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum 2 fields in an IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074782#M466363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe using Rangesum()?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg( Rangesum(ScoreA, ScoreB))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 19:48:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074782#M466363</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-08T19:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum 2 fields in an IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074783#M466364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if it is Internal env, it shoud give me an avg for (30+40) which is 35. If it is external, it should avg (25+40) which is 32.5;&lt;/P&gt;&lt;P&gt;if it is both it should avg the averages just caculated, which means it sud avg (35+32.5) which is 33.75&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 19:58:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074783#M466364</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-08T19:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum 2 fields in an IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074784#M466365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;=If(Environment='INTERNAL ', Avg(TOTAL &amp;lt;Product&amp;gt; {$&amp;lt; Enviornment={"INTERNAL"}&amp;gt;} ScoreA),&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp; If(&lt;SPAN style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;Environment&lt;/SPAN&gt;='EXTERNAL ', Avg(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;TOTAL &amp;lt;Product&amp;gt;&lt;/SPAN&gt;{$&amp;lt; &lt;SPAN style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;Environment&lt;/SPAN&gt;={'EXTERNAL'}&amp;gt;} &lt;SPAN style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;ScoreB&lt;/SPAN&gt;),&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp; RangeAvg(&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Avg(TOTAL &amp;lt;Product&amp;gt; {$&amp;lt; Enviornment={"INTERNAL"}&amp;gt;} ScoreA), &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Avg(&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;TOTAL &amp;lt;Product&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;{$&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: inherit; font-style: inherit; font-size: 13.3333px;"&gt;Environment&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;={'EXTERNAL'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: inherit; font-style: inherit; font-size: 13.3333px;"&gt;ScoreB&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 20:00:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074784#M466365</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-08T20:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum 2 fields in an IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074785#M466366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=if(Environment='INTERNAL ',avg({$&amp;lt; Enviornment={"INTERNAL"}&amp;gt;} ScoreA),&lt;/P&gt;&lt;P&gt;if(&lt;SPAN style="font-size: 13.3333px;"&gt;Environment&lt;/SPAN&gt;='EXTERNAL ', avg({$&amp;lt; &lt;SPAN style="font-size: 13.3333px;"&gt;Environment&lt;/SPAN&gt;={'EXTERNAL'}&amp;gt;} &lt;SPAN style="font-size: 13.3333px;"&gt;ScoreB&lt;/SPAN&gt;),&lt;/P&gt;&lt;P&gt;RangeAvg( avg({$&amp;lt; Enviornment={"INTERNAL"}&amp;gt;} ScoreA),avg({$&amp;lt; &lt;SPAN style="font-size: 13.3333px;"&gt;Environment&lt;/SPAN&gt;={'EXTERNAL'}&amp;gt;} &lt;SPAN style="font-size: 13.3333px;"&gt;ScoreB&lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 20:00:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074785#M466366</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-08T20:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum 2 fields in an IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074786#M466367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much. It looks like your soln is correct. Let me plug in the changes in my qvw and I will get back to close this thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 20:19:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074786#M466367</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-08T20:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum 2 fields in an IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074787#M466368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;swuehl, solution will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just another way to implement, which i read in one of the blogs works better&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=pick(match(Environment,'INTERNAL','EXTERNAL','BOTH')&lt;/P&gt;&lt;P&gt;avg({$&amp;lt; Enviornment={"INTERNAL"}&amp;gt;} ScoreA),&lt;/P&gt;&lt;P&gt;avg({$&amp;lt; Environment={'EXTERNAL'}&amp;gt;} ScoreB),&lt;/P&gt;&lt;P&gt;RangeAvg( avg({$&amp;lt; Enviornment={"INTERNAL"}&amp;gt;} ScoreA),avg({$&amp;lt; Environment={'EXTERNAL'}&amp;gt;} ScoreB))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 21:10:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074787#M466368</guid>
      <dc:creator>harsh44_bhatia</dc:creator>
      <dc:date>2016-02-08T21:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum 2 fields in an IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074788#M466369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi QlikDash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sunny and Swuehl give you the correct answer. They copied and completed your expression, but your expression was not correct&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;IMG alt="2016-02-08 22_56_00-Qlik Community_204726.png" class="jive-image image-1" src="/legacyfs/online/113937_2016-02-08 22_56_00-Qlik Community_204726.png" style="height: 334px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;Their response with corrections:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=If(Environment='Internal', Avg(TOTAL &amp;lt;Product&amp;gt; {$&amp;lt; Environment={'Internal'}&amp;gt;} ScoreA),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; If(Environment='External', Avg(TOTAL &amp;lt;Product&amp;gt;{$&amp;lt; Environment={'External'}&amp;gt;} ScoreB),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg(Avg(TOTAL &amp;lt;Product&amp;gt; {$&amp;lt; Environment={'Internal'}&amp;gt;} ScoreA), Avg(TOTAL &amp;lt;Product&amp;gt;{$&amp;lt; Environment={'External'}&amp;gt;} ScoreB))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; ))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 22:12:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-in-an-IF-statement/m-p/1074788#M466369</guid>
      <dc:creator>sfatoux72</dc:creator>
      <dc:date>2016-02-08T22:12:23Z</dc:date>
    </item>
  </channel>
</rss>

