The mapping function GroupByExSorted() sorts the grouped result by (Key's). There are up to 6 key fields possible.
GroupByExSorted('Node', 'Key1', 'Key2', 'Key3', ..., 'Key6')
GroupByExSorted('Node', 'Attribut1', 'Attribut2', 'Attribut3')
GroupByExSorted('//IndustryItems', 'FormatNumber(@PosNumber, "0000000")').
GroupByExSorted(/InventoryReport/Items, "@Ean")
GroupByExSorted(//LIN, "../PIA/*[@DE_7143='GU']/@DE_7140")
GroupByExSorted(//SG_33, "PIA/*[@DE_7143='GU']/@DE_7140")
GroupByExSorted(//LIN, "GetArticleDetailsByEAN(DG_212/@DE_7140)/Detail/@Color")
GroupByExSorted(//Groups,"CustomItem[@Key='EK_Department']/@Value")
GroupByExSorted(//SG_7,"PIA[@DE_4347='1']/DG_C212[@DE_7143='LN']/@DE_7140")
GroupByExSorted(//SG_5/SG_7,"../LOC/DG_C517/@DE_3225","../DTM/DG_C507[@DE_2005='356' and @DE_2379='102']/@DE_2380","PIA[@DE_4347='1']/DG_C212[@DE_7143='LN']/@DE_7140")
The keys therefore contain:
GroupByExSorted(//SG_5/SG_7,"../LOC/DG_C517/@DE_3225","../DTM/DG_C507[@DE_2005='356' and @DE_2379='102']/@DE_2380","RFF/DG_C506[@DE_1153 = 'SB']/@DE_1154")
The keys therefore contain:
In special cases it may be necessary to sort 5) before the actual grouping. This can be done by nesting the function. Note that the path /Items is appended to the nested grouping function 6).
GroupByExSorted(GroupByExSorted(/TradeItemDocument/TradeItems,' @ArticleNo',' @Color',' @Size')/Items,' @ArticleNo',' @Color')
In this example, the incoming items are sorted and grouped according to article number, color and size, and then only sorted and grouped according to article number and color, so that the sizes within a target record can be iterated in ascending order.
<TradeItems OfferNo="0" SupArtNo="1-1-25316-21" SupColNo="001" ArtDesc="Woms Boots" ColDesc="BLACK" SupplierPhotoName="0012531621001.JPG "SupplierModel=" Lycoris "SupplierGender=" Women "SupplierBrand=" TAMARIS "SupplierCollCode=" W "SupplierCollYear=" 18 "IntrasNo=" 2 "SupplierCOO=" CN "SupplierUppMat=" IMI SUEDE "SupplierSolMat=" synthetic "SupplierLinMat=" Lining=Polyester SizeDesc1="36" Barcode1="4059252686483" RetailPrice1="59.95" SizeDesc2="37" Barcode2="4059252686490" RetailPrice2="59.95" SizeDesc3="38" Barcode3="4059252686506" RetailPrice3="59.95" SizeDesc4="39" Barcode4="4059252686513" RetailPrice4="59.95" SizeDesc5="40" Barcode5="4059252686520" RetailPrice5="59.95" SizeDesc6="41" Barcode6="4059252686544" RetailPrice6="59.95" SizeDesc7="35" Barcode7="4059252766758" RetailPrice7="59.95" SizeDesc8="42" Barcode8="4059252686575" RetailPrice8="59.95" />
<TradeItems OfferNo="0" SupArtNo="1-1-25316-21" SupColNo="001" ArtDesc="Woms Boots" ColDesc="BLACK" SupplierPhotoName="0012531621001.JPG "SupplierModel=" Lycoris "SupplierGender=" Women "SupplierBrand=" TAMARIS "SupplierCollCode=" W "SupplierCollYear=" 18 "IntrasNo=" 2 "SupplierCOO=" CN "SupplierUppMat=" IMI SUEDE "SupplierSolMat=" synthetic "SupplierLinMat=" Lining=Polyester SizeDesc1="35" Barcode7="4059252766758" RetailPrice7="59.95" SizeDesc2="36" Barcode1="4059252686483" RetailPrice1="59.95" SizeDesc3="37" Barcode2="4059252686490" RetailPrice2="59.95" SizeDesc4="38" Barcode3="4059252686506" RetailPrice3="59.95" SizeDesc5="39" Barcode4="4059252686513" RetailPrice4="59.95" SizeDesc6="40" Barcode5="4059252686520" RetailPrice5="59.95" SizeDesc7="41" Barcode6="4059252686544" RetailPrice6="59.95" SizeDesc8="42" Barcode8="4059252686575" RetailPrice8="59.95" />