How to generate statistics per team when teamname is included in 2 attributes (team home/away)?

Mike0985Mike0985 Member Posts: 9 Contributor I
edited June 2021 in Help
Dear all,

First of all, I am a very beginner. I tried to apply an aggregate operator (see attached screenshots) as well as a pivot operator to get some statistics data at the end of the process, especially for visualizations but I do not get the target (see my prepared target table "Template_NBA_Team_Statistics_Data").

Based on the data "NBA_GAMES_ADJUSTED" I want to create statistics per each team of the eastern and western conference , e.g. MIN, MAX, AVG and STANDARD DEV for points, field goal pct, free throw pct and three point pct (e.g. "points" relevant attributes = "Punktzahl_Gast" and "Punktzahl_Heim") as well as the count of winner and loser (attribut "Heimmannschaft_Gewinner/Verlierer").

I guess the aggregator and pivot operator are not able to handle the following issue. Each team can be "team home" (currently translated as "Teamname_Heim2") and "team away" (currently translated as "Teamname_Gast2") so that I have the same team on each side. "Points" as an example. Points for team home and team away are currently translated as "Punktzahl_Heim" (points for team home) and "Punktzahl_Gast" (points for team away).

How can I aggregate the two attributes "Punktzahl_Heim" (points for team home) and "Punktzahl_Gast" (points for team away) in one attribute (maybe called "points") for each team or rather for the relevant team to apply on this attribute "MIN", "MAX", "AVG" and "STANDARD DEV"?

I have no clue how to handle this issue but I would be very happy to get a solution and to do some comparisons and visualizations at the end of the process based on those target statistics.

Thank you in advance.


Best Answer

  • Options
    kaymankayman Member Posts: 662 Unicorn
    Solution Accepted
    What about this approach : Your content contains 2 sets, either home (heim) or away (gast) data, so you can split this by using the select attribute and filtering with regex on either gast and heim. Now you have the data split in 2 subsets, you rename the attributes in both sub sets by removing either _heim or _gast so all attribute names are the same (you're lucky :-)) and then you just append them together. 

    Now you can run your statistics as I think you need them. Attached process shows this in hig level.
Sign In or Register to comment.