How to get value of a column for yesterday ?

Reply
Highlighted
Green Belt

How to get value of a column for yesterday ?

 

I have the following scenario :

 

Date              A    B

2016-03-01   y    y

2016-03-02   x    B(yesterday) + x

 

Bascially, I am trying to do addition in column B on monthly basis.

 

B(today) = A(today) + B(yesterday)

 

I am trying to execute this calculation :

 

(CASE when
DAY(`Date`) = 1 then
`A`
else
`A`+ ??? 
end
)

 

??? -> How do I get yesterday's value of B ?

Tags (2)
Highlighted
Green Belt

Re: How to get value of a column for yesterday ?

Also, please note that I cannot use CURRENT_DATE() for any manipulation as I am trying to calculate for already existing data as well

Highlighted
Moderator

Re: How to get value of a column for yesterday ?

Hi all,

 

Can anybody help @gaurav007 with their question?

Thanks!

Announcements
Coming Soon: Weekly Virtual User Meet-ups to answer all your questions! Stay tuned for more details to come this week.