<?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 Show different expression in Legend in a pie chart in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Show-different-expression-in-Legend-in-a-pie-chart/m-p/1725082#M723771</link>
    <description>&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;I have a data set with four fields - Group, Person, ProductId, Amount. Basically there are two groups, A and B, in each group there are many persons. And each person can control several productId with a certain amount. Now I need to show a pie chart for each group. The pie should show the number of productId controlled by each person, also, in the legend I want to show the total amount for each person.&lt;/P&gt;&lt;P&gt;What I'm doing is, for each group, I create two pie charts, and&amp;nbsp; put one on top of another. In the bottom chart, I show the pie with number of productId and do not show legend in this chart. In the top chart, I show the legend only with amount in the legend. This solution works well for Group A (see below screenshot).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 464px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/36955iDE0B3C9502497EDA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, for Group B, since all amount values are zero, the top pie chart does not show anything.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 448px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/36956i3D84AD68555E19CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So my question is, is there a solution to show the legend still when the amount values are all zero in the top chart?&lt;/P&gt;&lt;P&gt;Or is there an alternative to create a chart like this? The idea is just create show the pie in one expression and show the legend in another expression.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached my qvw for your reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>msmichael</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Show different expression in Legend in a pie chart</title>
      <link>https://community.qlik.com/t5/QlikView/Show-different-expression-in-Legend-in-a-pie-chart/m-p/1725082#M723771</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;I have a data set with four fields - Group, Person, ProductId, Amount. Basically there are two groups, A and B, in each group there are many persons. And each person can control several productId with a certain amount. Now I need to show a pie chart for each group. The pie should show the number of productId controlled by each person, also, in the legend I want to show the total amount for each person.&lt;/P&gt;&lt;P&gt;What I'm doing is, for each group, I create two pie charts, and&amp;nbsp; put one on top of another. In the bottom chart, I show the pie with number of productId and do not show legend in this chart. In the top chart, I show the legend only with amount in the legend. This solution works well for Group A (see below screenshot).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 464px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/36955iDE0B3C9502497EDA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, for Group B, since all amount values are zero, the top pie chart does not show anything.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 448px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/36956i3D84AD68555E19CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So my question is, is there a solution to show the legend still when the amount values are all zero in the top chart?&lt;/P&gt;&lt;P&gt;Or is there an alternative to create a chart like this? The idea is just create show the pie in one expression and show the legend in another expression.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached my qvw for your reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-different-expression-in-Legend-in-a-pie-chart/m-p/1725082#M723771</guid>
      <dc:creator>msmichael</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Show different expression in Legend in a pie chart</title>
      <link>https://community.qlik.com/t5/QlikView/Show-different-expression-in-Legend-in-a-pie-chart/m-p/1725221#M723774</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;could you please share your data and expression you used? (i am not able to open QVW file)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;raji&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 07:44:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-different-expression-in-Legend-in-a-pie-chart/m-p/1725221#M723774</guid>
      <dc:creator>raji6763</dc:creator>
      <dc:date>2020-07-06T07:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Show different expression in Legend in a pie chart</title>
      <link>https://community.qlik.com/t5/QlikView/Show-different-expression-in-Legend-in-a-pie-chart/m-p/1725420#M723775</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/11742"&gt;@raji6763&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sure. This is the data:&lt;/P&gt;&lt;P&gt;'data':&lt;BR /&gt;LOAD * Inline [&lt;BR /&gt;'group', 'person', 'productId','amount'&lt;BR /&gt;'A', 'Mike', 'BBB001', 100&lt;BR /&gt;'A', 'Jake', 'BBB002', 100&lt;BR /&gt;'A', 'Jake', 'BBB005', 100&lt;BR /&gt;'A', 'Jake', 'BBB003', 100&lt;BR /&gt;'A', 'Jane', 'BBB003', 1000&lt;BR /&gt;'A', 'Sand', 'BBB005', 10&lt;BR /&gt;'B', 'Mike', 'BBB001', 0&lt;BR /&gt;'B', 'Mike', 'BBB002', 0&lt;BR /&gt;'B', 'Jake', 'BBB002', 0&lt;BR /&gt;'B', 'Jane', 'BBB003', 0&lt;BR /&gt;'B', 'Sand', 'BBB005', 0&lt;BR /&gt;]&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;below are the expressions:&lt;/P&gt;&lt;P&gt;For group A,&lt;/P&gt;&lt;P&gt;in the bottom chart, expression&amp;nbsp; =count({&amp;lt;group={"A"}&amp;gt;} distinct productId), do not show legend.&lt;/P&gt;&lt;P&gt;in the top chart, expression&amp;nbsp;=sum({&amp;lt;group={"A"}&amp;gt;} amount), show legend&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For group B, expressions are similar, just replace "A" with "B".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 14:35:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-different-expression-in-Legend-in-a-pie-chart/m-p/1725420#M723775</guid>
      <dc:creator>msmichael</dc:creator>
      <dc:date>2020-07-06T14:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Show different expression in Legend in a pie chart</title>
      <link>https://community.qlik.com/t5/QlikView/Show-different-expression-in-Legend-in-a-pie-chart/m-p/1725594#M723776</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/51171"&gt;@msmichael&lt;/a&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use the RangeMax function to "fake" a Zero value and trick the pie chart (with rounding count to the nearest Integer)...&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;RangeMax(0.00000001, your measure)&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;can you try the below expression?&lt;/P&gt;&lt;P&gt;&lt;U&gt;expression:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;RangeMax(0.00000001, num(sum({&amp;lt;group={'B'}&amp;gt;}amount),'##0'))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;raji&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 07:25:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-different-expression-in-Legend-in-a-pie-chart/m-p/1725594#M723776</guid>
      <dc:creator>raji6763</dc:creator>
      <dc:date>2020-07-07T07:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Show different expression in Legend in a pie chart</title>
      <link>https://community.qlik.com/t5/QlikView/Show-different-expression-in-Legend-in-a-pie-chart/m-p/1725695#M723777</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/11742"&gt;@raji6763&lt;/a&gt;, I used a straight table instead for the top chart as legend. But I think your solution should work well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 13:03:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Show-different-expression-in-Legend-in-a-pie-chart/m-p/1725695#M723777</guid>
      <dc:creator>msmichael</dc:creator>
      <dc:date>2020-07-07T13:03:18Z</dc:date>
    </item>
  </channel>
</rss>

