MySQL query for YTD Running Total

Hi all,

I'm having trouble creating a mySQL query that does a running total by a certain Group By dimensions.  

 

Here is a sample structure of the data:

 

datestoreChannelVisitsYTD Total
1/1/2019ABanner100100
1/1/2019ASearch5050
1/1/2019AEmail2525
2/1/2019ABanner75175
2/1/2019ASearch55105
2/1/2019AEmail3055
3/1/2019ABanner200375
3/1/2019ASearch85190
3/1/2019AEmail75130
1/1/2019BBanner500500
1/1/2019BSearch100100
1/1/2019BEmail6565
2/1/2019BBanner300800
2/1/2019BSearch400500
2/1/2019BEmail2590
3/1/2019BBanner2501050
3/1/2019BSearch200700
3/1/2019BEmail70160

 

 

The YTD Total column is what I'm trying to calculate.  The raw data is essentially the first 4 columns.  I need to create a Running Total of visits for the year by STORE and CHANNEL.  

 

Appreciate anyone's help!! Thanks! 

Comments