KPI Examples for the Timeline Widget

A guide on how to create three different KPIs for the timeline widget in Plecto.

Last updated: Sept. 24, 2021

Do you want to display the latest closed deals, calls, or get an overview of your meetings, tasks, or other activities? The timeline widget allows you to view your KPIs in chronological order, and it is most widely used with LAST and SUM lookup functions.

The examples below will show you how to create formulas with LAST function in the advanced formula editor to display the most recent closed deals, latest calls, their duration, as well as last completed tasks.

Each of the examples requires you to know the default date of your data source. For integration data sources, you can find the name of the default date field in the data source settings under "Default date used in formulas." For manual data sources, the default date is usually "Created date."

If you use these formula examples, make sure to adjust the data source, filters, and fields in the formula relevant to your organization.

Tip: Save some time - build the first formula, then create copies of it and simply adjust a thing or two! Learn how to copy formulas in this article.

Let's say you want to get an overview of your latest closed deals, value, and closing date. All you have to do is create three formulas and add them to a timeline widget on your dashboard.

Last Closed Deal Timeline.png

Timeline widget displaying the most recent closed deals, their value, and the closing date.

The following formulas take data from a data source called "Deals," and its default date field is "Created date." If we allow the formula to look at this date field, then the timeline widget will display the clients, values, and closing dates relevant to when the registration was created and not when the deal was closed. Therefore, we need to use a date modifier to make the formula look at a date field called "Closed date" instead.

Note: If you are dealing with multiple date fields in your data source, using a date modifier will help you specify which date field the formula should use. Alternatively, if "Closed date" (or similar title) is already the default date of your data source, you do not need to use a date modifier.

  • To see the name of your most recent closed client, you can create a formula like the following. To ensure that the widget displays the name of the client, set the number formatting to "Text" in the formula editor.
(
    Last(Deals,Closed="True",Client).Date(Closed date)
)

This formula takes data from a data source called Deals and looks at registrations from a field called Client. It also verifies if the deal is closed with a filter condition Closed="True" and makes the timeline widget sort the data based on the Closed date because of the use of a date modifier. The formulas below follow a similar routine.

  • To see the value of your closed deals, you can create a formula like the following. Set the number formatting to "Decimal number." For a better overview of the deal value, we have added a "€" prefix to the formula (optional).
€ (
    Sum(Deals, Closed="True",Value).Date(Closed date)
)
  • To see the closing date of your deals, you can use a formula like here below. Set the number formatting to "Date" or "Date and time" - whichever you prefer.
(
    Last(Deals,Closed="True",Closed date).Date(Closed date)
)

Want to see the metrics for your latest calls? This example shows how to create KPIs to display your team's latest calls by duration, status, and direction.

Calls Timeline.png

Timeline widget displaying the most recent calls and their duration, status, and direction.

The following formulas take data from a data source called "Relatel Calls," and the default date field in this data source is "Created date." The "Created date" is the date field we need to use in this particular example, and therefore, we will not apply any date modifiers to the formulas. If your data source has a different default date, consider using a date modifier (see the examples above and below or click here).

  • To see the duration of your latest calls, you can use a formula like the following. Set the number formatting to "Duration."
(
    Last(Relatel Calls,Call Duration)
)
  • If your data source includes information about call direction, you can use a formula like the following. Set the number formatting to "Text."
(
    Last(Relatel Calls,Direction)
)
  • To see the status of your latest calls, you can use a formula similar to the following. Set the number formatting to "Text."
(
    Last(Relatel Calls,Status)
)

Do you have a data source that gathers information about all your tasks? Create a timeline widget to see your latest completed tasks by description, completion date, importance, or other metrics.

Last Completed Tasks.png

Timeline widget displaying the latest completed tasks, completion date, and importance.

The following formulas take data from a data source called "Wrike Tasks," and its default date field is "Created date." Since we are interested in the completed tasks, we will use a date modifier to make the formula look at a date field called "Completed date." Without the date modifier, the timeline widget would sort and display registrations based on the created date and not when the task was completed.

  • To see the description of the latest tasks with their status set to "Completed," you can use a formula similar to the following. Set the number formatting to "Text."
(
    Last(Wrike Tasks,Status="Completed",Description).Date(Completed date)
)

This formula looks at the Description field and only takes registrations that have the status "Completed." The date modifier .Date(Completed date) allows the formula to sort registrations on the timeline based on the completed date, as this is not the default date field in the data source. The formulas below follow a similar routine.

  • To see the latest tasks by the completion date, you can use a formula like here below. Set the number formatting to "Date and time" or "Date" - whichever you prefer.
(
    Last(Wrike Tasks,Status="Completed",Completed date).Date(Completed date)
)
  • To see the importance of your latest tasks, use a formula like the following.
(
    Last(Wrike Tasks,Importance).Date(Completed date)
)

All you have to do now is add a timeline widget to your Plecto dashboard, add your KPIs, select a time period, and click "Save"! 🎉

Read more: Learn how to create a target formula using an IF statement where the target value increases every hour: Hourly Target.

Was this article helpful?

Please leave a comment to help us improve.