2 Replies Latest reply on Mar 23, 2015 11:03 PM by mchancevet@gmail.com

    Counting a Variable

    QuincyBaynes

      Title

      Counting a Variable

      Post

      Hello,

      I have a file maker calendar that "m just about finished with. The portals are filtered by a variable. ex. $$day 1, $$day 2 and so on to day 42. I'm trying to add a field that would tell me how many records I have more than the four that's showing. My portal has for four records but I don't want to use a scroll bar. Any ideas?

      I was playing with just using a text "More Events" and setting it to white (the background color) then have it turn conditionally turn to back if more than 4 records exist.

      I was also thing about putting a field that says "X" more Events but I would need a way to could the records. The first one seems easier but the second on would look cleaner. Any thought on how to write a calculation to achieve this.

      Thanks

      Quincy

        • 1. Re: Counting a Variable
          philmodjunk

          Looks like you'd need to either:

          a) replace the filters with relationships to multiple occurrences

          b) use ExecuteSQL to count them

          c) set up a table with one record per day that matches to the records shown in your calendar and then you can define a count function in this record that counts all records for that one day.

          • 2. Re: Counting a Variable
            mchancevet@gmail.com

            Hello,

            I'm not sure if this will help in your context but I have created a demo file with an Calculation field with the Execute SQL function to count filtered portal records as Phil mentioned above.

            Tables are 'Parent' and 'Child' 

            Parent Layout has 2 portals - Unfiltered and filtered and 2 calculation fields one of which counts all related child records (the unfiltered set) and the other uses the Execute SQL function to count only those that match the filtered criteria.

            You can change the filter to see the calculation working.

            Good Luck.

            Morgan

            https://www.dropbox.com/s/dj7rq7adocrpfnp/SampleFilterCalculation.fmp12?dl=0