How do I display members in consistent formats in a report table?
1. Usage scenarios
When configuring member components on the form page, because member components can be configured to display job numbers or hide them, some members will be displayed on the form page of the report with job numbers and some, then we can configure the member format to be consistent through the configuration formula.
2. Video Display
3. Procedure
3.1 Add formula
Add the member display name component directly and assign the name separately.
Add a formula on the report page
3.2 split name
We need to split the names first. The format of the employee number of the member component is [name (employee number)], so we only need to separate the values with a delimiter ("), the first part is the name, and the second part is the job number. At this time, we can use the SPLITPART function to implement
For more information about the formula format, see:Report formula
3.3 since the Member component is in string format, it will be displayed in string format after splitting.
Click the Edit button behind the field.
3.4 if the employee number is split, it will be displayed as "[" name ", while if the employee number is not, it will be directly in the complete string format" ["name"]」. If we need to intercept the name, we can use the MID function.
For more information about the formula format, see:Report formula
The MID function refers to a character with a length of n starting from the n th on the left, so we can use the MID function to intercept the split name, since the truncated string contains "[" and "punctuation, we start with the third value and truncate a string with a length of three.
Then, a problem will be encountered at this time. The value obtained after SPLITPART division with an employee number is marked with punctuation before the name, but there is no punctuation after the name, therefore, when using MID to intercept a string with a length of 3, there is no punctuation, but the member values without work numbers are punctuation before and after segmentation, therefore, if the length of the member name is 2, the value of the string with the length of 3 will be truncated with a "" punctuation mark.
At this time, we can first judge the string length. Because this situation occurs when the name length is equal to 2, we first judge the name length. We use the LEN function to determine the string length. When the name length is 2, the string length is 10.
For more information about the formula format, see:Report formula
3.5 when the string length is less than or equal to 10, use the MID function to return a string with a length of 2. If the string length is greater than 10, use the MID function to return a string with a length of 3. Here we can directly use CASEWHEN functions to implement
3.6 effect as shown in the figure
-------------------- Get the latest information YIDA, welcome to follow US--------------------