0

Updating this post with new information. I am enclosing the entire XSLT as it is fairly complicated and I am not entirely sure what to withhold to maintain the integrity and cause of the issue. Also, I am going to include the input which I have minimized as much as I could to also maintain integrity of the data. What I am not including is the xsd of the EDI X12 856. this is proprietary and it is also very large. If you are using Biztalk EDI, you already have the schema necessary. If there is information I can provide from this schema that will help answer this question please let me know and I will post anything you need. And if there is somewhere I can put the .xsd like a repository or email, let me know.

The problem is I am trying to reach out to the LIN/LIN11 element and put the contents in the DTM02 element for each iteration. I am either missing syntax to do this or I may need some global variable to spin through the instances. But really new to XSLT and its processing. Could really use some direction and a solution would be great.

<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                xmlns:msxsl="urn:schemas-microsoft-com:xslt" 
                xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" 
                exclude-result-prefixes="msxsl var ScriptNS0 userCSharp" 
                version="1.0" 
                xmlns:ns0="http://schemas.microsoft.com/BizTalk/EDI/X12/2006" 
                xmlns:ScriptNS0="http://schemas.microsoft.com/BizTalk/2003/ScriptNS0" 
                xmlns:userCSharp="http://schemas.microsoft.com/BizTalk/2003/userCSharp">
  <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
  <xsl:template match="/">
    <xsl:apply-templates select="/ns0:X12_00401_856" />
  </xsl:template>
  <xsl:template match="/ns0:X12_00401_856">
    <xsl:variable name="var:BSN05" select="userCSharp:StringConcat(&quot;0001&quot;)" />
    <xsl:if test="userCSharp:InistrLastPackID()" />
    <xsl:variable name="var:OrderNo" select="ns0:HLLoop1[ns0:HL/HL03='O']/ns0:PRF/PRF01" />
    <xsl:variable name="var:PurchaseOrderNo" select="ns0:HLLoop1[ns0:HL/HL03='O']/ns0:PRF/PRF06" />
    <ns0:X12_00401_856>
      <ns0:BSN>
        <BSN01>
          <xsl:text>00</xsl:text>
        </BSN01>
        <BSN02>
          <xsl:value-of select="ns0:BSN/BSN02/text()" />
        </BSN02>
        <xsl:variable name="var:v1" select="ScriptNS0:GetEDIDate(string(ns0:BSN/BSN03/text()))" />
        <xsl:variable name="var:v2" select="userCSharp:LogicalNe(string($var:v1) , &quot;&quot;)" />
        <xsl:if test="string($var:v2)='true'">
          <xsl:variable name="var:v3" select="ns0:BSN/BSN03/text()" />
          <BSN03>
            <xsl:value-of select="$var:v3" />
          </BSN03>
        </xsl:if>
        <BSN04>
          <xsl:value-of select="ns0:BSN/BSN04/text()" />
        </BSN04>
        <BSN05>
          <xsl:value-of select="$var:BSN05" />
        </BSN05>
      </ns0:BSN>

        <!--Inital the strLastPackID in the begining of the template-->
        <!--Shipment-->
        <xsl:element name="ns0:HLLoop1">
            <xsl:variable name="var:ShipmentHLLoop1" select="ns0:HLLoop1[ns0:HL/HL03='S']" />
            <xsl:element name="ns0:HL">
                <xsl:element name="HL01">
                    <xsl:value-of select="userCSharp:ReturnHL01('S')" />
                </xsl:element>
                <xsl:element name="HL03">S</xsl:element>
            </xsl:element>

            <xsl:variable name="var:v35" select="userCSharp:StringConcat('BM')" />
            <xsl:variable name="var:v36" select="userCSharp:StringConcat('5774125')" />
            <xsl:variable name="var:v37" select="userCSharp:StringConcat('SN')" />
            <xsl:variable name="var:v38" select="userCSharp:StringConcat('IA')" />
            <xsl:variable name="var:v40" select="$var:v35" />
            <xsl:variable name="var:v41" select="$var:v36" />
            <xsl:variable name="var:v42" select="$var:v37" />
            <xsl:variable name="var:v43" select="ns0:TD3/TD303/text()" />
            <xsl:variable name="var:v44" select="$var:v38" />
            <xsl:variable name="var:v46" select="ScriptNS0:GetRollaShipmentByOrderNo(string($var:OrderNo/text()))" />
            <xsl:variable name="var:v47" select="ScriptNS0:PullElementAfterQualifier('VehID', string($var:v46))" />

            <!--Ship To-->
            <xsl:element name="ns0:N1Loop1">
                <xsl:variable name="var:STN1Loop1" select="$var:ShipmentHLLoop1/ns0:N1Loop1[ns0:N1/N101='ST']" />

                <xsl:element name="ns0:N1">
                    <xsl:element name="N101">ST</xsl:element>
                    <xsl:element name="N102">
                        <xsl:value-of select="$var:STN1Loop1/ns0:N1/N102" />
                    </xsl:element>
                    <xsl:element name="N103">92</xsl:element>
                    <xsl:element name="N104">
                        <xsl:value-of select="$var:STN1Loop1/ns0:N1/N104" />
                    </xsl:element>
                </xsl:element>
                <!--End of N1-->
            </xsl:element>

            <!--End of N1Loop1-->

        </xsl:element>
        <!--End of HLLoop1-->
        <!--Order-->
        <xsl:element name="ns0:HLLoop1">
            <xsl:element name="ns0:HL">
                <xsl:element name="HL01">
                    <xsl:value-of select="userCSharp:ReturnHL01('O')" />
                </xsl:element>
                <xsl:element name="HL02">
                    <xsl:value-of select="userCSharp:ReturnHL02('S')" />
                </xsl:element>
                <xsl:element name="HL03">O</xsl:element>
            </xsl:element>
            <!--End HL-->

            <xsl:element name="ns0:PRF">
                <xsl:element name="PRF01">
                    <xsl:value-of select="$var:PurchaseOrderNo" />
                </xsl:element>
            </xsl:element>
            <!--End PRF-->

        </xsl:element>
        <!--End HLLoop1-->

        <xsl:for-each select="ns0:HLLoop1">
            <!--don't include S or O levels-->
            <xsl:if test="ns0:HL/HL03 = 'T' or ns0:HL/HL03 = 'I'">
                <!--Pack-->
                <xsl:if test="ns0:HL/HL03 = 'T'">
                    <xsl:element name="ns0:HLLoop1">
                        <xsl:element name="ns0:HL">
                            <xsl:element name="HL01">
                                <xsl:value-of select="userCSharp:ReturnHL01('T')" />
                            </xsl:element>
                            <xsl:element name="HL02">
                                <xsl:value-of select="userCSharp:ReturnHL02('O')" />
                            </xsl:element>
                            <xsl:element name="HL03">T</xsl:element>
                        </xsl:element>
                        <xsl:element name="ns0:MAN">
                            <xsl:element name="MAN01">GM</xsl:element>
                            <xsl:element name="MAN02">
                <xsl:value-of select="ns0:MAN/MAN02" />
                            </xsl:element>
                        </xsl:element>
                        <!--End of MAN-->
            <xsl:element name="ns0:DTM_2">
              <xsl:element name="DTM01">036</xsl:element>
              <xsl:element name="DTM02">
                <xsl:value-of select="ns0:LIN/LIN11" />
              </xsl:element>
            </xsl:element>
          </xsl:element>
                    <!--End of HLLoop1 Pack-->
                </xsl:if>
                <!--Item-->
                <xsl:if test="ns0:HL/HL03 = 'I'">
                    <!--Item-->
                    <xsl:element name="ns0:HLLoop1">
                        <xsl:element name="ns0:HL">
                            <xsl:element name="HL01">
                                <xsl:value-of select="userCSharp:ReturnHL01('I')" />
                            </xsl:element>
                            <xsl:element name="HL02">
                                <xsl:value-of select="userCSharp:ReturnHL02('T')" />
                            </xsl:element>
                            <xsl:element name="HL03">I</xsl:element>
                        </xsl:element>
                        <xsl:element name="ns0:LIN">
                            <xsl:element name="LIN01">
                                <xsl:value-of select="ns0:LIN/LIN01 div 10000" />
                            </xsl:element>
                            <xsl:element name="LIN02">UP</xsl:element>
                            <xsl:element name="LIN03">
                                <xsl:value-of select="ns0:LIN/LIN03" />
                            </xsl:element>
            </xsl:element>
                        <!--End of LIN-->
                        <xsl:element name="SN1">
                            <xsl:element name="SN102">
                                <xsl:value-of select="ns0:SN1/SN102" />
                            </xsl:element>
                            <xsl:element name="SN103">EA</xsl:element>
                        </xsl:element>
                        <!--End of SN1-->
                    </xsl:element>
                    <!--End of HLLoop1 Item-->
                </xsl:if>
            </xsl:if>
        </xsl:for-each>
        <!--End of Pack/Item For Each-->
    </ns0:X12_00401_856>
  </xsl:template>
  <msxsl:script language="C#" implements-prefix="userCSharp">
    <![CDATA[
        int HL01 = 0;
        int ShipHL = 0;
        int OrdrHL = 0;
        int PackHL = 0;
        int ItemHL = 0;

        //This function increments the hl01 value then stores the value into the
        //appropriate "last" object variable.  It returns the value of hl01 to the 
        //XSLT script.
        public string ReturnHL01(string LevelCode)
        {
            HL01 += 1;
            if (LevelCode == "S")
                ShipHL = HL01;
            if (LevelCode == "O")
                OrdrHL = HL01;
            if (LevelCode == "P")
                PackHL = HL01;
            if (LevelCode == "I")
                ItemHL = HL01;
            return HL01.ToString();
        }
public string ReplaceMe(string str_Input)
{
return str_Input.Replace("-","");
}

        public string ReturnQTY(string str_Qty, string str_QtyPerUOM)
        {

                string[] strarrayQty = str_Qty.Split('.');
                string[] strarrayQtyPerUOM = str_QtyPerUOM.Split('.');

                str_Qty = strarrayQty[0];
                str_QtyPerUOM = strarrayQtyPerUOM[0];

                int int_Qty = Convert.ToInt32(str_Qty);
                int int_QtyPerUOM = Convert.ToInt32(str_QtyPerUOM);

                return (int_Qty * int_QtyPerUOM).ToString();
        }

        //This function returns the HL02
        public string ReturnHL02(string LevelCode)
        {
            int retlevel = 0;
            if (LevelCode == "S")
                retlevel = ShipHL;
            if (LevelCode == "O")
                retlevel = OrdrHL;
            if (LevelCode == "P")
                retlevel = PackHL;
            if (LevelCode == "I")
                retlevel = ItemHL;
            return retlevel.ToString();
        }

/*This Function used to check if the current pack is the same with previous pack,
if the pack is the same, then return string "1", if it is difference, then return "0" */

        string strLastPackID;

        public void InistrLastPackID()
        {
            strLastPackID = "";
        }

        public string CheckIfTheSamePack(string strCurrentPackID)
        {
            if (strLastPackID == strCurrentPackID)
            {
                return "1";
            }
            else
            {
                strLastPackID = strCurrentPackID;
                return "0";
            }
        }
        public string GetReleaseFromPORelease(string str_PO)
        {
            if (str_PO.Contains("_"))
            {
                string[] strarray_PO = str_PO.Split('_');
                return strarray_PO[1];
            }
            else
            {
                return str_PO;
            }
        }

        public string GetMars856STCode(string str_CustomerNumber, string str_STState)
        {
            string duns;
            if (str_CustomerNumber.Contains("NUTRO"))
            {
                switch (str_STState)
                {
                    case "CA":
                        duns = "007134919000Y";
                        break;
                    case "TN":
                        duns = "007134919000U";
                        break;
                    default:
                        duns = "BADDUNS";
                        break;
                }
                return duns;
            }
            else
            {
                switch (str_STState)
                {
                    case "CA":
                        duns = "0071349190097";
                        break;
                    case "GA":
                        duns = "0071349190031";
                        break;
                    case "TX":
                        duns = "0071349190079";
                        break;
                    case "SC":
                        duns = "0071349190096";
                        break;
                    case "OH":
                        duns = "0071349190041";
                        break;
                    default:
                        duns = "BADDUNS";
                        break;
                }
                return duns;
            }
        }


public string MathDivide(string val1, string val2)
{
    string retval = "";
    double d1 = 0;
    double d2 = 0;
    if (IsNumeric1(val1, ref d1) && IsNumeric1(val2, ref d2))
    {
        if (d2 != 0)
        {
            double ret = d1 / d2;
            retval = ret.ToString();
        }
    }
    return retval;
}
public bool IsNumeric1(string val)
{
    if (val == null)
    {
        return false;
    }
    double d = 0;
    return Double.TryParse(val, System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out d);
}
public bool IsNumeric1(string val, ref double d)
{
    if (val == null)
    {
        return false;
    }
    return Double.TryParse(val, System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out d);
}


public string StringConcat(string param0)
{
   return param0;
}


public bool LogicalNe(string val1, string val2)
{
    bool ret = false;
    double d1 = 0;
    double d2 = 0;
    if (IsNumeric(val1, ref d1) && IsNumeric(val2, ref d2))
    {
        ret = d1 != d2;
    }
    else
    {
        ret = String.Compare(val1, val2, StringComparison.Ordinal) != 0;
    }
    return ret;
}


public bool IsNumeric(string val)
{
    if (val == null)
    {
        return false;
    }
    double d = 0;
    return Double.TryParse(val, System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out d);
}

public bool IsNumeric(string val, ref double d)
{
    if (val == null)
    {
        return false;
    }
    return Double.TryParse(val, System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out d);
}

public string GetExpirationDate(string str_Mfg_Date, string str_Shelf_Life)
        {
            DateTime dt = System.Convert.ToDateTime(str_Mfg_Date);
            dt = dt.AddDays(System.Convert.ToInt32(str_Shelf_Life));

            return dt.ToString("yyyyMMdd");

        }

]]></msxsl:script>

