In this business case I want to dashboard a doughnut chart that displayes the product versions that customers are on, but we store the data as a long string (i.e. 8.0_20250306.1 Update 12) and for the chart I only want the first three places. By using the Substring function I was able to add a column with just 8.0 and this made the chart and Legend much more manageable in the dashboard.
Here's how:
- Add a calculated field to your Generic Inquiry.
- In the calculated field's formula, use the
Substring(str, start, length)function.str: This is the field containing the data you want to segment, such as an Account or Subaccount field.start: This is the starting position of the segment you want to extract within the field, counting from the left (first character is position 1).length: This is the length of the segment you want to extract.
Example
If you have a field like "GLAccount" (e.g., "100-2000-300") and you want to extract the first three digits, you would use a formula similar to this: =Substring([GLAccount], 1, 3). This will return "100".