Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Zntz
Partner - Contributor
Partner - Contributor

How to get sum of sales for the same day of the week from years past.

Hello.

I am sure it is possible, but I wanted to know how I can manipulate a table, so it shows the sum of sales of the same day of the week of past years.

type2018-08-152019-08-142020-08-122021-08-11
 WednesdayWednesdayWednesdayWednesday
Fitness                     200
Running                   113                     30
Soccer                      3                     58 

 

My data are in vector format. e.g.

4-year history and those that accumulate.

datetypesale
11/08/2021Fitness                 200
11/08/2021Running                   30
12/08/2020Fitness                   58
14/08/2019Running                 113
15/08/2018Soccer                     3

 

Best regards.

Labels (1)
3 Replies
lironbaram
Partner - Master III
Partner - Master III

Hi, 
Have a look at the attached app for an example 

Zntz
Partner - Contributor
Partner - Contributor
Author

Hi!
I have tried this by when I add more data to the vector it does not return only the day of the week of previous years.

Zntz_0-1631722663046.png

table1:
load * inline [
date, type, sale
11/08/2021, Fitness, 200
12/08/2021, Fitness, 100
13/08/2021, Running, 50
11/08/2021, Running, 30
11/08/2020, Running, 222
12/08/2020, Fitness, 58
13/08/2020, Fitness, 116
13/08/2019, Fitness, 40
14/08/2019, Running, 113
15/08/2019, Running, 100
14/08/2018, Fitness, 9
15/08/2018, Soccer, 3
16/08/2018, Soccer, 6

];

Thank you.

lironbaram
Partner - Master III
Partner - Master III

Hi, 
please have a look at the attached app