Period-over-Period Date Comparisons

I found two super cool blocks for doing PoP comparisons - Date Comparison Block by bencannon for Datatonic and Flexible Period-over-Period Block by fabio for LookerIO - but was super bummed to find out that neither would quite meet the needs I had. So I tried my hand at making a hybrid that I could work into my Looker setup and came up with something I think is pretty neat. It’s very flexible and does not require you to create any new views of your data. Details on its functionality are commented in the code itself and briefly explained on the GitHub page linked below.

It doesn’t handle comparing a specific date range to another specific range like the Datatonic block, so I’d recommend that utility if you need to compare ranges of different lengths or time periods that aren’t at regular intervals.

So, introducing for the first time, Looker PoP Comparison . This is my first attempt at a Looker block like this, and I had way less time than I wanted to test it, so please feel free to tear it apart! Any feedback or suggestions are welcome! I’m hoping to beef up the documentation when I have some more free time.

Dimension%20Screenshot

6 Likes

Annnnd I already found a data type problem. My intended fix made it worse. Working on it now!

ETA: Resolved!

Hello Caitlink, thank you for you great work!! However I experienced some difficulties integrating the model part. I see you connected everything directly to Big Query, we do the same thing connecting looker to our data Warehouse on Big Query, but when I’m integrating your model part, I have the following error message:
Would you be able to help me on that ?
Thanks a lot !
Théo

You cannot copy and paste the whole file - the code shouldn’t contain all the fake data I put in there like the label, description, or “foo bar” where clause. Where the comment says “Add the clause shown after the AND to your explore”, only copy the if statement that comes after the word “AND”. It also seems to think the fee value you’re filtering is a dimension and not a measure, but that could be because of the fake restriction still in there. I’d delete that first and see what happens.