Adding Table Calculations to a Report

Unifyr Support
Unifyr Support
  • Updated

Table calculations make it easy to create ad hoc metrics. They are similar to formulas that are found in spreadsheet tools such as Excel. Table calculations appear as green columns in the data table, which differentiates them from columns based on dimensions (blue) or measures (brown).

Table calculations can perform mathematical, logical (true/false), lexical (text-based), and date-based calculations on the dimensions, measures, and other table calculations in your report. 

  1. With the Explore of the report open, go to the field picker area of the report builder (left sidebar)
  2. In Custom Fields, click Add > Table Calculation. The Create table calculation window opens.
  3. In the Calculation field, choose the type of calculation you want to include:
    • Select a prebuilt calculation, for example % of row or Running column total
    • Choose Custom expression to add a calculation of your own
  4. If adding a prebuilt expression, complete the information requested. This will differ based on the calculation type selected.
  5. If entering your own custom expression, add the expression definition in the Expression field:
    • Enter a Looker expression
    • The expression can evaluate to a number, date, string (text), or boolean (true/false)
    • You can only create table calculations from numeric fields that appear in the Explore's data table (i.e. those listed in the In Use tab of the field picker).
    • Syntax suggestions are displayed as you type
    • You can use the Format field to specify how the result should be formatted
  6. When you've completed all the fields, click Save. The new calculation will automatically appear as a column in the data table and is listed in the Custom Fields section of the field picker. As with other fields, you can select the calculation's name to add or remove it from a report.

    For example, this report shows a list of partners with their current totals of new and registered leads. The Less than 10 new leads column is based on the expression ${lead_to_ref.new_leads}<10 and displays Yes if the calculation evaluates to true.

    admin_analytics_report_custom_calculation.png

  7. To edit the calculation later, click   > Edit calculation next to the column.
  8. To hide the custom calculation from the visualization of the report, click   > Hide this field from visualization next to the column.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.