First, In your Match Results view, add a Global: Custom text field and just leave it blank/empty. (we will use this field to print the outcome)
You can override the view's display through your themes template file.
Go to sites/all/themes/YOURTHEME/ look for template.php and open it. You probably have other code inside there, so make extra space by hitting enter at the bottom and add the following code.
function YOURTHEME_preprocess_views_view_fields($vars){ if ($vars['view']->name == "VIEWNAME" && $vars['view']->current_display == "DISPLAY" && $vars['fields']['field_score1']->raw > $vars['fields']['field_score2']->raw){ $vars['fields']['nothing']->content = print 'Win'; } else if ($vars['view']->name == "VIEWNAME" && $vars['view']->current_display == "DISPLAY" && $vars['fields']['field_score1']->raw < $vars['fields']['field_score2']->raw){ $vars['fields']['nothing']->content = print 'Loss'; } else if ($vars['view']->name == "VIEWNAME" && $vars['view']->current_display == "DISPLAY" && $vars['fields']['field_score1']->raw == $vars['fields']['field_score2']->raw){ $vars['fields']['nothing']->content = print 'Draw'; } }
Replace YOURTHEME with your actual theme name
Replace VIEWNAME with your view machine name. (example: match_results)
Replace DISPLAY with your display machine name. (example: block, block_1 ) You can find the name by looking at your view. (see picture below). If you're using the Master view, then the machine name is "default"
.jpg