Here's one way.
If you store the opening times as related records instead as fields, the calculation could (probably) be even more simplified.
If you really need scalability, consider a simple HTML table and a looping script to calculate the code (fill the cells with a dummy string (the notorious non-breaking space) and a color attribute) – light footprint, very fast.
Open Times_eosMod.fmp12.zip 71.8 K
Thanks Marc - yes, repeating fields were also considered - nice looking layout!
I think my way forward is probably a custom function in Fmp Advanced which should minimise the grunt work and make checking and debugging/alterations a bit quicker - still a lot of fields though.
Thanks again for your input.
Did you perchance miss my attached sample file?
a custom function in Fmp Advanced which should minimise the grunt work […] still a lot of fields though.
I guess you did.
Sorry your post has just appeared so didn't even see it - will have a look at your attachment and get back. Your explanation sounds like an interesting approach.
Thanks for the input!
1 of 1 people found this helpful
I also did it this way. With 15 minute increments it only works out to 96 repetitions. Each 15 minute interval is highlighted by custom formatting.
And a "add(timestart, timeend)" and "remove(timestart, timeend)" script
This repetition is in a join table so I have a different timeline for multiple people. I also made it show overlaps.
Hi Erolst - that certainly simplifies the problem and what a fantastic demonstration on how to use repeating fields and the Extend function. Also very easy to change the time resolution - excellent work and thanks again!
Yes, pretty easy to change the time resolution/increments. I'd be interested in a bit more explanation on your showing overlaps technique?
Hmm, I had to look at the scripts to remember.
The add script is actually
Add(timestart, timeend, jobnumber)
Remove (timestart, timeend, jobnumber)
Each repetition has a list of job numbers, remove just uses a text operation to remove that job from the repetition. If the count of carraige returns is greater than one then show a different colour
E.g. the conditional format uses this for the highlighting to show overlaps:
PatternCount ( Self ; "¶" ) > 1
and this for just a single job
PatternCount ( Self ; "¶" ) = 1
It sounds complicated but it wasn't that hard to implement. And because of "self" I didn't have to write a separate conditional format for each time-bracket so putting it on the layout wasn't too time consuming.