4 Replies Latest reply on Feb 20, 2015 7:08 PM by jsheller

    Display count of item next to the items in a value list

    jsheller

      I have a value list that is being used to filter a portal that allows me to see what courses a professor taught in a chosen semester. As an example, when I choose "Fall 2013-2014" in the value list, it filters the portal to only show courses from the Fall 2013 semester taught by the professor I am currently browsing.

       

      What I would like to do is display the count of courses next to the semester so I can see how many courses were taught by the professor in the semester before I choose it. Something like:

       

      Fall 2013-2014 (2)

      Spring 2013-2014 (3)

      Fall 2014-2015 (1)

      Spring 2014-2015 (3)

       

      Here is what I have done:

      I have two tables: Faculty and Course. They are related using a key field (FacID) to link the faculty to the course they taught. I have already set up a summary field in the Course table (CourseCount) to count the ID number of the courses (CourseID). I use a portal in the Faculty layout to see the courses from the Course table linked to that professor. I added a drop-down menu outside the portal that is used to filter the portal. This all works without a hitch.


      The value list of the drop-down menu uses the values from the Semester field in the Course table. It is told to only show related values from the Faculty table. This is fine as it eliminates the options that have zero courses. However, when I try to display values from a second field CourseCount, this is the result:

       

      Fall 2013-2014 (9)

      Spring 2013-2014 (9)

      Fall 2014-2015 (9)

      Spring 2014-2015 (9)

       

      I understand why this is happening, but no configuration of changes has made the counts be different for each value list item. Is there a way to pull this off? What am I missing?

        • 1. Re: Display count of item next to the items in a value list
          erolst

          A value list is a rather limited selection tool; have a look into the sample file to see a better way.

           

          If you have FM13, check out the faculty FM13 layout, which exploits Conditional Hide.

           

          PS: If you're really keen on using a value list, you can define it in the desired way (based on the relationships in the sample file):

           

          1. Field: Semesters::semester, 2. field: Courses__filteredForCount::cFoundCount, Starting from: Faculty

           

          This assumes that you're using semester names, instead of keys …

          • 2. Re: Display count of item next to the items in a value list
            ejannsen

            Hello, if you are using FM13, try creating a summary field for each semester. then you could put four portals on a popover. This will allow you to see the count for each semester. Then next to the portals put the filed with the value list. Then you can choose from the value list. 

             

            The reason you are seeing nine in the count field is because it is counting from the found set of records. Hope this helps.

            • 3. Re: Display count of item next to the items in a value list
              erolst

              ejannsen wrote:

              try creating a summary field for each semester. then you could put four portals on a popover. This will allow you to see the count for each semester. Then next to the portals put the filed with the value list. Then you can choose from the value list.

              Notwithstanding other problems with your suggestion (like the fact that I don't understand it … ) : you want to avoid solutions that assume a given quantity (or are optimized for it), since then you have to tweak it for every (substantial) change in the amount of data involved, i.e. frequently …

              • 4. Re: Display count of item next to the items in a value list
                jsheller

                I really like this example. It's a bit more complex than what I would like for what would seem like an easy feature to add, but it would greatly help me in other scenarios. The FM13 layout is incredibly elegant, which is a real surprise, and I'm going to spend some time studying the back end so I can try implementing it into my solution. 

                 

                I really appreciate the time and effort you took to answer the question. Thank you very much.