<?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 expressions with different dimension field but having same dimension value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-expressions-with-different-dimension-field-but-having-same/m-p/437467#M486283</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having this exact problem, and am about to go the Data Island route. Does anyone know of a better way to solve this using Set Analysis?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Feb 2014 20:05:37 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-02-06T20:05:37Z</dc:date>
    <item>
      <title>Sum expressions with different dimension field but having same dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-expressions-with-different-dimension-field-but-having-same/m-p/437466#M486282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with resolving the following situation. I have multiple geographic area's that are copied in multiple fields. Let's simplify the problem to two fields:&lt;/P&gt;&lt;P&gt;COMPONENT_RESPONSIBLE&lt;/P&gt;&lt;P&gt;DESIGN_RESPONSIBLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the content of both thoose fields is the same = [Area1, Area2, Area3, ..]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say I have 2 expressions (in reality they are little bit more complex):&lt;/P&gt;&lt;P&gt;sum(DEFECTS_COMPONENTS)&lt;/P&gt;&lt;P&gt;sum(DEFECTS_DESIGN)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can perfectely make a chart that gives me an overview for 1 expression. But I cannot combine both expressions just like that in one chart because the dimensions differ that I have to use for both expressions. What I want to achieve is a chart that gives me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Dimension&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Defects&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Area 1&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;sum({&amp;lt;COMPONENT_RESPONSIBLE={'Area 1'}&amp;gt;}DEFECTS_COMPONENTS) &lt;/P&gt;&lt;P&gt;+ sum({&amp;lt;DESIGN_RESPONSIBLE={'Area 1'}&amp;gt;}DEFECTS_DESIGN)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Area 2&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;sum({&amp;lt;COMPONENT_RESPONSIBLE={'Area 2'}&amp;gt;}DEFECTS_COMPONENTS) &lt;/P&gt;&lt;P&gt;+ sum({&amp;lt;DESIGN_RESPONSIBLE={'Area 2'}&amp;gt;}DEFECTS_DESIGN)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Area 3&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;sum({&amp;lt;COMPONENT_RESPONSIBLE={'Area 3'}&amp;gt;}DEFECTS_COMPONENTS) &lt;/P&gt;&lt;P&gt;+ sum({&amp;lt;DESIGN_RESPONSIBLE={'Area 3'}&amp;gt;}DEFECTS_DESIGN)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could do this with a data island as dimension and then using a nested if expression and hard coded 'Area x' values in the set analysisses but I've got alot of those area's to cover &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; (not to mention expressions...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone has an idea how to do this better? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Mar 2013 14:48:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-expressions-with-different-dimension-field-but-having-same/m-p/437466#M486282</guid>
      <dc:creator />
      <dc:date>2013-03-13T14:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sum expressions with different dimension field but having same dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-expressions-with-different-dimension-field-but-having-same/m-p/437467#M486283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having this exact problem, and am about to go the Data Island route. Does anyone know of a better way to solve this using Set Analysis?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 20:05:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-expressions-with-different-dimension-field-but-having-same/m-p/437467#M486283</guid>
      <dc:creator />
      <dc:date>2014-02-06T20:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sum expressions with different dimension field but having same dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-expressions-with-different-dimension-field-but-having-same/m-p/437468#M486284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi both&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a perfect world you would change the database structure so that the area is somehow in a shared field, eg in a table with the fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Responsible ("component or design")&lt;/P&gt;&lt;P&gt;Area(area1/2/3/....x)&lt;/P&gt;&lt;P&gt;Defects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm guessing this is already not possible, so here is my suggestion, without changing the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use valuelist() or valueloop() to generate dimension values in a chart, which you can then reference in the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So your table would look something like this:&lt;/P&gt;&lt;P&gt;Dimension: valueloop(1,10,1)&amp;nbsp; (genereates 10 values, 1 to 10)&lt;/P&gt;&lt;P&gt;Expression: sum(if(component_responsible = 'area' &amp;amp; valuelist(1,10,1),defects_components))&lt;/P&gt;&lt;P&gt;+sum(if(design_responsible = 'area'&amp;amp;valuelist(1,10,1),defects_design))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; In the first sum() I look at all the data and compare each value of component_responsible to the word "area" followed by the number generated in the dimension.&lt;/P&gt;&lt;P&gt;Then I do something similar for the design. Above is assuming you have 10 areas, but you can insert a variable into the function that returns the total number of areas.&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;On a similar thread (and again much easier) you could create a stand alone table of distinct areas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EG. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Area_table:&lt;/P&gt;&lt;P&gt;load distinct Component_responsible as Area resident main_table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could then use that as the dimension and perform a similar expression to the one above where you compare your component responsible and design responsible to the stand alone area dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erica&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 20:41:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-expressions-with-different-dimension-field-but-having-same/m-p/437468#M486284</guid>
      <dc:creator />
      <dc:date>2014-02-06T20:41:05Z</dc:date>
    </item>
  </channel>
</rss>

