Duplication Verification

  • Last update:  2022-01-20
  • I. Overview

    1. Application scenarios

    Sometimes it is necessary to check whether the data reported in a certain field is duplicate. If there are duplicate values, an error message will be prompted and no submission is allowed.

    1.png


    2. Implementation ideas

    Take the filled cell as an array, and set formulas in the other two cells. One formula gets the original value of the array, and the other formula gets the value of the array after duplication.

    If there are duplicate data in the array, the values of the two cells are not the same. Finally, the two cells are verified in the submission verification. If the cell values are equal, the submission is allowed. If the cell values are not equal, an error is reported.

    II. Examples

    1. Data preparation

    Create a new data query dataset ds1, and the SQL statement is: select * from SALES_COST


    2. Design form

    1) Design the data entry form, drag the salesperson and total sales field to A2 and B2 cells respectively, add title, and add two formulas to A5 and B5 cells, as shown in the figure below:

    • A5 cell formula: joinarray ([A2], "), returns the string of all the values extended by A2 cell, keeps the duplicate data, and does not add the interval symbol

    • B5 cell formula: joinarray (unique array ([A2]), "), returns the string of all values expanded by A2 cell, removes duplicate data, and does not add interval symbol

    2) The A5 and B5 cells are hidden, and there is no need to display the data as a condition when filling in the front end. The final table is shown in the following figure:


    3. Setup submission

    In the menu bar, click Template > Data Entry Attribute to add a new built-in SQL submission, as shown in the following figure:


    4. Setting data verification

    In the designer menu bar, click Template > Data Entry Attribute to add a built-in verification under data validation settings, as shown in the following figure:

    • Calibration formula: A5 = B5

    • Error Information: "There are duplicate data in the salesperson field! "

    Note: if A5 and B5 are not equal, there will be duplicate data.


    5. Effect preview

    1) PC terminal:

    Save the template and click Data Entry Preview. If there are duplicate data filled in the salesperson field, the verification fails, as shown in the following figure:

    Kapture 2021-01-07 at 17.05.37.gif

    2) Mobile terminal:

    3.png


    III. Template download

    Completed template, see %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\DataEntry\DataEntryAttribute\DE_CheckForDup.cpt

    Click download template: 

    DE_CheckForDup.cpt


    IV. Formula expansion

    The formula inserted in cells A5 and B5 can be replaced by the following two groups:

    indexformuladefinition 
    1LEN(JOINARRAY([A2], ""))array is converted to the string length without the interval
    LEN(joinarray(UNIQUEARRAY([A2]), ""))array is converted to string after removing repeated values without adding a spacer
    2count(A2)The number of elements in the array
    count(UNIQUEARRAY(A2))

    The number of elements in array after removing duplicate values


    Attachment List


    Theme: Data Entry
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy