Week over Week vs the prior week in Country


(Daniel Prol) #1

I want to create a calculation that shows me the % Week over Week vs the prior week in [Country] using functions.
Maybe using offset_list help? Thanks in advance!

(rufus) #3

@prol depending on your exact use case there are a couple of ways to achieve a week over week calculation.

Using order_items.count as an example of a kpi we want to report on, for a single value visualization vs. the week before we can use a simple offset function:


Then use Looker’s built-in comparison option in the viz settings:

If we want to plot this over time then we can do something like:

(${order_items.count} - offset(${order_items.count},1))

which we can then plot on a chart, even adding a pivot on country if we want:

Hope that helps!

(Daniel Prol) #4

Thanks! This was helpful.