Formula Recipes

A list of formula recipes that are commonly used.

This document contains often-used formula recipes that can help with building reports in Wink Reports. It is recommended to visit the report designer formula reference page to gain an understanding of the functions available.

Durations / Intervals

Name Example Notes
Round a Duration to the nearest whole number
INTERVALVALUE(FLOOR(EPOCH([Avg Duration])), "seconds")
After averaging, duration values can end in a decimal value. This can be fixed by using a rounding function.

However, it first needs to be casted into a number value before it is rounded down.

This formula rounds down by doing the following:

  1. Take the average duration

  2. Convert it into seconds.
  3. Round down.

  4. Convert back to interval/duration.

Filter Out Similar Rows

Sometimes aggregation isn't quite the right solution for trimming out duplicate rows.

You can instead use the ROWNUMBER() function and a post-aggregation filter to pick which rows you want.

For example, to only get one row for each [First Name] sorting by [Last Name], add a column "First Name Index" with formula:

 ROWNUMBER([First Name], [+Last Name]) 

and a post-aggregation filter:

 [First Name Index] = 1

Show records older than 4 weeks ago

While using a custom date range is the best way to show records within a certain time frame, you may wish to use a data source filter as well.

The following formula will only show records that are older than 4 weeks ago:

[Date Created] < (NOW() - INTERVALVALUE(4, "weeks"))