I have a sharepoint 2010 list with a column "proposalID". The values in that column are 5555-01, 5555-02, 5555-03, 6666-01, 6666-02, etc.
I want to group by the 4 characters to the left of the dash. So the grouping would display 3 items under 5555 and 2 items under the group 6666, etc.
Using Sharepoint Designer 2010, I added a blank dataview webpart, connected to my list, and from the ribbon chose to sort by the Proposal ID column. It rendered the below xsl ddwrt code:
I've been trying various syntax to change the string function but have not been successful. I tried to glean some knowledge from this posting, http://jamestsai.net/Blog/post/SharePoint-Data-View-Data-Form-Web-Part-Group-items-by-month-on-DateTime-field.aspx - but was not able to apply the string syntax to my case.
Could someone suggest how I can accomplish this grouping? Thank you in advance.
<xsl:choose>
<xsl:when test="not ($dvt_groupfield)">
<xsl:value-of select="ddwrt:NameChanged(string(@ProposalID), 0)" />
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>