# Visualization for Current Value and Delta to previous day

Hi all

I am new at looker.

I am looking for visualization where I can show the current value and the delta to the previous day.

Is there any way to do this in looker?

Cheers
Ben

Hi Ben, you can achieve this with `offset` e.g.
`\${count}-offset(\${count},1)`
in a table calculation.

If you wanted it exactly like your image, with positive values green and negative values red, you could create 2 table calculations, with the positive one looking like:
`if(\${count}-offset(\${count},1)>0,\${count}-offset(\${count},1),null)`
This is saying: If the Delta is above 0, show the value, if it’s not, show null.

You’d then create another calculation like so:
`if(\${count}-offset(\${count},1)<=0,\${count}-offset(\${count},1),null)`
Which is the exact same but only shows Delta if it’s below 0.

Hello Zack

I probably still don’t understand enough about looker to formulate my question correctly.
The way I read it, you explained to me how to calculate the correct measures. However, I have already solved this on the database side. My problem is more the representation in a visualization.
I don’t understand how to visualize this “correctly”?

Many greetings
Ben

Hi all

I’ll bring the subject up again.
I would be glad if someone could help me here again.
It would be important for us to be able to make visualizations that resemble the above example.
Does that work in looker?

• with hack
• without hack

Cheers
Ben

I don’t think you can create a visualization that has a separate series above it like in your example— But you can have them side-by-side, like this:

If you follow @zckymc’s lead and create those two table calculations, you should quickly get a chart looking like this. In the “Series” section of the Viz settings (That little Edit icon in the top right of my screenshot) you can change the color of each series— Since there’s one table calc for positive, and one for negative, you can set them individually to Red/Green.

Would be interested to hear if anyone has a way to get closer to the original image!