Chinese-style Report, Formerly Complex Report, FAQ
Why does the G_LOOKUP function return 0 for matched data when data actually exists?
Cause 1: When data in View 2 is matched by a field from View 1, the matching fields in the two views may have inconsistent field types.
Solution: Keep the same field type consistent across different views. To convert a type effectively, create a calculated field and use a function to convert it.
? Case 1. Click to expand.
Formula: =G_LOOKUP(9,Details,Available Quantity,Material Code
,Warehouse)

Solution:
Use a function to convert the Material Code field in View 1 into a text field. The data can then be matched normally.

Cause 2: The query condition in the G_LOOKUP formula uses a value in double/float format.
Solution: Do not use values in double/float format as dimensions or query conditions, because precision issues may prevent correct matching. If the scenario requires this, use a function to limit the number of decimal places and convert the value to text format.
Cause 3: The query condition in the LOOKUP formula uses an aggregate calculation result from the measure area. In G_LOOKUP/G_LOOKUPEXP functions, query conditions currently support only fields from the dimension area.
Solution: Put the measure field used as the query condition into the dimension area. If the value needs calculation, calculate it in ETL or use a window function in the card.
? Case 2. Click to expand.
Use Advanced Calculation - Ranking to calculate the top 10 sales quantities for each region and each product category, and then use Ranking as one of the query conditions in the template.
Formula: =G_LOOKUPEXP(9,view1,Region,view1,Product Name,Product Category
,Ranking,Region:C1)

Solution: In the data preparation stage, use a window function to calculate ranking, and put Ranking into the dimension area.

When using sum() to calculate a column total, why does the result show 0 even though data exists?
Cause: The field referenced by the current column may not be numeric, such as a text field, so it cannot be summed.
Solution: In the view, use a function to convert the field to a numeric type and place it in the measure area.
Why does a column changed to number format become automatic format after saving, with numbers displayed in scientific notation?
Cause: The field being summed in the G_LOOKUP formula is in text format. Summing text and setting a format leads to inaccurate calculation results, and the format does not take effect. When the numeric length is too long, the Excel component automatically displays it in scientific notation.
Solution: Use a function in the view to convert the field format. For example: cast([Field] as double)

Can 0 or null values in a complex report be replaced with other symbols?
Answer: In version 4.8 and later, open the report preview page and expand Special Values on the right to configure multiple replacement rules. Pay attention to the replacement rules, which you can view by clicking the icon after adding a rule. Versions earlier than 4.8 support only null value replacement.
? Example. Click to expand.

How do I set thousands separators for data?
Local editing mode: Set the format in Excel and then upload the template.
Online editing mode:\
- Select the cell or formula to configure.\
- In the header, select Custom Format - More Number Formats, choose the required number format, and click OK.
? Step example

Tip: 1. In online editing mode, values with thousands separator format currently cannot be displayed as currency format "¥..." at the same time.
2. Thousands separators are available in version 4.2.0 and later.
Why does complex report data show #DIV/0?
Cause: When the denominator is 0, an error occurs and #DIV/0! is returned. Solution: Use Excel's built-in if(iserror()) function to replace it. Example: =G_CELLCALCEXP(if(iserror((B{r}-C{r})/B{r}),"--",(B{r}-C{r})/B{r}))
Why does increasing or decreasing decimal places from the toolbar not take effect?
Cause: The default cell format is Automatic, which does not support decimal place adjustment.
Solution: Manually change the format to one with decimal places, such as number, percentage, or currency, and then adjust the decimal places.
What is a derived table?
Answer: A derived table, or Dynamic Table, derives a new table from fields selected from the original table for vertical expansion, and automatically sorts and deduplicates the data. It is sorted in ascending order by default, and the sorting method cannot be adjusted. This is equivalent to placing fields in the dimension area of a card.
Comparison of report previews generated by native formulas and derived formulas:

Why does the subtotal formula not take effect?
Possible cause 1: The cell that contains the range field referenced by the subtotal does not have a Grouping method set in dynamic properties.
Solution: Set a grouping method for the cell containing the subtotal range field. There are three grouping methods. Merge Cells is commonly used.
Actual scenario:
Here, the subtotal range field is Material Code, which means the data is grouped and summed by Material Code. Therefore, the dynamic properties of Material Code in cell A3 must have Grouping selected.

Why are there more columns than expected after horizontal expansion?
Cause 1: When multi-row headers expand at the same time, or multiple columns of data expand alternately, Do not add extra rows or columns is not selected in dynamic properties. This causes multiple cell formulas to expand repeatedly.
Solution: Except for the last horizontal expansion formula, select Do not add extra rows or columns in the dynamic properties of other formulas. For details, see Explanation and Use Cases for Not Adding Extra Rows or Columns.

Cause 2: The derived table is used incorrectly in derived formulas. This mainly includes two cases: 1. formulas in different cells of the same column do not use the same derived table, causing each formula to expand to a different number of columns; 2. double values, timestamp date-time fields, or similar fields are incorrectly used as derived table fields, causing too many columns to expand.
Solution: 1. Use the same derived table for all formulas in the same column. 2. In derived formulas, use text string or integer int fields as derived tables.
Cause 3: A derived formula is used where horizontal expansion is not needed.
Solution: Use a formula without a derived table, or manually create and use a derived table with only one value.
How do I prevent row totals (G_COLTOTAL) and column totals (G_GRANDTOTAL) from expanding horizontally?
Solution 1: Row total (G_COLTOTAL) and column total (G_GRANDTOTAL) formulas must reference a derived table. If horizontal expansion is not needed, create a fixed field in any view, with any content, and drag it into the dimension area. Then use this view and field as the derived table in the total formula. See the following figure. This method applies to all derived formulas, such as G_LOOKUPEXP.

Solution 2: Do not use total formulas. Use other formulas such as sum() instead. See Different Calculation Methods for Complex Report Column Totals.