This is the documentation for ConfiForms Server/Data Center appHowever, this might also work for ConfiForms cloud and in most cases it does. But please see this page to understand the differences between server and cloud versions of the ConfiForms app.
With TableViewMerger macro you can do data aggregations and merging. We can supply the sources for the data to be supplied from different sources / forms.
There is a number of tutorials available on this topic already
In this cookbook we show how you can quickly group the data by "key" and count how many times the row with this "key" is present in the dataset
Consider to have a simple form with a given structure (2 fields):
And we need to count how many times in the records the field name has occurred
We will use TableViewMerger to help us with this sort of calculation
And the configuration would be as follows:
Important bits here are:
- We specify a ConfiForms Field macro with field name set to "name" to point at our "name" fields in the form. This is not an expression (does not have a wrapping () around it's name and doe s not have a reference to [entry.field_name], so it will be taken as grouping key!)
For the second column, to count, we define an expression like
It defines a label to be used (How many times) and the expression to calculate ([count]). You can use Supported math operators, formulas and functions and you can have references to filed values in expressions via [entry.field_name] notations
- [count] and [total] are special context variables available in TableViewMerger. [count] shows the records count for a grouped by key, while [total] holds a total number of records in the dataset
So, for the data like this:
you will get this calculated with TableViewMerger like this:
How many times
You can put the generated table (whole TableViewMerger macro configuration) into a chart macro to build nice charts and graphs over your data. Consult Atlassian documentation on how to use the chart macro: https://confluence.atlassian.com/doc/chart-macro-163415075.html
To illustrate how to count registrations by user name, in other workds by metafield "createdBy"
You will need to configure your TableViewMerger macro like this
What if you want to count the records, but have multiple fields as a grouping key?
The concept is the same. Fields without expressions are taken in to form a unique key for the record. Let's say we want to group the records by createdBy and our "name" field
The configuration for TableViewMerger will be then
Sometimes you dont need a field value that forms a grouping key to be presnet in the resulting table. This is possible by configuring the field not to display
So the resulting table with configuration like this
will have 2 columns in teh result, not 3 as defined in the configuration (because one is set to be hidden)
How many times