How to show concatenate and combine two options?

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):

0 27 2,214
27 REPLIES 27

Hayden
New Member

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)

Steve
Platinum 4
Platinum 4

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

Bahbus
New Member

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?

Bahbus
New Member

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.

Top Labels in this Space