Overview
The formula builder assists you to write valid formulas for your view. Calculated fields written in this way can be used as normal fields within a report – i.e. all functions can be applied to them such as aggregations etc. This is not possible with SQL calculated fields. To begin you will need to work out what type of field your resulting value will require and select either Metric or Dimension.
...
If you are not familiar with Case Statements, the basic structure is as follows:
Code Block |
---|
|
CASE
WHEN this is true THEN return this
WHEN this is true THEN return this
WHEN this is true THEN return this
...
ELSE return this
END
|
...
- To insert a Case statement, click the CASE button in the Formula Builder.
- Click on the WHEN button will open a popup and create your first WHEN condition and THEN instruction.
Note: it operates similar to the formula builder, only allowing formula objects to be inserted where they are valid.
- Click OK to complete your condition/instruction
- Continue adding WHEN conditions until you have covered all the possibilities required
- Add an ELSE condition if needed, this is optional, but recommended.
- Add your END component
- Save & Activate your calculation
...
Section |
---|
Column |
---|
| Demographic | Rating |
---|
Sport | 2.5 | Culture | 5 | Family | 6.5 |
|
Column |
---|
| Group Rating values under new labels. |
Column |
---|
| Demographic | Rating |
---|
Sport | Poor | Culture | Standard | Family | Standard |
|
|
Creating a Grouped Values Field
...
- Drag in Grouped Values field into a Category in the Available Fields panel
- Select a Field to base the grouping on
- Supply a Business Name
- Navigate to the Values tab
- Click on Add Group
- Poor Between 0 AND 3
- Click Save
- Click on Add Group
- Standard Between 4 AND 7
- Click Save
- Click on Add Group
- Save & Activate your field