Jump to content

Data modeling question


johnstephens
 Share

Recommended Posts

Hey, Intelligentsia!

I have an unusual data modeling need, and I'm not sure how to approach it.

I'm creating a ProcessWire template to track Events (after the fact). When creating an event, the user will be able to select a category (Page reference field), start and end times (datepickers), etc.

One datum we need to track is the number of participants.

- Some participants may have been enrolled previously, so I could have a multi-select page reference field linking to the individual participants.
- But some of the participants will not be enrolled, so I'm thinking I need a numeric entry for those who are not enrolled.

When I report on participant counts for each event, it would be fine to add the number of registered participants to the numeric entry of unregistered participants to form a total.

But when I report on participant counts for a series of events, that won't work. Suppose Event 1 has 25 participants, and event 2 has 26 participants (one participant is new, and the other 25 attended the first event). I create a report that counts participants for both events. I want the report to show 26 participants total—not 51.

I'm not sure how to model this. If *every* participant was registered in some way, we could just log unique persons via a mult-select page reference field.  But creating a unique identifier for every participant—especially for participants who attend only one event—would be an overwhelming burden for the client.

On the other hand, plain numeric entries seem wholly inadequate. I'm not sure how to normalize or finesse the data model to get the information I need without creating an unmanageable data entry chore.

Any ideas?

Link to comment
Share on other sites

When there is the need to check a new participant if he matches one of the ones enrolled previously, I think you can't avoid having an identifier for every participant.

Edit:

Assuming every participant is a page (the PW way :rolleyes:), the page's ID would  be the natural unique identifer for your purpose.

  • Like 1
Link to comment
Share on other sites

Maybe you can create separate template for participants, wich will contain all needed field for it. In your event template add page field (Autocomplete or InputfieldChosenSelect) and allow a creation of new pages through this field. So, if your participant is registered you would select it, but if not, you can just enter a name of this participant and add it to the list, but for the next event it will be already in the list of your participants ( will contain only name ). In that way, all of the partisipant will have some unique identifier and it will be quite easy to count them 

https://processwire.com/api/ref/wire-array/unique/

  • Like 1
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...