9 Replies Latest reply on May 21, 2014 9:52 PM by CarlSchwarz

    Visual Timeline for Shop Opening Hours

    keefbc

      I've put together a example database to show how I've implemented a visual representation of shop opening hours for a few dummy records.

       

      The eventual solution will be for several hundred shops with possible different opening hours for each day of the week Monday through Sunday (7 days) with a minimum resolution that could be 5 mins i.e. 12 possible options per hour and two options per shop. That will work out to be alot of fields and calculations!

       

      I tried looking at charting options in fmp but nothing seemed to fit the bill?

       

      Can anyone think of a better implementation to minimise the number of fields and the grunt work needed to implement it?

       

      Thanks in advance for any help!

        • 1. Re: Visual Timeline for Shop Opening Hours
          erolst

          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.

          • 2. Re: Visual Timeline for Shop Opening Hours
            brsamuel

            I have done something similar, displaying start & stop times for several bells in a bell tower.

            I used repeating fields (330 iterations) to plot the information.  I was storing a slice of an image in each repetition.  I probably did it the hard way, but it works.

             

            Screen Shot 2014-05-20 at 7.32.56 PM.png

            Marc

            1 of 1 people found this helpful
            • 3. Re: Visual Timeline for Shop Opening Hours
              keefbc

              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.

              • 4. Re: Visual Timeline for Shop Opening Hours
                erolst

                Did you perchance miss my attached sample file?

                keefbc wrote:

                a custom function in Fmp Advanced which should minimise the grunt work […] still a lot of fields though.

                I guess you did.

                • 5. Re: Visual Timeline for Shop Opening Hours
                  keefbc

                  Hi Erolst

                   

                  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!

                  • 6. Re: Visual Timeline for Shop Opening Hours
                    CarlSchwarz

                    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.

                     

                    TimeLine.png

                    1 of 1 people found this helpful
                    • 7. Re: Visual Timeline for Shop Opening Hours
                      keefbc

                      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!

                      • 8. Re: Visual Timeline for Shop Opening Hours
                        keefbc

                        Hi Carl

                         

                        Yes, pretty easy to change the time resolution/increments. I'd be interested in a bit more explanation on your showing overlaps technique?

                         

                        Thanks.

                        • 9. Re: Visual Timeline for Shop Opening Hours
                          CarlSchwarz

                          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.