Forum Discussion
Haidann
6 years agoHelper I
02 Time Column in 01 Fact Table
Hello guys,
i have a dataset like below:
| hotel_id | room_type_id | provider_id | time_from | time_to | regular |
| 9169 | 1030 | 256877 | 1/16/2020 | 3/23/2020 | 40 |
| 45119 | 1033 | 188479 | 2/1/2020 | 4/14/2020 | 34 |
| 29826 | 1102 | 188479 | 2/26/2020 | 3/12/2020 | 29 |
| 45232 | 1066 | 188479 | 3/31/2020 | 12/31/2020 | 28 |
| 29888 | 1000 | 188479 | 3/30/2020 | 4/14/2020 | 26 |
| 22235 | 1066 | 270736 | 3/5/2020 | 12/31/2020 | 26 |
| 45120 | 1033 | 188479 | 12/23/2019 | 4/14/2020 | 25 |
| 40887 | 1031 | 240273 | 1/29/2020 | 3/10/2020 | 24 |
| 40887 | 1031 | 240273 | 4/9/2020 | 4/13/2020 | 24 |
| 40887 | 1031 | 240273 | 4/19/2020 | 12/31/2020 | 24 |
| 40887 | 1031 | 240273 | 4/16/2020 | 4/16/2020 | 24 |
| 33717 | 1031 | 188479 | 1/1/2020 | 1/5/2020 | 23 |
| 33717 | 1031 | 188479 | 4/5/2020 | 4/14/2020 | 23 |
| 33717 | 1031 | 188479 | 1/8/2020 | 1/15/2020 | 23 |
| 33717 | 1031 | 188479 | 1/6/2020 | 1/7/2020 | 22 |
| 45219 | 1031 | 188479 | 4/1/2020 | 12/31/2020 | 22 |
| 45219 | 1031 | 188479 | 12/20/2019 | 3/12/2020 | 22 |
| 30277 | 1004 | 188479 | 11/15/2019 | 2/11/2020 | 21 |
| 30277 | 1004 | 188479 | 2/20/2020 | 12/31/2020 | 21 |
| 29725 | 1000 | 161651 | 11/1/2020 | 11/30/2020 | 20 |
i`ve created a dimDate table and connected them on dimDate[Date] = dataset[Time_from]
Now i`d like to calculate between 06.02.2020 -> 21.03.2020, how many Regular are there but i can`t find the solution to calculate them
Please help me.
Thanks