<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Generate a Pie chart with expression rule</title><link>https://community.appian.com/discussions/f/user-interface/25947/generate-a-pie-chart-with-expression-rule</link><description>Hi, 
 I need to create a pie chart with the output from expression rule. 
 I can use a!queryEntity() if the output is in Datastore entity with the help of aggregation functions. 
 Can anyone help me how to store the expression rule output to Data store</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Generate a Pie chart with expression rule</title><link>https://community.appian.com/thread/101473?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2022 07:09:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bdbe981a-b90a-47b7-92a8-4681014a0c5b</guid><dc:creator>ujjwalr0002</dc:creator><description>&lt;p&gt;If it worked please take a moment to accept the answer so that other people having the same doubt can actually refer and other contributors will know that you have found the solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generate a Pie chart with expression rule</title><link>https://community.appian.com/thread/101472?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2022 07:03:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9215eb07-a12c-4bcb-9abe-4fb0eacaaa47</guid><dc:creator>p2005</dc:creator><description>&lt;p&gt;Thanks Ujjwal, I was able to generate the report&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generate a Pie chart with expression rule</title><link>https://community.appian.com/thread/101470?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2022 07:01:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c0ab3e4c-316d-4b56-9ac0-352514b7982f</guid><dc:creator>ujjwalr0002</dc:creator><description>&lt;p&gt;In case you are not clear with the above answer please refer to the code below.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!selectedDepartment,
  /* This query fetches the grouped data for the pie chart. */
  local!chartDatasubset: a!queryEntity(
    entity: cons!EMPLOYEE_ENTITY,/*entity name */
    query: a!query(
      aggregation: a!queryAggregation(
        aggregationColumns: {
          a!queryAggregationColumn(
            field: &amp;quot;department&amp;quot;,
            isGrouping: true
          ),
          a!queryAggregationColumn(
            field: &amp;quot;id&amp;quot;,
            alias: &amp;quot;id_count&amp;quot;,
            aggregationFunction: &amp;quot;COUNT&amp;quot;
          )
        }
      ),
      pagingInfo: a!pagingInfo(
        startIndex: 1,
        batchSize: -1,
        sort: a!sortInfo(
          field: &amp;quot;department&amp;quot;,
          ascending: true
        )
      )
    )
  ),
  {
    a!pieChartField(
      series: a!forEach(
        items: local!chartDatasubset.data,
        expression: a!chartSeries(
          label: fv!item.department,
          data: fv!item.id_count,
          /* Clicking on the chart sets the filter value for the grid. */
          links: a!dynamicLink(value: fv!item.department, saveInto: local!selectedDepartment)
        )
      ),
      showWhen: isnull(local!selectedDepartment), 
      colorScheme: &amp;quot;MOSS&amp;quot;,
      style: &amp;quot;DONUT&amp;quot;
    )
  }
)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generate a Pie chart with expression rule</title><link>https://community.appian.com/thread/101469?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2022 06:43:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0411853b-dc85-42fc-86dd-823d3a1cb8d5</guid><dc:creator>ujjwalr0002</dc:creator><description>&lt;p&gt;You can use the output directly by indexing your data from the query rule and applying loop on the chart series and again indexing the labels and counts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>