Alphabetical case insensitive grouping of results
To group all of your results by Last initial, capitalized:
First, under Format &gt; Settings &gt; Grouping field X, make sure you check the box to &quot;Use rendered output to group rows&quot;.
Second, update the field settings for the field you're using to group the results - under Rewrite Results, check &quot;Trim this field to a maximum number of characters,&quot; and enter 1 for the length.
Finally, again under Rewrite Results, check the box to &quot;Override the output of this field with custom text&quot;. You can use twig in the custom text field and leverage twig's upper filter to convert the entire string to uppercase. You'll have to check the Replacement Patterns for the correct field name to use in your case, but the end result should look something like:
{{ field_last_name|upper }}

The result is your view results grouped by last initial, capitalized (whether they actually start with a capital letter or not).