<?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: Sum elements from 2 different fields depending on a condition in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-elements-from-2-different-fields-depending-on-a-condition/m-p/1289888#M403473</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Try This&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RangeMax(Price,Cost)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Mar 2017 01:53:08 GMT</pubDate>
    <dc:creator>aarkay29</dc:creator>
    <dc:date>2017-03-02T01:53:08Z</dc:date>
    <item>
      <title>Sum elements from 2 different fields depending on a condition</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-elements-from-2-different-fields-depending-on-a-condition/m-p/1289887#M403472</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 have this flat table in my app in Qliksense:&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="width: 192px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="color: #ffffff; text-align: center; padding: 2px; background-color: #6690bc;"&gt;Products&lt;/TH&gt;&lt;TH style="color: #ffffff; text-align: center; padding: 2px; background-color: #6690bc;"&gt;Price&lt;/TH&gt;&lt;TH style="color: #ffffff; text-align: center; padding: 2px; background-color: #6690bc;"&gt;Cost&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="color: #575757; text-align: left; font-family: arial, helvetica, sans-serif; vertical-align: baseline; background-color: rgba(0, 0, 0, 0);"&gt;A&lt;/TD&gt;&lt;TD align="right" style="color: #575757; text-align: left; font-family: arial, helvetica, sans-serif; vertical-align: baseline; background-color: rgba(0, 0, 0, 0);"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl87" style="color: #575757; text-align: left; font-family: arial, helvetica, sans-serif; vertical-align: baseline; background-color: rgba(0, 0, 0, 0);"&gt;&lt;STRONG&gt;6&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="color: #575757; text-align: left; font-family: arial, helvetica, sans-serif; vertical-align: baseline; background-color: rgba(0, 0, 0, 0);"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl87" style="color: #575757; text-align: left; font-family: arial, helvetica, sans-serif; vertical-align: baseline; background-color: rgba(0, 0, 0, 0);"&gt;&lt;STRONG&gt;7&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD align="right" style="color: #575757; text-align: left; font-family: arial, helvetica, sans-serif; vertical-align: baseline; background-color: rgba(0, 0, 0, 0);"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="color: #575757; text-align: left; font-family: arial, helvetica, sans-serif; vertical-align: baseline; background-color: rgba(0, 0, 0, 0);"&gt;C&lt;/TD&gt;&lt;TD align="right" class="xl87" style="color: #575757; text-align: left; font-family: arial, helvetica, sans-serif; vertical-align: baseline; background-color: rgba(0, 0, 0, 0);"&gt;&lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD align="right" style="color: #575757; text-align: left; font-family: arial, helvetica, sans-serif; vertical-align: baseline; background-color: rgba(0, 0, 0, 0);"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="color: #575757; text-align: left; font-family: arial, helvetica, sans-serif; vertical-align: baseline; background-color: rgba(0, 0, 0, 0);"&gt;D&lt;/TD&gt;&lt;TD align="right" style="color: #575757; text-align: left; font-family: arial, helvetica, sans-serif; vertical-align: baseline; background-color: rgba(0, 0, 0, 0);"&gt;8&lt;/TD&gt;&lt;TD align="right" class="xl87" style="color: #575757; text-align: left; font-family: arial, helvetica, sans-serif; vertical-align: baseline; background-color: rgba(0, 0, 0, 0);"&gt;&lt;STRONG&gt;10&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want is to have a single expression that can sum the larger of Cost or Price for all Products (essentially summing all the bold cell).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking of creating like a dummy table using aggr that produce something like this:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="124" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="font-size: 13.3333330154419px; height: 123px; width: 238px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="color: #ffffff; text-align: center; background-color: #6690bc;"&gt;Products&lt;/TH&gt;&lt;TH style="color: #ffffff; text-align: center; background-color: #6690bc;"&gt;max(Price,Cost)&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;A&lt;/TD&gt;&lt;TD align="right"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl87"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;C&lt;/TD&gt;&lt;TD align="right" class="xl87"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;D&lt;/TD&gt;&lt;TD align="right"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;and just simply sum the Max(Price,Cost) field. But I haven't really come up with anything yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if this is the right way or there is a better approach. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Mar 2017 00:05:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-elements-from-2-different-fields-depending-on-a-condition/m-p/1289887#M403472</guid>
      <dc:creator />
      <dc:date>2017-03-02T00:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sum elements from 2 different fields depending on a condition</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-elements-from-2-different-fields-depending-on-a-condition/m-p/1289888#M403473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Try This&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RangeMax(Price,Cost)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Mar 2017 01:53:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-elements-from-2-different-fields-depending-on-a-condition/m-p/1289888#M403473</guid>
      <dc:creator>aarkay29</dc:creator>
      <dc:date>2017-03-02T01:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sum elements from 2 different fields depending on a condition</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-elements-from-2-different-fields-depending-on-a-condition/m-p/1289889#M403474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! I managed to use that in my data load editor as:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;RangeMax(Price,Cost) as MaxPC&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I just need to sum the MaxPC field as usual within the app. It works perfectly this way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Mar 2017 18:57:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-elements-from-2-different-fields-depending-on-a-condition/m-p/1289889#M403474</guid>
      <dc:creator />
      <dc:date>2017-03-02T18:57:47Z</dc:date>
    </item>
  </channel>
</rss>