</xsl:stylesheet>

input data:

<?xml version="1.0" encoding="utf-8"?>
<ns0:X12_00401_856 xmlns:ns0="http://schemas.microsoft.com/BizTalk/EDI/X12/2006">
    <ST>
        <ST01>856</ST01>
        <ST02>0001</ST02>
    </ST>
    <ns0:BSN>
        <BSN01>00</BSN01>
        <BSN02>SID0000378</BSN02>
        <BSN03>20160824</BSN03>
        <BSN04>172952</BSN04>
        <BSN05>0001</BSN05>
    </ns0:BSN>
    <ns0:HLLoop1>
        <ns0:HL>
            <HL01>1</HL01>
            <HL03>S</HL03>
        </ns0:HL>
        <ns0:TD1>
            <TD101>PLT94</TD101>
            <TD102>4</TD102>
            <TD106>G</TD106>
            <TD107>52448.00</TD107>
            <TD108>LB</TD108>
        </ns0:TD1>
        <ns0:TD5>
            <TD502>2</TD502>
            <TD503>ANSH</TD503>
            <TD504>M</TD504>
        </ns0:TD5>
        <ns0:TD3>
            <TD301>TL</TD301>
            <TD309>TRL0000590</TD309>
        </ns0:TD3>
        <ns0:REF>
            <REF01>SN</REF01>
            <REF02>SEAL082401</REF02>
        </ns0:REF>
        <ns0:REF>
            <REF01>BM</REF01>
            <REF02>10401217</REF02>
        </ns0:REF>
        <ns0:DTM_2>
            <DTM01>011</DTM01>
            <DTM02>20160819</DTM02>
        </ns0:DTM_2>
        <ns0:N1Loop1>
            <ns0:N1>
                <N101>SF</N101>
                <N102>any name</N102>
                <N103>92</N103>
                <N104>61</N104>
            </ns0:N1>
            <ns0:N3>
                <N301>101 Your WAY</N301>
            </ns0:N3>
            <ns0:N4>
                <N401>Irvine</N401>
                <N402>CA</N402>
                <N403>91111</N403>
                <N404>USA</N404>
            </ns0:N4>
        </ns0:N1Loop1>
        <ns0:N1Loop1>
            <ns0:N1>
                <N101>ST</N101>
                <N102>0010</N102>
                <N103>92</N103>
                <N104>0010</N104>
            </ns0:N1>
            <ns0:N3>
                <N301>1234 My Way Ct</N301>
            </ns0:N3>
            <ns0:N4>
                <N401>GROVEPORT</N401>
                <N402>OH</N402>
                <N403>43125</N403>
                <N404>USA</N404>
            </ns0:N4>
        </ns0:N1Loop1>
    </ns0:HLLoop1>
    <ns0:HLLoop1>
        <ns0:HL>
            <HL01>2</HL01>
            <HL03>O</HL03>
        </ns0:HL>
        <ns0:PRF>
            <PRF01>10401217</PRF01>
            <PRF04>20160822</PRF04>
            <PRF06>10401217</PRF06>
            <PRF07>KN</PRF07>
        </ns0:PRF>
    </ns0:HLLoop1>
    <ns0:HLLoop1>
        <ns0:HL>
            <HL01>3</HL01>
            <HL03>T</HL03>
        </ns0:HL>
        <ns0:MAN>
            <MAN01>GM</MAN01>
            <MAN02>L000000000T5</MAN02>
        </ns0:MAN>
    </ns0:HLLoop1>
    <ns0:HLLoop1>
        <ns0:HL>
            <HL01>4</HL01>
            <HL03>I</HL03>
        </ns0:HL>
        <ns0:LIN>
            <LIN01>20000</LIN01>
            <LIN02>UP</LIN02>
            <LIN03>030111169051</LIN03>
            <LIN04>VN</LIN04>
            <LIN05>416905</LIN05>
            <LIN10>RU</LIN10>
            <LIN11>20180614</LIN11>
        </ns0:LIN>
        <ns0:SN1>
            <SN102>32</SN102>
            <SN103>EA</SN103>
        </ns0:SN1>
    </ns0:HLLoop1>
    <ns0:HLLoop1>
        <ns0:HL>
            <HL01>5</HL01>
            <HL03>T</HL03>
        </ns0:HL>
        <ns0:MAN>
            <MAN01>GM</MAN01>
            <MAN02>L000000000T6</MAN02>
        </ns0:MAN>
    </ns0:HLLoop1>
    <ns0:HLLoop1>
        <ns0:HL>
            <HL01>6</HL01>
            <HL03>I</HL03>
        </ns0:HL>
        <ns0:LIN>
            <LIN01>20000</LIN01>
            <LIN02>UP</LIN02>
            <LIN03>030111169051</LIN03>
            <LIN04>VN</LIN04>
            <LIN05>416905</LIN05>
            <LIN10>RU</LIN10>
            <LIN11>20180614</LIN11>
        </ns0:LIN>
        <ns0:SN1>
            <SN102>32</SN102>
            <SN103>EA</SN103>
        </ns0:SN1>
    </ns0:HLLoop1>
    <ns0:CTT>
        <CTT01>6</CTT01>
    </ns0:CTT>
    <SE>
        <SE01>79</SE01>
        <SE02>0001</SE02>
    </SE>
