September 8, 201510 yr 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).
September 9, 201510 yr Have you tried using a custom function like this one ? Really helped me out of a pickle lately...
September 9, 201510 yr 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" ) ) )
September 9, 201510 yr Author 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?
September 9, 201510 yr If you have a created a calculation field with this formula, make sure it is set to unstored.
September 9, 201510 yr Author Thanks eos. I thought I had done so - but I had not. All works well now
Create an account or sign in to comment