Counting from strings

Results 1 to 2 of 2

Thread: Counting from strings

  1. #1
    Join Date
    Dec 1969

    Default Counting from strings

    I have an Access DB field called strVisitorType which can have a variety of strings in it. The users pick all the options that describe them by ticking checkboxes. What I want to do is to do a count of the options that have been counted by all the people. Some sort of matrix??<BR>Can anyone help?<BR><BR>Area employee<BR>Area employee, Visitor to the area, Professional/researcher<BR>Professional/researcher<BR>Area resident, Area employee<BR>Professional/researcher<BR>Area resident, Area school pupil<BR>Area employee, Professional/researcher<BR>Area resident<BR>Possible or future visitor to the area<BR>Professional/researcher<BR>Possible or future visitor to the area<BR>Area resident<BR>Possible or future resident<BR>Area resident, Area school pupil<BR>Area resident<BR>Area resident<BR>Possible or future resident<BR>Possible or future visitor to the area<BR>Area resident, Area employee, Professional/researcher<BR>Possible or future resident<BR>Area resident, Area business, Professional/researcher<BR>Area resident<BR>Area resident, Student<BR>Community group representative<BR>Area business<BR>Area employee<BR>Area resident, Professional/researcher<BR>Area resident, Area employee<BR>Area resident, Community group representative<BR>Area resident, Area employee, Professional/researcher<BR>Area resident<BR>Area employee<BR>Area resident<BR>Area resident, Professional/researcher<BR>Area resident<BR>Possible or future resident<BR>Area resident<BR>Area resident<BR>Possible or future resident<BR>Possible or future resident, Professional/researcher<BR>Area resident, Area business, Area employee<BR>

  2. #2
    Join Date
    Dec 1969

    Default I'm not quite sure what...;re after. Can you show the result you want to get from the data you posted? What sort of "matrix" do you want? Do you simply count how many times "Area resident" appears in the list?<BR><BR>If so, split multi-selections (such as "Area resident, Area employee, Professional/researcher") into single selections (i.e. split the three options into three separate items) and then sort the resulting array. You should get something like this:<BR><BR>Area employee<BR>Area employee<BR>Area employee<BR>Area employee<BR>Area resident<BR>Area resident<BR>Area resident<BR>Area school pupil<BR>Professional/researcher<BR>Professional/researcher<BR>Professional/researcher<BR>Professional/researcher<BR>Visitor to the area<BR><BR>Then just loop through the array above, increasing a counter as you go and every time the text changes compared to the previous item, you know a new entry starts. Then you add the item and the value of the counter to a new array, reset the counter and carry on.<BR><BR>Oliver.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts