Child pages
  • Advanced aggregations and calculations with TableView Merger

Versions Compared

Key

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

This should be a details detailed tutorial one day... but as it is we have very hectic times as usual, I will quickly put a cookbook page showing the techniques which can be used with TableView Merger

We use here:

  • CONCAT function to concatenate values from 2 fields together and show it in one column
  • We count (group by) by one field but use another as calculation input. See example below (which groups by "status" field which has value 1 and uses [entry.timeestimate] field value for calculations)

    Code Block
    Draft:([count_status=1]*[entry.timeestimate])
  • Important detail on how to group the rows (as we can only group by field values, not by expressions. That is why a table used to draw a chart has 2 fields: proposalType and status to enable correct grouping)
  • Chart does not use the columns used for grouping, see source code below to see how it is configured


The end result is something like this:

Image Added

And that is build from the following dataset

Image Added


So, we have a form 

Image Added


And the solution uses groping by 2 fields, proposalType and status, have these fields also as TableView Merger Field column defined like this

Code Block
Proposal and Status:(CONCAT("[entry.proposalType.label] ","[entry.status.label]"))

Which reads as: create a column by concatenating the values of 2 fields (we take labels from dropdowns here)

This field (expression) is used to have a field in the table and use it as input for the chart macro


Warning

More details coming soon... If you need help please send a message to use using our contact form

ConfiForms (FormView) Registrations Control
pageTitleConfiForms Backlog
formNameconfiFormsIssues
registrationMessageYour request has been registered. We will answer you asap
registrationButtonLabelAsk us here



Macro views from the editor to clarify what should be the layout

Image Added

Image Added

Full source code to import through the Confluence source editor


Expand
titleClick here to expand the code...
Code Block
<ac:structured-macro ac:macro-id="a7e0bcd8-8980-4b37-8321-1949ef1613ff" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">Proposals</ac:parameter>
  <ac:parameter ac:name="registrationFormTitle">Proposals</ac:parameter>
  <ac:rich-text-body>
    <p>
      <br/>
      <ac:structured-macro ac:macro-id="f84518eb-5ec2-4cab-ab37-d0b39b064d64" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">timeestimate</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Time estimate</ac:parameter>
        <ac:parameter ac:name="fieldDescription">in days</ac:parameter>
        <ac:parameter ac:name="type">number</ac:parameter>
        <ac:parameter ac:name="required">true</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="dcea1b82-f2a2-4647-8b07-4a893bcab9b2" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">proposalType</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Proposal type</ac:parameter>
        <ac:parameter ac:name="values">false[enh=Enhancement|fix=Process fix|cha=Change|]</ac:parameter>
        <ac:parameter ac:name="extras">label;false</ac:parameter>
        <ac:parameter ac:name="type">select</ac:parameter>
        <ac:parameter ac:name="required">true</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="11d94001-9899-4dd3-a47f-6afd24c24584" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">status</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Status</ac:parameter>
        <ac:parameter ac:name="values">false[1=draft|2=proposed|3=accepted|4=refused|]</ac:parameter>
        <ac:parameter ac:name="extras">id;false</ac:parameter>
        <ac:parameter ac:name="type">select</ac:parameter>
        <ac:parameter ac:name="required">true</ac:parameter>
      </ac:structured-macro>
      <ac:structured-macro ac:macro-id="bd7f9ed1-c4fb-4866-9fbd-84cf140d58e9" ac:name="confiform-entry-register" ac:schema-version="1">
        <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
        <ac:rich-text-body>
          <p> </p>
        </ac:rich-text-body>
      </ac:structured-macro> </p>
    <p> </p>
  </ac:rich-text-body>
</ac:structured-macro>
<p> </p>
<p>with concat func</p>
<ac:structured-macro ac:macro-id="3afeec43-c528-4233-80d4-3307b4252445" ac:name="confiform-table-merger" ac:schema-version="1">
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="64dfa1fd-fd0d-4b54-8605-41d476bd72d4" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">proposalType</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="cd06791b-85f2-44f0-aec2-d99476fd3fc4" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">status</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="342d3668-1476-4307-9880-177eef00daac" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">Proposal and Status:(CONCAT("[entry.proposalType.label] ","[entry.status.label]"))</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="24ad514d-3a38-40f5-a7bb-0ae0f8d6c20f" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">Draft:([count_status=1]*[entry.timeestimate])</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="9267e210-0336-4278-a353-ba1fad49a8e2" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">Proposed:([count_status=2]*[entry.timeestimate])</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="2bae0c3a-4ee9-424f-92b2-df5b8615a61c" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">Accepted:([count_status=3]*[entry.timeestimate])</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="b674a0db-05f3-40e4-a7b7-ea0c5f9e1740" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">Rejected:([count_status=4]*[entry.timeestimate])</ac:parameter>
      </ac:structured-macro>
    </p>
    <ac:structured-macro ac:macro-id="da3ac559-02fe-42ec-8fe8-5e1cc1110ca5" ac:name="confiform-table" ac:schema-version="1">
      <ac:parameter ac:name="formName">Proposals</ac:parameter>
      <ac:rich-text-body> </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>
<p> </p>
<p> </p>
<ac:structured-macro ac:macro-id="daafd110-b794-416b-a99d-a5358b9ceb22" ac:name="chart" ac:schema-version="1">
  <ac:parameter ac:name="3D">true</ac:parameter>
  <ac:parameter ac:name="orientation">vertical</ac:parameter>
  <ac:parameter ac:name="stacked">true</ac:parameter>
  <ac:parameter ac:name="columns">3,4,5,6,7</ac:parameter>
  <ac:parameter ac:name="width">950</ac:parameter>
  <ac:parameter ac:name="rangeAxisLowerBound">1</ac:parameter>
  <ac:parameter ac:name="dataOrientation">vertical</ac:parameter>
  <ac:parameter ac:name="title">Proposals</ac:parameter>
  <ac:parameter ac:name="type">bar</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:macro-id="73015b0c-c758-4a4b-95d0-53bad0314ad0" ac:name="confiform-table-merger" ac:schema-version="1">
      <ac:rich-text-body>
        <p>
          <ac:structured-macro ac:macro-id="7779fcc5-97d9-4243-b2cf-763972cafb31" ac:name="confiform-field" ac:schema-version="1">
            <ac:parameter ac:name="fieldName">proposalType</ac:parameter>
          </ac:structured-macro>
        </p>
        <p>
          <ac:structured-macro ac:macro-id="fb99be08-0869-4c57-a7aa-a584e6a21843" ac:name="confiform-field" ac:schema-version="1">
            <ac:parameter ac:name="fieldName">status</ac:parameter>
          </ac:structured-macro>
        </p>
        <p>
          <ac:structured-macro ac:macro-id="eb20cec3-5f7d-4276-bbf4-e3b60a520d9d" ac:name="confiform-field" ac:schema-version="1">
            <ac:parameter ac:name="fieldName">Proposal and Status:(CONCAT("[entry.proposalType.label] ","[entry.status.label]"))</ac:parameter>
          </ac:structured-macro>
        </p>
        <p>
          <ac:structured-macro ac:macro-id="e6ecebf6-dab8-495a-90d1-43d340e47f34" ac:name="confiform-field" ac:schema-version="1">
            <ac:parameter ac:name="fieldName">Draft:([count_status=1]*[entry.timeestimate])</ac:parameter>
          </ac:structured-macro>
        </p>
        <p>
          <ac:structured-macro ac:macro-id="a16dd3ba-9691-4deb-9cb0-e738927ba7bd" ac:name="confiform-field" ac:schema-version="1">
            <ac:parameter ac:name="fieldName">Proposed:([count_status=2]*[entry.timeestimate])</ac:parameter>
          </ac:structured-macro>
        </p>
        <p>
          <ac:structured-macro ac:macro-id="90088c6b-3130-49fe-be89-184d2a5427d8" ac:name="confiform-field" ac:schema-version="1">
            <ac:parameter ac:name="fieldName">Accepted:([count_status=3]*[entry.timeestimate])</ac:parameter>
          </ac:structured-macro>
        </p>
        <p>
          <ac:structured-macro ac:macro-id="0fa3f056-0a1d-40e0-9501-5bb50faba125" ac:name="confiform-field" ac:schema-version="1">
            <ac:parameter ac:name="fieldName">Rejected:([count_status=4]*[entry.timeestimate])</ac:parameter>
          </ac:structured-macro>
        </p>
        <ac:structured-macro ac:macro-id="1cf7cc9b-72e6-49e8-9912-c04a8cb97a3a" ac:name="confiform-table" ac:schema-version="1">
          <ac:parameter ac:name="formName">Proposals</ac:parameter>
          <ac:rich-text-body> </ac:rich-text-body>
        </ac:structured-macro>
      </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>
<p> </p>
<p>proposals and status separately</p>
<p> </p>
<ac:structured-macro ac:macro-id="fbeebfa9-0cd1-4f9c-af9c-6ea3f5fa6e2b" ac:name="confiform-table-merger" ac:schema-version="1">
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="c7e94f44-9c09-4c40-a825-137d927e375b" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">proposalType</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="46e1c54a-fe07-4410-893a-96f51723940b" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">status</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="935bffd9-a149-430d-b7c0-959ce7c1aebc" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">Draft:([count_status=1]*[entry.timeestimate])</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="706ebc78-69bd-4962-9590-acf7649e193a" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">Proposed:([count_status=2]*[entry.timeestimate])</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="80896e79-0b7d-4d35-8cd8-5398886db2c2" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">Accepted:([count_status=3]*[entry.timeestimate])</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="60e666b6-a3e0-4261-9a6c-87b86fb828a9" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">Rejected:([count_status=4]*[entry.timeestimate])</ac:parameter>
      </ac:structured-macro>
    </p>
    <ac:structured-macro ac:macro-id="aa651f79-e9a0-4ad5-9a90-25bd3b7c5422" ac:name="confiform-table" ac:schema-version="1">
      <ac:parameter ac:name="formName">Proposals</ac:parameter>
      <ac:rich-text-body> </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>