Arcadia’s KPI visual type allows you to run comparison between two different measures. Let’s say you wanted to show this months user activity as the KPI but also show how it compares to last month (with colored arrows & percentage change).
You can read more about the KPI visual & its various settings here:
In the below example we will focus on simple example to compare activity week over week.
To perform the comparison we need to use SUM-IF statement. The IF statement will limit the SUM to the date range of interest. Here’s how to setup the expressions. We used “date_sub” to offset our time by the interval we are interested in:
This week measure:
sum(if([Ts] > date_sub(now(), interval 1 week),1,0)) as 'this week'
Last week measure:
sum(if([Ts] between date_sub(now(), interval 2 week) and date_sub(now(), interval 1 week),1,0)) as 'last week'
Then we add these expressions to the respective shelves: