Skip to main content

Repeat Fixed Text in Complex Reports

Scenario

Two text labels need to be repeated in a table. In the sample table below, the two text labels "Sales Quantity" and "Sales Amount" need to repeat alternately in the vertical direction.

image.png

Implementation Steps

Prepare Data

  1. Create two fields in the view for repeated text:

image.png

  1. Drag the required fields to dimensions and measures:

image.png

Online Editing Mode

  1. Edit the formula template online

image.png

Template formula description:

  1. =G_(view1.Month): For dynamic properties, select vertical expansion, copy cell style, interval write (there are two fields, so interval write is 1), and do not add extra rows or columns.

image.png

  1. =G_(view1.Sales Quantity Text): Dynamic properties are the same as item 1.

  2. =G_LOOKUP(9,view1,Sales Quantity,Month:A{r}): Match by the Month field in view view1 and retrieve Sales Quantity data. The formula for Sales Amount is the same.

Local Editing Mode

  1. Set the Excel template. You can refer to the attachment.

Fixed Text Repetition.xlsx

image.png

Template formula description:

  1. &=view.Month(skip:1,noadd,copystyle)

Because two fixed text labels need to be repeated, each data row needs to skip 1 row, so skip:1 is used.

noadd means no extra rows are added.

copystyle means copying the cell style.

  1. &=view.Sales Quantity 1(skip:1,noadd,copystyle) and &=view.Sales Amount 1(skip:1,noadd,copystyle) are the same as item 1.

  2. &&=guanlookup9([],view,Sales Quantity,Month, A{r}):

&&=guanlookupN([], <source table to query>, <value field to query>, <specified condition field>)

  1. After uploading the template, preview and save it to implement the report shown above.