4 Replies Latest reply on Feb 18, 2014 3:15 PM by jkostenbader

    Change Sort Order By Selecting a Tab Panel

    jkostenbader

      Title

      Change Sort Order By Selecting a Tab Panel

      Post

           Let me preface this with, I'm relatively new to Filemaker and desperately trying to make the change from Access. 

           I'm trying to create what amounts to a dashboard of charts. The idea is to look at my projects table and show graphical feedback on what project categories are present, what projects are in what status and other business level feedback. True to a dashboard I'd like to create this on a single layout. Although I'm new to creating charts in Filemaker it appears that the chart relies on the found set sort order. For instance if I wanted to see a pie chart of the percentage of each project category, It needs to be sorted by Category. Since each layout can only have one sort order at a time I thought perhaps I could put a chart on a tab control and change the sort by moving from tab to tab. Apparently this is not as easy as it seems. I tried creating a hidden button behind each tab with no style at all and thought that may do the trick but  it does not work as anticipated.

           I guess I'd be interested in any advice with creating graphs that need multiple sort orders on a single layout or with my second premise of changing the sort order by moving from one tab panel to the next. 

           Thanks in advance

           John

        • 1. Re: Change Sort Order By Selecting a Tab Panel
          philmodjunk
               

                    it appears that the chart relies on the found set sort order.

               That would depend on the data source options you choose for the chart. You can also chart data from a related table and then the current layout's sort order has no effect on what you get in the chart. (But some charting options have to be based on the local found set to get what you want.)

               To do what you want, you could use the OnTabSwitch script trigger along with get ( TriggerTargetPanel ) (FileMaker 13) or Get ( TriggerTargetTabPanel) (FileMaker 12) to identify which tab panel has been clicked. You'll want to look these up in Help.

               But if the only difference in your charts is the sort order of your data, you don't need multiple tab panels with multiple charts. You can have just one chart and click a button or select from a drop down to resort the records to produce different charts.

          • 2. Re: Change Sort Order By Selecting a Tab Panel
            jkostenbader

                 I think I like your last suggestion the best. The tab control option was a work-around I was thinking of. Can you elaborate a little on your last suggestion. You state having only one chart and using a button or drop down to change sort order. I'm trying to present a business intelligence perspective (and keep true to the dashboard concept) by displaying multiple graphs with different information on one layout. Am I wrong in thinking this is impossible in filemaker given each layout can have only one sort order. 

                 John

            • 3. Re: Change Sort Order By Selecting a Tab Panel
              philmodjunk

                   It's an option that assumes that the only real difference between each chart is the sort order. That may not be the case in your project.

                   See what happens if you put a single chart object on your layout and use Sort from the records menu to sort your records differently.

                   Then keep in mind that a number of parts of your chart can be set up as calculations so you can set things up so that some of the labels change the same time that your script changes the sort order. (The script can set global variables to values that are then referenced by those calculations.)

              • 4. Re: Change Sort Order By Selecting a Tab Panel
                jkostenbader

                     For the time being I implemented your first suggestion. its not ideal because its not dashboard (ish) but its the best i can do for now. For those who struggle with this approach, here is the script I came up with that seems to work: