mergeDucplicates is a powerful feature when used properly alongwith mergeFunctionName. we can use it to Group rows of information with the same values. That information can be text (by Using getText), images ((by Using getSrc) or formattedText (getHtmlText). But this can also be used to conditionally group items with the same value. For ex. if you want to merge names of the people with the same pernr.
Here is a plunkr for merging suppliers with the same category.
Not all the "Red Point Stores" are merged. and also the "Titanium" entries are not merged too as they belong to a different categoty. Where as "Technocom" and some of the "Red Point Stores" are merged.