I have a table that shows games - for example:
Dallas vs Phil
In my table - it has each player position (QB, RB, WR, etcโฆ). However, in my table it will show:
Dal Vs Phil and
Phil vs Dal
How can i combine these rows? I want all Dallas vs Phil players to show up when the user clicks on that game (see below):
Clarifying question;
Do these game entries capture information for actual games that have occurred, or are they hypothetical matchups for which the player lineup would never change?
These are games upcoming. I will enter the upcoming games Each week manually. But my issue is the data comes with - Team vs Opp. and Opp vs Team. I need to combine the two alike games:
Dal Vs Phil ----is the same game as
Phil vs Dal
To clarify - i am trying to build an app to use for fantasy football. Using salaries, points and values.
See this post - i posted as well:
So - i will update the data table week to week. But i want the app to do the same thing. I want the user to be able to:
Choose a game they would like to pick players from.
Choose the player(s) from that game (s)
Create their final lineup ( also there are limitations to amount of players chosen and duplications - for example: you can ONLY choose one QB)
Why are you displaying both A vs B and B vs A? It would seem the easy fix is to only show one or the other, not both.
Yes - you are right. However when you get data - from games going on this week you get ALL games. With that you get all players. Example:
Matt Ryan (QB) plays for Atl. So it shows:
Atl Vs Jac
In that same game Gardner Minshew (QB) plays and it shows:
Jac Vs Atl.
Soโฆ my table shows per player - NOT per game. I need to show all players- but at the same time group the games together first inside the app (Matt Ryan and Gardner play in the same game - but it doesnt look like it when you look at my table)
So to clarify:
My table is showing ALL players this weekend. In the table it shows columns of information per player. I need all of that info to build my app. But, I want inside the app to be able to FIRST chose the game (matchup) then choose your players to form your lineupโฆ
It sounds like to me, youโll be needing multiple tables. Matchups to hold just the data about the game (home team, away team, date, and start time at the least). Players to hold all the player data (relevant stat columns, current team). Lineup to store your choices for your lineup.
Players[Current Team] should be a Ref column to Matchups for Home Team and Away Team. Those two columns should Valid If of AND(Players[Current Team], NOT([_THISROW].[Away Team]))
for Home Team and AND(Players[Current Team], NOT([_THISROW].[Home Team]))
for Away team. I think those will work. Iโm freehanding this all as I go, by the way.
Now, youโre matchup table should generate reverse ref VC of related players for each game. The matchups will show only as you entered them. All you should really need to do from there is create an action that you can attach to the players info to add them to your Lineup. And since this seems Fantasy Football related, perhaps, add in whatever finishing details you need for your complete roster, like enforcing certain numbers of players.
Thanks - im gonna start building theseโฆ
Thanks again!
Current Team = Team
Away Team = OPP
I believe you are putting the Valid If on the wrong column. The Valid If would be in the new table where you enter the game details of who is playing. And the Opp column can be deleted. We wonโt need to use it anymore. Iโm kind of having you rewrite your whole structure, but itโll be easier to make it do what you are aiming for.
Ok. So I built the โMatchupโ Table:
Then the โPlayersโ Table:
The โLineupโ table is empty - Correct?
SoโฆIf my tables are correct - where do i put those valid if expressions? The Matchup table or the Players table?
My app now shows each row per player per the game:
But i just need the game shown once. Then i want to choose the game or games i want to bet on this week ---->>>> move ALL those players into the Lineup table by clicking on โPick your playerโ at the bottom.
For the Matchup Table, I would also add a Date and Start Time column. I wasnโt expecting you to try and prefill this table, so the Valid Ifs were for Team and Opp to ensure you only picked teams from the player list, and that you couldnโt enter the same team (ie. CAR vs CAR). I would still do this anyway to make it easy to update and continue into the future for adding games in additional years. Again this step is for when you are adding the games information itself. This will be the table for the โPick A Gameโ view. The date and time will be useful for filtering. Especially if you are adding every matchup for the year ahead of time.
In the Players table, you can delete Opp because we donโt use it anymore. Team here should be a Ref type column (base type Text) pointing to Matchups. Leave โIs a part ofโ unchecked. The reason Opp here is erroneous is because weโll already have the details of which team is playing which team in the Matchup table week by week, so there is no reason to duplicate it here. With team being a Ref this should generate a [Related Players] VC being generated back in the Matchup table but we might need to tweak itโฆmaybe. But that will allow you to only see players who will play in that game for you to add to your lineup. Weโll also be adding an action for this table to โAdd row to another table using values from this rowโ option to do the adding to your lineup, if you havenโt already done something similar.
I didnโt know you had a lineup table (Final Lineup) already, so it can probably be the same one depending on your goals. But yes, it should be blank until a user has started adding players to their lineup. In this table is where you could optionally set Valid Ifs to ensure the following of any FF rules (i.e. you can only field 1 QB, 2 WR, etcโฆ). You can delete the Games column here as well as Opp.
Lastly, to on your final view to only see games of players you have in your lineup, create a Slice called My Games based on the Matchups table with the filter condition OR(IN([Team], Lineup[Team]), IN([Opp], Lineup[Team]))
and set that as your source for the view you want for this function.
Wow. This is great. Let me make those corrections.
Thanks againโฆ
i put the valid if in the Matchup table attached to โTeamโ - same error
Oh, lol, I see the error. Iโm dumb as hell. Players[Team]-[_THISROW].[Opp]
for Team and Players[Team]-[_THISROW].[Team]
for Opp is all those should be I think.
As I said before, Iโm freehanding all of this and not logged into the editor to check these expressions.
It still isnt working correctly:
Players[Team]-LIST([_THISROW].[Opp])
Thanks. And just to be sure - i deleted the โOppโ Column from the Player Table. So I wont use the valid if for the โOppโ column in the โMatchupsโ table, correct?
That expression worked. However - when i click on the correct game ( I choose a game) - the โRelated Playersโ shows 0. In the โplayersโ table I referenced the [Team] column in the Matchups table, but it doesnt seem to be referencing itโฆ
Thoughts?
No thatโs good. I assumed the Related Players it would generate wouldnโt work and would need to be tweaked. I believe everything else is working the way it needs to. I need to get to a computer to guide you how to fix the Related Players column, so give me, about 45 min.
Thank you so muchโฆ
Alright, letโs edit that Related Players VC it created. And letโs try changing the expression to SELECT(Players[Key],OR([Team]=[_THISROW].[Team],[Team]=[_THISROW].[Opp]))
Sorry, that took longer than I expected.
ok - so put this expression in the โMatchupโ table, where:
Valid if
Show if
etcโฆ?
Ok - you are a genius. It seems to be working GREAT! I do notice something else. Can i have it group inside that โrelated Playersโ column?
I want to group by category:
QB
RB
WR
TE
etcโฆ
ORDERBY(SELECT(Players[Key],OR([Team]=[_THISROW].[Team],[Team]=[_THISROW].[Opp])), [Category])
OR
You can edit the system generated Inline view for Players to group and sort, I believe.
it did not create a Players inline view? Ithink that is giving me trouble with adding my button to move players into my final lineup.
As of now it:
Allows user to scroll through games this weekend and select one.
Once selected - shows ALL related Players
User can choose which player they want to add to โPlayer Poolโ ( i did this to allow the user to choose all players they want to select from without going through ALL players from all games)
Now the user can choose their FINAL player to add to their Final Lineup ( with limitations on number of positions choosen - i.e.
QB - 1
RB - 2
WR - 3
TE - 1
FLEX - 1
DEF - 1
Sometimes the system generated views donโt trigger or take a bit to show up. But you could also create your own to use. But thatโs not super important at this step.
Let me see the actions you have to accomplish moving to the Pool and then for moving to final lineup.
User | Count |
---|---|
41 | |
36 | |
30 | |
23 | |
16 |