Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a list of from and to dates and I would like to create a table to show some thing like this:
From | To | Number submitted |
2/24/18 | 4/20/18 | 4658 |
4/21/18 | 6/15/18 | 2342 |
6/16/18 | 8/10/18 | 8765 |
Where number submitted is a count if the date is between from and to. I'm not sure how I can refer to the associated From and To date from the measure
this option preserves the dates table
dates:
LOAD *, From & '|' & To as Key Inline [
From, To
2/24/2018, 4/20/2018
4/21/2018, 6/15/2018
6/16/2018, 8/10/2018
8/11/2018, 10/5/2018
];
Applicant:
LOAD * INLINE [
received_date, applicantID
3/23/2018, 3343
2/28/2018, 1224
4/21/2018, 222
];
Inner Join IntervalMatch ( received_date )
LOAD From, To
Resident dates;
inner join (Applicant)
load
From, To, Key
Resident dates;
drop field From, To from Applicant;
What if I needed to do this matching with more than received_date because I also have measures that look at a different date field
If you are creating a table with your From and To fields, add this as a measure:
=count(if(date(received_date)>date(From) and date(received_date)<=date(To),applicant_id))
I used the following sample data and it calculated correctly.