Reducer functions are used to aggregate or group values that are displayed in the chart.The following video walks through the steps involved in using reducer functions.

FrequencyReducerFunction
Frequency reducer function applied to Y axis. It shows the number of transactions per category on the Y axis.
FrequencyReducerFunction
Frequency reducer function applied to Y axis. It shows the number of transactions per category on the Y axis.

Reducer functions are used to aggregate or group values that are displayed in the chart. For example we can use the reducer functions to display the number of transactions per category, or display the highest expense per category from the sample data shown below

expenses": [ { "amount": 100.9, "category": "Gas" }, {"amount": 20.9, "category": "Gas"  }, {     "amount": 30.9,"category": "Food"},{ "amount": 12.9, "category": "Food"},{"amount": 10.9,       "category": "Movies"  }]

AEM Forms provides a number of reducer functions that can be applied to the data. The images shown above demonstrate  Frequency and Maximum reducer function applied to the Y axis. 

To try this on your local server, follow the steps below

    Setup tomcat as described here

    Download the ReducerFunctions.zip file

    Import the zip file using the package manager. The following assets are included in the package:

            Interactive Communication Document 

            Form Data Modal

Open the Interactive Communication Document in edit mode

Add and configure chart component to use reducer functions.

Preview Interactive Communication Document.

Download

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy