Jump to content

Count of Filtered Portal Values


crazybake

This topic is 3097 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a new table named CourseList - a self join table using courseID. Within a layout, I have a portal which is filtered and sorted based on dropdown menus and checkboxes.

For example, I can see which courses are assigned to a particular budget for a particular quarter (e.g., in fall 2015, I have (7) courses for budget A, which are taught by (3) instructors). I have also created a duplicate single-row portal to get the record count (or # courses for that qtr). How can I get unique counts for number of teachers from the filtered portal data. For example Smith teaches (4) classes, Jones teaches (2) classes and Wilson teaches (1) class - I need to get a count of (3).

 

Link to comment
Share on other sites

Try this:

• create a value list of CourseList::teacherID
• create a summary field in CourseList as sListOfTeacherID
• put the summary field into a single-row, filtered portal
• assign that field an object name

The count of teachers is 

ValueCount ( 
  FilterValues ( 
    ValueListItems ( "" ; "TeacherIDVL" ) ; 
    GetLayoutObjectAttribute ( "objectNameOfRelatedASummaryField" ; "content" ) 
  ) 
)

 

Link to comment
Share on other sites

Try this:

• create a value list of CourseList::teacherID
• create a summary field in CourseList as sListOfTeacherID
• put the summary field into a single-row, filtered portal
• assign that field an object name

The count of teachers is 

ValueCount ( 
  FilterValues ( 
    ValueListItems ( "" ; "TeacherIDVL" ) ; 
    GetLayoutObjectAttribute ( "objectNameOfRelatedASummaryField" ; "content" ) 
  ) 
)

 

I was so close to this initially, and I still cannot get it to function. The portal will show the (11) sections (and the portal count will show 11.) However, when I create the summary field as a list of Teacher IDs, I get duplicate IDs.

 

Sorry - of course duplicates are listed - thus the idea of the filter values. I just cannot get the count to work properly. I changed the info you gave to include get(FileName), instead of "" for the location of the value list and it initially counted correctly. I then realized that changing it back to "" would also update the field and count correctly... so... what I am finding is that the field is not updating when I change the dropdown criteria. I am not storing the results and tried to put a script trigger to commit records, but does not seem to work. Any Ideas?

Link to comment
Share on other sites

This topic is 3097 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.