</ns0:X12_00401_856>
Rylsngrd
  • 5
  • 3
  • 1
    Wild guess: `LIN11` is in the same namespace as `LIN` and so should be prefixed with the same namespace prefix: `ns0:LIN11`. If that's not right, please post a [mcve] so we can help you without guessing. Thanks. – kjhughes Aug 29 '16 at 20:49
  • 1
    We would need to see more of your XSLT code and perhaps schema/instance as well. – zurebe-pieter Aug 29 '16 at 22:27
  • Looking at your XSLT, the code the populates the `DTM02` element only gets performed when `ns0:HL/HL03 = 'T'`. But looking at your XML, in the cases where `HL03` does equal `T` there are no `LIN` elements under the relevant `ns0:HLLoop` elements. (The 3rd and 5th ones). – Tim C Aug 30 '16 at 08:17
  • You are using the Mapper, right? Meaning not all custom xslt? – Johns-305 Aug 30 '16 at 13:02
  • 1
    Also, while you didn't ask about this, you really, really should change the namespace of the the EDI schemas to one your app owns, meaning not "http://schemas.microsoft.com/BizTalk/EDI/X12/2006". – Johns-305 Aug 30 '16 at 13:04
  • Final comment for now, I promise :)...you can make the EDI Schema a lot easier to work with by customizing them to you needs. Several techniques are described here, specifically Creating a Custom Field. http://social.technet.microsoft.com/wiki/contents/articles/27099.biztalk-server-edi-features-not-just-for-hipaa.aspx – Johns-305 Aug 30 '16 at 13:08
  • Tim C, yes I realize that there are no LIN segments in the T group... however, the T and I groups are complimentary, so we are needing to promote that date from the I group to the T group and wondering how this can be done. – Rylsngrd Aug 30 '16 at 13:58
  • John, no problem, thanks for all the comments. First off, no we are using 100% custom XSLT. That is the one thing I have not tried is just linking this in the grid surface since I guess I thought it would skew the results being out of context like that... will try. And yes, our shop is not very savvy with the namespaces. We have always used the default. Finally, I will check out that article you suggested. thanks again for all the support to everyone. this is an urgent issue with our resident XSLT guy out of the office for 2 weeks. – Rylsngrd Aug 30 '16 at 14:02
  • so a link within the grid surface did not produce results. Also, changing the stock X12 856 schema is not an option. As a rule we do not modify these schemas so as to stay within prescribed standards not to mention it would affect the rest of our 856 projects. I believe I just need to find the appropriate Xpath command set to be able to get this... any Xpath pros out there, let me know. thanks – Rylsngrd Aug 30 '16 at 14:39

