Forum Discussion
Rudy_D
Resolver I
4 years agoCount matchs between two tables
Hi everyone !
I have some trouble to solve the problem below.
I have two unrelated tables :
Table 'Job'
| ID | Start Job | End Job |
| 1 | 02/20/2022 01:00 am | 02/20/2022 07:00 am |
| 2 | 02/20/2022 07:00 am | 02/20/2022 05:00 pm |
| 3 | 03/15/2022 02:00 am | 03/15/2022 08:00 am |
| 4 | 02/14/2022 02:00 am | 02/14/2022 08:00 am |
| 1 | 02/21/2022 07:00 am | 02/21/2022 05:00 pm |
Table 'Travel'
| ID | Start Travel |
| 1 | 02/20/2022 03:00 am |
| 2 | 02/20/2022 09:00 am |
| 1 | 02/21/2022 09:00 am |
| 4 | 02/13/2022 02:00 am |
I would like to calculate, for each ID and by month, how many times the 'Start Travel' time is between 'Start Job' and 'End Job'.
The expected result for February would be :
| ID | Result |
| 1 | 2 |
| 2 | 1 |
| 4 | 0 |
Thank you very much for your help.
Rudy
maybe you can create a column
isinscope =var _check=maxx(FILTER(Job,'Job'[ID]=Travel[ID]&&Job[Start Job]<='Travel'[Start Travel] && 'Job'[End Job]>='Travel'[Start Travel]),Travel[Start Travel])return if(ISBLANK(_check),0,1)pls see the attachment below
8 Replies
- ryan_mayu
Super User
maybe you can create a column
isinscope =var _check=maxx(FILTER(Job,'Job'[ID]=Travel[ID]&&Job[Start Job]<='Travel'[Start Travel] && 'Job'[End Job]>='Travel'[Start Travel]),Travel[Start Travel])return if(ISBLANK(_check),0,1)pls see the attachment below- ryan_mayu
Super User
you are welcome