0

Champions count and sum

Team Table (36 records): I have  "Team ID" and "Team Name", PJ, PG, PP, GG GC.

Match Table (144 records): This table I have the following fields:

"Home Team" (related to the Team table).

"Away Team" (related to the Team table).

"Match Status" (indicating whether the match is finished or not).

How can I do to count the total games by team, and sum the goals for and against.

10 Antworten

null
    • pma_mgmt
    • vor 4 MonatenThu, September 12, 2024 at 3:36 AM UTC
    • Gemeldet - anzeigen

    How about 4 formula fields?

    Lets assume in Team you have the relation "Home" and "Away" towards the "Match" Table then you can go with

    cnt(Home) or cnt(Away) to count the number of games and sum(Home.Goalfor) and sum(Away.Goalagainst) 

    Does that work for you?

      • Rafael_Sanchis
      • vor 4 MonatenThu, September 12, 2024 at 10:23 AM UTC
      • Gemeldet - anzeigen

       sorry

    • Rafael_Sanchis
    • vor 4 MonatenThu, September 12, 2024 at 9:28 AM UTC
    • Gemeldet - anzeigen

    Hi Peter.

    I have relationship between the Teams (Eqipos) to Match (Partidos).

    But I miss somethig.

      • Kruna
      • vor 4 MonatenThu, September 12, 2024 at 11:03 AM UTC
      • Gemeldet - anzeigen

      I think I managed the goal and point issue (hopefully) - now the number of games is still missing. pls take a look -

      • pma_mgmt
      • vor 4 MonatenThu, September 12, 2024 at 11:39 AM UTC
      • Gemeldet - anzeigen

         let me := this;
      cnt('<_Partidos1'.'Equipo Local_>' = me) +
      cnt('<_Partidos1'.'Equipo Visitante_>' = me)

       

      ?

      • Kruna
      • vor 4 MonatenThu, September 12, 2024 at 11:49 AM UTC
      • Gemeldet - anzeigen

      nope😅 I am  there too with me and count - also with select where but no way. I'll have to try out other possibilities....🤔

    • Kruna
    • vor 4 MonatenThu, September 12, 2024 at 12:05 PM UTC
    • Gemeldet - anzeigen

    maybe this

    cnt('<_Partidos1'.'Ptos L') + cnt('<_Partidos2'.'Ptos V')

    will do it?

    Saludos

      • Rafael_Sanchis
      • vor 4 MonatenThu, September 12, 2024 at 12:25 PM UTC
      • Gemeldet - anzeigen

       

      sum('<_Partidos1'.'Ptos L') + sum('<_Partidos2'.'Ptos V')

      This Works, sum each games points.

      • Kruna
      • vor 4 MonatenThu, September 12, 2024 at 12:53 PM UTC
      • Gemeldet - anzeigen

      I am glad that it works. 👍The other formulas should work too.

    • Rafael_Sanchis
    • vor 4 MonatenThu, September 12, 2024 at 1:21 PM UTC
    • Gemeldet - anzeigen

     Thanks