1 Answers1

0

Your XSLT is only outputting the DTM node(s) when HL03 = 'T', but your input doc only has LIN/LIN11 where HL03 is something else (I).

If you want to avoid outputting a DTM node when there is no LIN11, then you could do it like so:

<!--Pack-->
<xsl:if test="ns0:HL/HL03 = 'T'">
    <xsl:element name="ns0:HLLoop1">
        <xsl:element name="ns0:HL">
            <xsl:element name="HL01">
                <xsl:value-of select="userCSharp:ReturnHL01('T')" />
            </xsl:element>
            <xsl:element name="HL02">
                <xsl:value-of select="userCSharp:ReturnHL02('O')" />
            </xsl:element>
            <xsl:element name="HL03">T</xsl:element>
        </xsl:element>
        <xsl:element name="ns0:MAN">
            <xsl:element name="MAN01">GM</xsl:element>
            <xsl:element name="MAN02">
                <xsl:value-of select="ns0:MAN/MAN02" />
            </xsl:element>
        </xsl:element>
        <!--End of MAN-->
        <xsl:if test="ns0:LIN/LIN11">
            <xsl:element name="ns0:DTM_2">
                <xsl:element name="DTM01">036</xsl:element>
                <xsl:element name="DTM02">
                    <xsl:value-of select="ns0:LIN/LIN11"/>
                </xsl:element>
            </xsl:element>
        </xsl:if>
    </xsl:element>
    <!--End of HLLoop1 Pack-->
