- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Sep 16, 2024 03:08 PM
Hi guys,
Hey, guys,
Please help me solve a problem - I have a table of tennis matches, which has fields Player 1 and Player 2, which are linked to another table Players. In the matches table next to the Player 1 and Player 2 fields, I want to add a single select field Winner, which will have only 2 values: Player 1 or Player 2.
Is there a formula that will allow me to create a single select from the values of the neighboring fields?
Thanks.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Sep 16, 2024 03:48 PM
Hello!
You don't need a formula to make this work actually. Assuming you have an identifier, username or fullname in your player records:
- Go to your Matches table.
- Add two Lookup columns.
- Set the Source of each lookup to Player 1 and Player 2.
- Set the Field Lookup to your Id/username/fullname.
- Now add your Winner column with Linked Record type.
- Enable Filter record selection by a condition.
- Set two conditions with the following sentence: Where [Username] is [Lookup from Player 1] or [Username] is [Lookup from Player 2]. To enable the selection of lookups, click on the gear icon next to each condition and click Dynamic Condition.
- Click Save.
Here are some screenshots for the configuration of the lookup fields:
The Matches table:
The Winner field configuration:
Final output:
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Sep 16, 2024 06:28 PM
I don't think creating a single select via a formula like that is possible I'm afraid, and I think the best we can do is something like this:
SWITCH(
Winner,
"Player 1" , {Player 1},
"Player 2", {Player 2}
)
---
@EvreuxPendragonthat's a really neat solution!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Sep 16, 2024 03:48 PM
Hello!
You don't need a formula to make this work actually. Assuming you have an identifier, username or fullname in your player records:
- Go to your Matches table.
- Add two Lookup columns.
- Set the Source of each lookup to Player 1 and Player 2.
- Set the Field Lookup to your Id/username/fullname.
- Now add your Winner column with Linked Record type.
- Enable Filter record selection by a condition.
- Set two conditions with the following sentence: Where [Username] is [Lookup from Player 1] or [Username] is [Lookup from Player 2]. To enable the selection of lookups, click on the gear icon next to each condition and click Dynamic Condition.
- Click Save.
Here are some screenshots for the configuration of the lookup fields:
The Matches table:
The Winner field configuration:
Final output:
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Sep 16, 2024 06:28 PM
I don't think creating a single select via a formula like that is possible I'm afraid, and I think the best we can do is something like this:
SWITCH(
Winner,
"Player 1" , {Player 1},
"Player 2", {Player 2}
)
---
@EvreuxPendragonthat's a really neat solution!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Sep 17, 2024 12:49 AM
Thank you all guys,
You've been a big help. I'm just surprised I didn't think of this solution myself 😊
