<?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 Pie Chart 4 field values and 2 groups in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Pie-Chart-4-field-values-and-2-groups/m-p/1576261#M597596</link>
    <description>&lt;P&gt;Hello All experts,&lt;/P&gt;&lt;P&gt;I've got a problem with my piechart.&lt;/P&gt;&lt;P&gt;I want so count two fieldvalues as one and two other fieldvalues as one and then subtract a sum from the right group.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;Field1value 1 = 10&lt;/P&gt;&lt;P&gt;Field1value 4 = 8&lt;/P&gt;&lt;P&gt;Field1value 2 = 4&lt;/P&gt;&lt;P&gt;Field1value 6 = 2&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim&lt;/P&gt;&lt;P&gt;if(field1=1 or field1=4,'ABC',if(field1=2 or field1=6,'DEF'))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now this should give you&lt;/P&gt;&lt;P&gt;ABC=18 - 75% of the total of 24&lt;/P&gt;&lt;P&gt;DEF=6 - 25% of the total of 24&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now here comes the hard part.&lt;/P&gt;&lt;P&gt;I want to subtract and + a sum from/to the field1 depending in which group it is in.&lt;/P&gt;&lt;P&gt;ex(that doesnt work):&lt;/P&gt;&lt;P&gt;if(valuelist('ABC','DEF')='ABC',count(if(field1='ABC',field1))-sum(field2),count(if(field1='DEF',field1))+sum(field2))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;lets say that field2 = 3&lt;/P&gt;&lt;P&gt;it would give us this pie chart:&lt;/P&gt;&lt;P&gt;ABC=15 - 62,5%&lt;/P&gt;&lt;P&gt;DEF=9 - 37,5%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is this achievable?&lt;/P&gt;&lt;P&gt;Sorry for my bad grammar.&lt;/P&gt;&lt;P&gt;Thanks in advance and have a nice day.&lt;/P&gt;&lt;P&gt;/Rob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 May 2019 07:36:09 GMT</pubDate>
    <dc:creator>ontoit7331</dc:creator>
    <dc:date>2019-05-03T07:36:09Z</dc:date>
    <item>
      <title>Pie Chart 4 field values and 2 groups</title>
      <link>https://community.qlik.com/t5/QlikView/Pie-Chart-4-field-values-and-2-groups/m-p/1576261#M597596</link>
      <description>&lt;P&gt;Hello All experts,&lt;/P&gt;&lt;P&gt;I've got a problem with my piechart.&lt;/P&gt;&lt;P&gt;I want so count two fieldvalues as one and two other fieldvalues as one and then subtract a sum from the right group.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;Field1value 1 = 10&lt;/P&gt;&lt;P&gt;Field1value 4 = 8&lt;/P&gt;&lt;P&gt;Field1value 2 = 4&lt;/P&gt;&lt;P&gt;Field1value 6 = 2&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim&lt;/P&gt;&lt;P&gt;if(field1=1 or field1=4,'ABC',if(field1=2 or field1=6,'DEF'))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now this should give you&lt;/P&gt;&lt;P&gt;ABC=18 - 75% of the total of 24&lt;/P&gt;&lt;P&gt;DEF=6 - 25% of the total of 24&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now here comes the hard part.&lt;/P&gt;&lt;P&gt;I want to subtract and + a sum from/to the field1 depending in which group it is in.&lt;/P&gt;&lt;P&gt;ex(that doesnt work):&lt;/P&gt;&lt;P&gt;if(valuelist('ABC','DEF')='ABC',count(if(field1='ABC',field1))-sum(field2),count(if(field1='DEF',field1))+sum(field2))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;lets say that field2 = 3&lt;/P&gt;&lt;P&gt;it would give us this pie chart:&lt;/P&gt;&lt;P&gt;ABC=15 - 62,5%&lt;/P&gt;&lt;P&gt;DEF=9 - 37,5%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is this achievable?&lt;/P&gt;&lt;P&gt;Sorry for my bad grammar.&lt;/P&gt;&lt;P&gt;Thanks in advance and have a nice day.&lt;/P&gt;&lt;P&gt;/Rob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 07:36:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pie-Chart-4-field-values-and-2-groups/m-p/1576261#M597596</guid>
      <dc:creator>ontoit7331</dc:creator>
      <dc:date>2019-05-03T07:36:09Z</dc:date>
    </item>
  </channel>
</rss>