</xsl:if>

If you need the following LIN11 node, you could use code like this:

<xsl:element name="DTM02">
    <xsl:value-of select="following::LIN11[1]"/>
</xsl:element>

But this seems suspicious and prone to getting broken (what if there is no following LIN11, what if it's 10 HL loops down and gets reused multiple times, etc...). You may be best off getting the following HL loop that has HL03 = 'I', perhaps using something like here XSLT: Loop selecting two elements at a time

Community
  • 1
  • 1
Dan Field
  • 20,885
  • 5
  • 55
  • 71
  • My code is not producing a DTM output at all. I need it to output when the context is the T group... I need a way to be able to look ahead to the I group and pull this data in. any ideas? I can then worry about not outputting extra DTMs once i have actually figured out a way to get it first. – Rylsngrd Aug 30 '16 at 14:45
  • Your input document with your XSLT does produce DTM, just no DTM02 when I test it locally. If you need to get the next LIN11 in the document, I've updated the question - but this seems like a pretty fishy way of doing things... You're going to lengths to segregate the HL loops by type, but then mixing them? – Dan Field Aug 30 '16 at 16:56
  • could not agree more! however, customer stated they wanted item level data pulled and placed at the pack level. Thank you for your patience and your help. – Rylsngrd Aug 31 '16 at 15:28