Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone! I have a small but very annoying issue with IntervalMatch.
My data consists of "membership" start and end date, so I've done an IntervalMatch to be able to count number of flags for "active members" for a given day, month or year etc.
My issue is, when I count the flag it seems as tho all of the "membership" without an end date (currently active) doesn't have a flag at all.
Members:
LOAD
ID,
Start,
End,
FROM blahblah
tempTable:
LOAD min(Start) as mindate,
max(End) as maxdate
RESIDENT Members
;
LET vMinDate = fieldvalue('mindate',1)-1;
LET vMaxDate = fieldvalue('maxdate', 1);
DROP TABLE tempTable;
DateTable:
LOAD *,
ActiveDate as Date,
Week(ActiveDate) as Week,
Year(ActiveDate) as Year,
Month(ActiveDate) as Month,
Day(ActiveDate) as Day
;
LOAD date($(vMinDate) + IterNo()) as ActiveDate
AUTOGENERATE 1
WHILE $(vMinDate) + IterNo() <= $(vMaxDate)
;
LEFT JOIN(Members)
IntervalMatch (ActiveDate)
LOAD
Start,
End
RESIDENT Members;
LEFT JOIN(Members) LOAD 1 as ActiveCounter AUTOGENERATE 1;
Have I missed anything?
/Meg
That will work, but it's not pretty to put the end date there if there is none. That also wont work if for example I'd like to count ending in current month. So I'd rather not change the actual dates.