I want to build a barchart showing the nr. of male and female employees we had in a certain month and the respective ratio.
So far, that's no problem - I can do it on GUI-level using set analysis - but then I have to do it on scripting level so as to be able to make it into a chart.
I have a masterdata table with one record per employee and of course there's a binary field (1/0) for gender that I can count.
The challenge is this:
=> For every employee, there is a date when he/she joined the company and there is a leaving date - that's always filled. For those still here, there's some future date in there.
<=> I will need to generate the information whether that employee was with the company in a present month - for simplicity, on the 1st of a month.
If I had a way of dynamically (in the script) generating the names of months until the present day, I could just generate one more field for every month in that LOAD statement containing an X if an employee has an entry_date before the 1st of that month and a leaving_date after the 1st - or last, if it can be done - of that month.
Up to now, I cannot think of a way I could generate those months.
Re: Scripting challenge - process a masterdata table
I know generally how the interval_match function works. I've used it before - but last time I used it, I defined the intervals myself and I had fixed values to match against those - this time, it is upside-down: I have a large number of intervals - between the entry_date and leaving_date which might be different for every employee - and I would have to decide whether a certain month (or date) this year (which I'd also have to generate dynamically) matches any (or several) of those intervals.