Multiple Grouping distinct issue on the XSLT 2.0

Mahesh Madhusanka 216 Reputation points
2020-09-08T14:04:55.347+00:00

Hi Team,

This concern a Fully related to below Link post, Currently we are used "group-by="ArrivalEventdate" for a Group ArrivalEventdate wise, According to its worked for Unique - JS_UniqueConsignRef number, But With the multiple JS_UniqueConsignRef numbers its getting Dupplicated as a below, Could you please Guide to use a multiple grouping on this XSLT 2.

Current grouping on event
<Arrival>
<EventCount>
<xsl:copy-of select="ArrivalEventCount"/>
</EventCount>
<xsl:for-each-group group-by="ArrivalEventdate" select="/Booking/value">
<Line_No>
<xsl:copy-of select="position()"/>
</Line_No>
<xsl:copy-of select="ArrivalEventdate"/>
<xsl:copy-of select="ArrivalEventDetail"/>
</xsl:for-each-group>

https://learn.microsoft.com/en-us/answers/questions/87561/grouping-distinct-issue-on-the-xslt-20.html

Source XML-
23293-source-xml.xml

Current XSLT Map -

23177-single-js-uniqueconsignref-lmap.xml

Current wrong Output-
23139-image.png

Expected Output

<Event_Details>  
         <ArrivalCollection>  
            <Arrival>  
               <EventCount>  
                  <ArrivalEventCount>1</ArrivalEventCount>  
               </EventCount>  
               <EventRow>  
                  <Line_No>1</Line_No>  
                  <ArrivalEventdate>May 14 2020  8:26AM</ArrivalEventdate>  
                  <ArrivalEventDetail>Arrival  |  Rickenbacker  |  May 14 2020  8:26AM</ArrivalEventDetail>  
               </EventRow>  
            </Arrival>  
         </ArrivalCollection>  
         <CargoAvailableCollection>  
            <CargoAvailable>  
               <EventCount>  
                  <CargoAvailableEventCount>0</CargoAvailableEventCount>  
               </EventCount>  
               <EventRow>  
                  <Line_No>1</Line_No>  
                  <CargoAvailableEventdate/>  
                  <CargoAvailableEventDetail/>  
               </EventRow>  
            </CargoAvailable>  
         </CargoAvailableCollection>  
         <CutOffDateCollection>  
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,211 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yitzhak Khabinsky 25,956 Reputation points
    2020-09-08T16:00:41.02+00:00

    Hi Mahesh,

    You need to modify second nested group as follows:

    <xsl:for-each-group group-by="ArrivalEventdate" select="current-group()">


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.