Creating Comparison for Single Value to Compare last 7 days to the previous period

I’d like to create a tile that compares a single values last 7 days dat with the previous period - and then show that as a percentage change - ideally it would like like the below:

Sessions: 25,000
-5%

It looks like comparison only works with two separate values rather than being able to compare the same value during a time range for trending purposes.

I’m new to looker so not sure if there is another visualization option that will do this for me.

Thanks,

0 7 3,824
7 REPLIES 7

Not sure if I understand correctly but you can do that by selecting last 14 days, choose week as a dimension and then use table calculation to calculate the difference. Then you will be able to use Single Value visuatlisation to show you the number and the % difference

Thanks for the reply - I’m using the offset formula to do this - but the most recent data shows up as null - is there a reason the top row/line item is null? There is data there to do the calculation but it isn’t working - also you are saying in the single visual tile you can show the raw number with the percent change in the same view? Could you show an example?

Show us what you’ve got and what’s the desired output

old thread and not to jump on somebody else’s question .. but I’m stuck a little here. 

@Dawid  if you did last 14 days with a week dimension - wouldn’t that be split over multiple weeks if it was exact weeks? For example if I did 7 days today it would be Wed-Thur -- so over 14 days that would be 3 weeks -- not 2… 

That’s true, I wasn’t exactly sure what was the intention of the initial question. Anything like that I achieve with a calendar table that I have that has day_offset column. I would filter data with that and say day_offset between -14 and 0 and then split that in half to compare

aiden2
New Member

@Shaun_Guidolin @jabers_000 

Hope I am understanding the question correctly, but this tile seems like it can be easily achieved with table calculations, in my response i’m assuming it is the last 7 days compared with the previous 7 days.

Potentially you can use the offset_list() table calc with a table of values by day: If your data table is sessions by day, you can use  sum ( offset_list(${value}, 0, 7) ) to get the sum of sessions over the past 7 days, then use sum (offset_list(${value}, 7, 7) ) to get the previous 7 days. These two values can then be compared using the Single Tile Viz comparison. 

The final data table should look something like this:
 

a253a5d1-6fac-4860-bffd-e0b760f5cebe.png

thanks @aiden2  worked like a charm  using sum(offset_list(${measure}, 0, 7))

Top Labels in this Space
Top Solution Authors