Modifying Cell Values by Condition

  • Last update:May 28, 2025
  • Overview

    Application Scenario

    A cell can display different values according to different conditions, for example:

    The display value of Discount is a hyphen (-) if a product is not discounted, and a number followed by a text if a product is discounted. 

     0.1.png

    Alternatively, you can set cells containing no data to display the value 0, as shown in the following figure.

     pic_01(1).png

    Implementation Method

    You can add a New Value condition attribute to change the display values of cells by condition.

    Example One

    Data Preparation

    Create a general report, create a built-in dataset, design the table as shown in the following figure, and rename the dataset ds1.

     1.1.png

    Table Design

    Design a table and drag the fields from the dataset into corresponding cells, as shown in the following figure.

     1.png

    Condition Attribute Setting

    1. First, to display the value of Discount as a hype (-) if a product is not discounted, perform the following operations:

    Select cell D2, and add a New Value condition attribute with New Value set to String - and the condition set to currentValue Equal to '1', as shown in the following figure.

     3.png

    2. Second, to display the value of Discount as a number followed by a text if a product is discounted, perform the following operations:

    Select cell D2, add another New Value condition attribute with New Value set to Formula =D2+" Off" and the condition set to currentValue Not Equal to '1', as shown in the following figure.

     4.png

    Effect Display

    PC

    Save the report. The pagination preview effect is the same as that shown in section "Application Scenario."

    Mobile Terminal

    The preview effects on the DataAnalyst app and the HTML5 terminal are the same, as shown in the following figure.

     2.png

    Example Two

    Data Preparation

    Create a general report, create a built-in dataset, design the table as shown in the following figure, and rename the dataset ds1.

     4.2.png

    Table Design

    Design the table in the same way as that in section "Table Design."

     2.png

    Condition Attribute Setting

    Select cell D2, and add a New Value condition attribute with New Value set to String 0 and the condition set to the formula len($$$)=0, as shown in the following figure. In this case, 0 is displayed in the cells containing no data.

     7.png

    Effect Display

    PC

    Save the report. The pagination preview effect is the same as that shown in section "Application Scenario."

    Mobile Terminal

    The preview effects on the DataAnalyst app and the HTML5 terminal are the same, as shown in the following figure.

     8.png

    Template Download

    1. Example One

    For details, you can download the template Modifying Cell Values by Condition.cpt.

    2. Example Two

    Foe details, you can download the template Modifying Cell Values by Condition - Example Two.cpt.

    Application Extension

    Obtaining New Values of Other Cells

    If you want to obtain the display value of a cell for which a new value is set, you are advised not to directly enter a formula in the other cell. Otherwise, you can only obtain the actual value.

    This is because the formula is calculated before template loading, while the new value takes effect after template loading. Therefore, the formula set in the other cell still returns the actual value.

     9.png

    If you want to obtain the display value, you can add a new value condition attribute using the method shown in the following figure.

     10.png

    The following figure shows the final effect.

     11.png

    How New Values Affect Other Condition Attributes

    The formula (if any) in a cell is calculated before the condition attribute New Value.

    The new value does not affect other condition attributes within the same cell.

    The new value from the left cell in the same row is incorporated into the calculation of the condition attribute from the right cell.

    The new value from the upper cell in the same column is incorporated into the calculation of the condition attribute from the lower cell.

    iconNote:
    You cannot use Data Entry widgets and New Value condition attributes simultaneously in Data Entry reports. Otherwise, the new values will not take effect.

    Attachment List


    Theme: Report Features
    Already the First
    Already the Last
    • 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