Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There is a number of tutorials available on this topic already

Expand

Content by Label
cqllabel = "tableview-merger"


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

...

And the configuration would be as follows:

Code:

Code Block
<ac:structured-macro ac:macro-id="12e6adff-88dd-44f5-8b56-1267299595f3" ac:name="confiform-table-merger" ac:schema-version="1">
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="accce381-7fc1-44b8-b716-9be2533d2ca6" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">name</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="053919d7-7cf9-4f12-9c74-bb054cadca56" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">How many times:([count])</ac:parameter>
      </ac:structured-macro>
    </p>
    <ac:structured-macro ac:macro-id="d388ac17-e047-42b5-8055-888ffa427e05" ac:name="confiform-table" ac:schema-version="1">
      <ac:parameter ac:name="formName">f</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>

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

    Code Block
    How many times:([count])

    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


ConfiForms TableView Merger

name

How many times:([count])

ff1