Forum Discussion

cottrera's avatar
cottrera
Post Prodigy
5 years ago
Solved

Countrows for dates that match week start date

Hi

 

I have a facts table which is a daily snapshot of lots of rows of data. I also have my dates table (both shown below)

I am struggling to countrows of the facts table if the date added match the start of the week.

I am not interested if all the other dates fall into that week only if the date added match the start of the week.

The result I would expect from the data below would = 4 (4 x 02/11/2020)

 

Facts Table 
Date AddedTrade
02/11/2020X
02/11/2020X
02/11/2020X
02/11/2020X
03/11/2020X
03/11/2020X
04/11/2020X
04/11/2020X
04/11/2020X
04/11/2020X
04/11/2020X
05/11/2020X
05/11/2020X
05/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X

 

Dates Table  
Dim DateWeekstart dateWeekstart number
02/11/202002/11/20200
03/11/202002/11/20201
04/11/202002/11/20202
05/11/202002/11/20204
06/11/202002/11/20205
07/11/202002/11/20206
08/11/202002/11/20200

thank you

Richard

2 Replies