Connecting Two Parts of My App

Hello, I'm currently working on an app for my programming teacher and am very close (I think?) to wrapping up the seasons and games section. The app is a soccer statistics app that allows you to create seasons where you can add games from a database to that particular season. What I'm struggling with is linking the code my teacher previously had that allowed him to document the actions of certain players for any particular game. The code that I created/stole is taken straight from the Ultimate Scorekeeper app and works as anticipated. Here is a screenshot to give you the general idea for the code in this part

Here is the remnants of the necessary code that I need to work into the part I've already manipulated to attach extra information to each game in the list of games.
If there is anyway I can make the tags and lists of these equal to each other to make it display information that would be great. I just don't understand the practicality of this and it's all well above my pay grade to be frank. If someone has any help to offer I would appreciate it tremendously! The aia file is also here if anyone is generous enough to take it straight on and try and help me out. I'm at my wits end and am extremely over this project. SoccerStatsAppPotentiallyFixedHalftime.aia (54.3 KB)

Can you show us what your teacher gave you, alone?
Also include your teacher's requirements for reports.

Yeah here's the aia file of his code stats_app_6_30_roster_vis_wnotes_timer2 (1).aia (48.5 KB) Here's the bulk of the code he has written on this file

Oh I forgot to add a couple important blocks

So, basically what he wants to be able to show is out of the list of actions he has created,

to be able to click on a game and view what players did these certain actions at the exact point in the game that it had happened.

I know absolutely nothing about soccer, so I have to ask ...

Do different actions involve different number of players, like
"ABG makes an incomplete pass to Alexander_Porter" ?

That affects how the actions are stored and linked.

Your code is made harder to understand when parts have not been named to show their contents and purpose:


You can(and should) rename them in the Designer.

Also, I see two different uses being made of a global variable, based on the residual Do It value shown here ...

This variable, gameList has an unfortunate ambiguous name choice.
Is it a list of games, or is it a list of actions that occured within a single game or multiple games?
Worse, it is a table mixing two different types of rows describing different things (game vs event in game.)

If you need to store different categories of information, and if you plan on summarizing and filtering information for reports, save them in separate tables or add extra columns to your detail event tables identifying the game, game start, and half of each event.
This is called flattening a table.

You can also keep separate tables, appropriately named, like

  • games (identifying games and their start times)
  • game events (listing the events that occured within the game IDentifiers in column 1)

Investigate TinyDB NameSpaces as a way to use the power of different TinyDB instances.

I also question the use of a Notifier to choose the half (first/second) of new events.
If I understand the progression of time, all the events of the first half of a game happen before all thevents of the second half of a game, so there is no need to ask for the half over and over again.
Just leave it in a List Picker (lpkHalf) and set its .Text to the current half (first/second), for inclusion into new events when you click a Save Event button.

I wrote that sample app.

The data storage organization is too dissimilar to your teachers' table based setup to be of any value, aside from the idea of hiding and showing Arrangements instead of screens.

Here is a sample table based filter app you can study, with powerful value procedures you can call and string together in pipelines to collect and summarize data.

(Though your teacher already gave you nice custom made code for that in two list picker events.)

No we only need one person attached to each action so the one making the pass would be the culprit.

Yeah these are all valid questions I'll have to check in with my teacher on exactly what he wants, but I reckon what you've suggested is what we need.

This is Alexander's teacher....he is such a great student and shared the link with me. Now that school has ended today trying to help finalize this for my upcoming high school season. What we are looking for:

  1. Have seasons (2021, 2022) and so on for each season that I would have for our team. It all be saved locally so can be pulled up from the tablet or created as a report at end of each season in any format (that seems tougher)

  2. Within each season would like the ability to have individual games in which stats can be tracked as the game happens. Would click each zone on the field as an event happens. For example player 1 shoots in zone 1 I would click zone 1 and record shot the player and shot from list pickers.

  3. When the game is over I would like to take each stat and have it store only in the game so I can pull a report at the end per game of the season to see how we did as a team and each player individually.

  4. If possible, I have also tried to add where I could get a season summary of stats per player. Player A had 4 goals, 12 shots, 4 giveways in 2021, etc.

  5. The half is really only used (doesn't have to be) to see how we did each part of the game. At halftime I could tell players he is what we did in 1st half and at end of game could compare our improvement in shots allowed or goals scored kind of deal. Right now I do all this by hand with a few coaches.

We combined so much code I think it became really complicated and confusing for us to be honest. Just looking for some expert guidance in how to simplify and not over complicate like I did.

Any guidance or help in fixing would be a game changer! Hope this makes sense?

Thanks for the help. You guys are great!

The data for this app fits into a single table with these columns, in major-minor order:

  • season
  • game
  • game team 1 name
  • game team 2 name
  • game start time
  • half
  • team of player doing action
  • action
  • action time
  • action zone (1-9)
  • action player
  • action points (+/-) - I don't know soccer, so this is a guess.

Each attribute of an action could be shown in a TextBox.Text, Label.Text , a ListPicker.Text (appropriately named), ready for use by the Click event of a Save Event button.

Saving the event would be accomplished by

  • retrieve TinyDB tag EVENTS (I assume one big table to allow stats across seasons)
    (initially an empty list if not found)
  • add a row consisting of the aforementioned column values as items of a list
  • save the updated table under tag EVENTS.

Basically, this could be done as a spreadsheet or a SQL table.

I have table filters and a GROUPED_SUM procedure handy for reports, similar to SQL SUM Group By clauses...

select_where_equijoin.aia (12.8 KB)

The images without bubbles should be draggable directly into projects.

Here is a general purpose table filter app you can try to sum and filter tables with header rows ...