Prevention of Cartesian Products During Submission

  • Last update:November 07, 2024
  • Overview

    System crash may occur if the calculation result of a Cartesian product is too large. Therefore, a Cartesian product restriction has been added to FineReport to prevent the submission of a row with multiple arrays.

    If a row to be submitted contains two or more array-type data records, it will be detected as a Cartesian product. In this case, the system will prevent the data from being submitted, leading to a failed submission.

    1. In general reports (namely CPT reports), if Cartesian products exist, a prompt indicating the existence of Cartesian products will appear when you click Submit, as shown in the following figure.

    2024-09-25_18-11-00.png

    iconNote:
    You are advised to update FineReport with the latest version of the JAR package, which provides location-related prompts when Cartesian products occur.

    2. In dashboards (namely FRM reports), if Cartesian products exist, the submission page gives no feedback when you click the Submit button. You can view details in logs.

    2024-09-26_11-10-21.png

    You can also locate problems through your browser by using Developer Tools.

    Cause of Cartesian Products in Reports

    Loss of Data Filter Relationships

    1. The loss of the parent-child cell relationship disrupts the filter relationship between the two cells. The parent cell will no longer be a filter condition for the current cell, which causes  all values of the dataset field to be expanded in the current cell. Consequently, the original 1:1 relationship between the parent and child cells turns into a 1:N relationship.

    2. The loss or disruption of the parent-child cell relationship can cause the values in the child cell to either not be expanded at all or be expanded in multiple directions simultaneously, resulting in a Cartesian product.

    Occurance of Unnecessary Arrays in the Template

    1. Data is grouped by using array functions.

    2. The returned value of the drop-down checkbox is of the array type.

    3. Values in the table of a dashboard are saved as a list type.

    Scenario Analysis

    The following figure shows a normal data entry report.

    2024-09-25_14-36-50.png

    In this case, the default parent-child relationship is used. That is to say, the cells in which values are expanded downward take the left cells as their parent cells. The following four scenarios may result in Cartesian products.

    Loss of Filter Relationships Caused by Line Breaks

    With a line break, multiple fields in a dataset can be relocated from one row within a data relationship to multiple rows for better display and easy operation.

    2024-09-25_14-41-18.png

    This will cause Cartesian products because the filter relationship of the first cell in the second row will be lost, causing a N*N submission (Value quantity of Salesman * Value quantity of Sales Volume).

    Solution: Set the parent cell of Product Type in the second row to B2 to prevent Cartesian products.

    Loss of Filter Relationships Caused by Blank Column Expansion

    If expansion is configured for an empty cell, the parent cell of D2 will be changed to C2, causing the loss of the original filter relationship between D2 and B2, as shown in the following figure.

    2024-09-25_17-48-33.png

    The downward expansion configured for the blank cell in column C cause the cells on the right of column C to lose their filter relationships. Consequently, a Cartesian product will occur due to the N*N submission (Value quantity of Salesman * Value quantity of Sales Volume).

    Solution: Set the left parent cell of D2 to B2 to prevent Cartesian products.

    Disruption of Filter Relationships Caused by Horizontal Expansion

    The horizontal expansion here is a special scenario. If you set Expansion Direction for the cell above a certain field to Horizontal, the filter condition and the parent-child relationship below may be disrupted, causing Cartesian products, as shown in the following figure.

    2024-09-25_14-43-57.png

    This scenario usually does not happen, but you need to pay attention to it when some columns are hidden.

    Solution: Set correct filter and parent-child relationships.

    Array Function

    If you have grouped data with an array function (for example, the ARRAY function), a Cartesian product will also occur due to the N*N submission, as shown in the following figure.

    2024-09-25_18-05-12.png

    Solution: Use the JOINARRAY function to output arrays as strings.

    Array-Type Value Returned by a Drop-Down Checkbox

    If the returned value of a drop-down check box is set to be of the array type, a Cartesian product will also occur due to the N*N submission, as shown in the following figure.

    2024-09-25_14-46-23.png

    Solution: Change the returned value to be of the string type.

    List-Type Values in the Table of a Dashboard

    Since no parent-child relationship is limited for data submitted in dashboards (namely FRM reports), the ordinary row data submission (when the cell value of a report block is submitted to a database) will also cause the system to recognize Cartesian products and restrict the submission, as shown in the following figure.

    2024-09-25_15-05-19.png

    Solution: This data entry method is not recommended because dashboards do not support data entry well inherently.

    Attachment List


    Theme: Decision-making Platform
    • 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