Child pages
  • Using TableView merger to find duplicate records

Versions Compared

Key

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

Status
colourGreen
titleSince version 1.36

Consider having a requirement to find duplicate records in the ConfiForms dataset.

...

Code Block
<ac:structured-macro ac:macro-id="d15cdea6-43a1-4555-aa1d-ee3879e2bdbe" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">f</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:macro-id="bad2c384-a4ab-47ce-9207-28ee30111017" ac:name="confiform-entry-register"
                         ac:schema-version="1">
      <ac:rich-text-body>
        <p>&nbsp;</p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p>
      <ac:structured-macro ac:macro-id="8b34ab65-e56a-4550-89a8-99d0278e4952" ac:name="confiform-field-definition"
                           ac:schema-version="1">
        <ac:parameter ac:name="fieldName">myname</ac:parameter>
        <ac:parameter ac:name="fieldLabel">The name</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="45dd0575-4e4f-4f03-9757-4ef10d301aa8" ac:name="confiform-field-definition"
                           ac:schema-version="1">
        <ac:parameter ac:name="fieldName">mark</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Mark</ac:parameter>
        <ac:parameter ac:name="values">false[0=0|1=1|2=2|3=3|4=4|5=5|]</ac:parameter>
        <ac:parameter ac:name="type">select</ac:parameter>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>

 

Here is how to show ONLY those "marks" which are registered more than once

Image Added

We use TableView Merger macro, and put "mark" field as a grouping field and define a "Count" field with [count] expression

Defining an expression as "Count:([count])" will create a virtual field name "Count" which will hold the number of records in this "group"

We can use this field in a filter, to show only those marks which were registered more than once

Code Block
Count:>1

Storage format for the TVM can be found below

Code Block
<ac:structured-macro ac:macro-id="84c1980f-dd9e-4d96-aacb-52003156a435" ac:name="confiform-table-merger"
                     ac:schema-version="1">
  <ac:parameter ac:name="filter">Count:&gt;1</ac:parameter>
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="8c841340-1033-4a46-8c4e-abf5bd9579ae" ac:name="confiform-field"
                           ac:schema-version="1">
        <ac:parameter ac:name="fieldName">mark</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="c2ff76c3-ba6b-42c2-bde0-b5a7d1a72c3b" ac:name="confiform-field"
                           ac:schema-version="1">
        <ac:parameter ac:name="fieldName">Count:([count])</ac:parameter>
      </ac:structured-macro>
    </p>
    <ac:structured-macro ac:macro-id="e6e68c3a-67ea-45a2-8fda-e996c94ae900" ac:name="confiform-table"
                         ac:schema-version="1">
      <ac:parameter ac:name="formName">f</ac:parameter>
      <ac:rich-text-body>
        <p>&nbsp;</p>
      </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>