XSL - distinct values

Hi Vlad,

I have a problem with the xsl transformation, if a value in the input xml file is same in same/orders multiple, unique values gets added in the same node, in the example below, I have a SKU order '2' with Qty '1' and SKU '4' with '2' quantity, so my csv file will come with 3 lines, 1 line for the lines of CODE '2' and 2 for SKU4. The output seems to add the two distinct values (such as < ns0:quantity_ordered > * 1 2 * < / ns0:quantity_ordered >) in the same node, as shown in the example below. I don't know if I'm a bad button in the Item_Data or something else,

I believe, I do not use good condition to check the separate SKU or by using a condition for each stay, I don't know if that's the problem. I would be grateful if you could tell me the problem.

Thank you
VINET

Don't know if is that the first node is 0 or 1 (there is a difference between the implementations)... There the previous does not work, try to replace [0] [1]...



  


  


  


  


  


See you soon,.
Vlad

Tags: Fusion Middleware

Similar Questions

  • XSL transformation - distinct values

    Hello

    I have a XML code that is needed using XSL, I think that this can be done using distinct values, however, I have no luck in getting this work. Could someone guide me on what function use. Any guidance / help is greatly appreciated.

    Here is the XML source, this scenario is that there are two different products, delivered in a box
    <p:Items>
        <p:Item ItemID="12">
          <p:ProductID>123456</p:ProductID>
          <p:Quantity>1</p:Quantity>
          <p:NetPrice>12</p:NetPrice>     
          <p:Packages>
            *<p:Package BoxID="1">*
              <p:Quantity>1</p:Quantity>
              *<p:TrackingNumber>12345678910111213</p:TrackingNumber>*
            </p:Package>
          </p:Packages>
        </p:Item>
         <p:Item ItemID="12">
          <p:ProductID>1400</p:ProductID>
          <p:Quantity>1</p:Quantity>      
          <p:NetPrice>10</p:NetPrice>      
          <p:Packages>
            *<p:Package BoxID="1">*
              <p:Quantity>1</p:Quantity>
              *<p:TrackingNumber>12345678910111213</p:TrackingNumber>*
            </p:Package>
          </p:Packages>
        </p:Item>     
     </p:Items>
    The XML has to be converted to,
     <ns2:package_Data>
                *<tns:package_id>1</tns:package_id>*
                <tns:package_Items>
                   <tns:vendor_item_number>123456</tns:vendor_item_number>
                   <tns:quantity_shipped>1</tns:quantity_shipped>
                </tns:package_Items>
                   <tns:package_Items>
                   <tns:vendor_item_number>1400</tns:vendor_item_number>
                   <tns:quantity_shipped>1</tns:quantity_shipped>
                </tns:package_Items>
                *<tns:trackingNumber>12345678910111213</tns:trackingNumber>*
    </ns2:package_Data>
    If two different products is shipped in 2 different boxes, which will have two box ID and Tracking # the source XML would look like this.
    <p:Items>
        <p:Item ItemID="12">
          <p:ProductID>123456</p:ProductID>
          <p:Quantity>1</p:Quantity>
          <p:NetPrice>12</p:NetPrice>     
          <p:Packages>
            *<p:Package BoxID="1">*
              <p:Quantity>1</p:Quantity>
              <p:TrackingNumber>12345678910111214</p:TrackingNumber>
            </p:Package>
          </p:Packages>
        </p:Item>
         <p:Item ItemID="12">
          <p:ProductID>1400</p:ProductID>
          <p:Quantity>1</p:Quantity>      
          <p:NetPrice>10</p:NetPrice>      
          <p:Packages>
            *<p:Package BoxID="2">*
              <p:Quantity>1</p:Quantity>
              <p:TrackingNumber>12345678910111215</p:TrackingNumber>
            </p:Package>
          </p:Packages>
        </p:Item>     
     </p:Items>
    The transformed XML should look like this,
     <ns2:package_Data>
                *<tns:package_id>1</tns:package_id>*
                <tns:package_Items>
                   <tns:vendor_item_number>123456</tns:vendor_item_number>
                   <tns:quantity_shipped>1</tns:quantity_shipped>
                </tns:package_Items>
                *<tns:trackingNumber>12345678910111214</tns:trackingNumber>*
    </ns2:package_Data>
    <ns2:package_Data>
                *<tns:package_id>2</tns:package_id>*
                <tns:package_Items>
                   <tns:vendor_item_number>1400</tns:vendor_item_number>
                   <tns:quantity_shipped>1</tns:quantity_shipped>
                </tns:package_Items>
                *<tns:trackingNumber>12345678910111215</tns:trackingNumber>*
    </ns2:package_Data>
    Here is the XSL code, I tried to use different values in the for-each leading to the error, the code below works fine for the second scenario mentioned above.
     <xsl:for-each select="/ns0:OrderStatus/ns0:Items/ns0:Item/ns0:Packages/ns0:Package">
                <ns2:package_Data>
                  <tns:package_id>
                    <xsl:value-of select="@BoxID"/>
                  </tns:package_id>
                  <tns:package_Items>
                    <tns:vendor_item_number>
                      <xsl:value-of select="../../ns0:ProductID"/>
                    </tns:vendor_item_number>
                    <tns:quantity_shipped>
                      <xsl:value-of select="../../ns0:Quantity"/>
                    </tns:quantity_shipped>
                  </tns:package_Items>
                  <tns:trackingNumber>
                    <xsl:value-of select="ns0:TrackingNumber"/>
                  </tns:trackingNumber>
                </ns2:package_Data>
              </xsl:for-each>
    Thank you
    Fri

    Try something like this...

    
    
      
      
          
             
          
          
             
                 
                     
                 
    

    See you soon,.
    Vlad

  • Distinct values does not work.

    Hi all

    Anyone can guide me please on the distinct values.

    In my xslt to need a point to get the separate provider values.

    Here is the info-provider xml example
    <SupplierXitem><XItemSupDesc xmlns:ns3="http://xmlns.oracle.com/TSS_to_RMS/RIBXItemProcess/SupplierXitem" xmlns="http://xmlns.oracle.com/TSS_to_RMS/RIBXItemProcess/SupplierXitem"><ns3:XitemSup><ns3:supplier>101018</ns3:supplier><ns3:primary_supp_ind>N</ns3:primary_supp_ind><ns3:XitemSupCtydesc><ns3:origin_country_id>IN</ns3:origin_country_id><ns3:primary_country_ind>Y</ns3:primary_country_ind><ns3:unit_cost>6.000000</ns3:unit_cost></ns3:XitemSupCtydesc></ns3:XitemSup><ns3:XitemSup><ns3:supplier>101018</ns3:supplier><ns3:primary_supp_ind>N</ns3:primary_supp_ind><ns3:XitemSupCtydesc><ns3:origin_country_id>CA</ns3:origin_country_id><ns3:primary_country_ind>Y</ns3:primary_country_ind><ns3:unit_cost>7.000000</ns3:unit_cost></ns3:XitemSupCtydesc></ns3:XitemSup></XItemSupDesc></SupplierXitem>
    and my outputshould be as below

    < ns1:XItemSupDesc >
    < ns1: beg > 101018 < / ns1: beg > < ns1:primary_supp_ind > N < / ns1:primary_supp_ind >
    < ns1:XItemSupCtyDesc >
    < ns1:origin_country_id > NC < / ns1:origin_country_id > < ns1:primary_country_ind > Y < / ns1:primary_country_ind > < ns1: unit_cost > 7.000000 < / ns1: unit_cost > < / ns1:XItemSupCtyDesc >
    < ns1:XItemSupCtyDesc >
    < ns1:XItemSupCtyDesc > < ns1:origin_country_id > IN < / ns1:origin_country_id > < ns1:primary_country_ind > Y < / ns1:primary_country_ind > < ns1: unit_cost > 6.000000 < / ns1: unit_cost > < / ns1:XItemSupCtyDesc >
    < / XItemSupDesc >

    Here is my loigc of the xslt code

    < xsl: for each select = "fn: distinct-values($supplier/ns2:XItemSupDesc/ns2:XitemSup/ns2:supplier)" >
    "< name of xsl: variable = sΘlectionner"DistinctSupplier =" "/ >
    < ns1:XItemSupDesc >
    < ns1: beg >
    "< xsl: value-of select =". "/ >
    < / ns1: beg >
    < ns1:primary_supp_ind >
    "< xsl: value-of select ="... /NS2:primary_supp_ind "/ >"
    < / ns1:primary_supp_ind >
    < ns1:vpn >
    < xsl: value-of select = "/ ns1:XItemDesc / ns1:XItemSupDesc / ns1:vpn" / >
    < / ns1:vpn >
    "< xsl: for-each select =".. ">
    < xsl: if test = "ns2: beg = $DistinctSupplier" >
    < ns1:XItemSupCtyDesc >
    < ns1:origin_country_id >
    < xsl: value-of select = "ns2:origin_country_id" / >
    < / ns1:origin_country_id >
    < ns1:primary_country_ind >
    < xsl: value-of select = "ns2:primary_country_ind" / >
    < / ns1:primary_country_ind >
    < ns1: unit_cost >
    < xsl: value-of select = "ns2: unit_cost" / >
    < / ns1: unit_cost >
    < / ns1:XItemSupCtyDesc >
    < / xsl: if >
    < / xsl: foreach >
    < / XItemSupDesc >

    I went to couple of solution in the forum about distinct values, but I could do that I get the error of execution as below
    XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc('xsl/Trans_Soa_Supplier_XitemDesc.xsl', $XitemDesc, 'supplier', $supplier). The XPath expression failed to execute; the reason was: javax.xml.transform.TransformerException: XML-22900: (Fatal Error)
    It would be great if someone help me

    Kind regards
    Tarak.

    Hi Tarak,

    Tips weren't bad... You're quite the right direction...

    The code below works for sample entry you posted before... I tested here http://xslttest.appspot.com/

    Hope you give me a few points for my answers...

    
         
              
              
                   
                        
                        
                             
                                  
                             
                             
                                  
                             
                             
                                  
                                       
                                            
                                       
                                       
                                            
                                       
                                       
                                            
                                       
                                  
                             
                        
                   
              
         
    
    

    See you soon,.
    Vlad

  • Show only distinct values in narrative mode

    Hi guys!

    Here again, we are trying to reach an ambitious goal.

    It is possible to show only distinct values in a narrative view? For example, I have a query that retrieves about 100 lines. In these lines, a few different years, it is something like this:

    1-2013, Jhon, 10

    2-2013, Brian, 15

    3-2013, Pete, 20

    ...

    10-2014, Steve. 5

    11-2014, Kevin, 12

    ...

    90-2015, Ray, 24

    91-2015, Michael, 2

    ...

    It is possible a mode display narrative only something like that?

    Years: 2013, 2014, 2015

    If I use the feature number @column, I get as many years the results are retrieved. It is not user friendly.

    Any help will be appreciated.

    Best regards

    Fabian

    Hi all!

    I found my own solution and I want to share with you. Maybe it helps someone in the future.

    I used JavaScript to iterate through each row value. By each line, I'll check if it value is added to the overall picture with unique values. If not added, I add it, otherwise, I do nothing.

    Here is my script (pay attention to each code block, it must be in its proper "narrative class"):

    Narrative section prefix

  • OPV with distinct values for the guests

    Hi all

    Could you get it someone please let me know where/what I'm wrong. I created the couple of OPV to get distinct values, as I can't use the view that has millions of data to load guests.

    These OPV is not directly attached to my main table but joined someother tables; After you add the guests in the responses, is to show the below error

    [nQSError: 14070] can't find coverage source logical table to the columns of the logic: [bp Manager]. Please check more detailed level keys are correctly mapped. (HY000)

    I wan to the OPV use only for guests and pass the values to help requested on the main table filters

    I have no warnings/errors in my model. What could be the problem? Thank you for your time

    REDA

    Just go with PSV.

    Check it cool - bi.com for "what happens when we select all the column values.

    Table x got to join the only 1OPV then how can you expect comes from BI to the other 2 open-pollinated varieties? Likewise, we cannot write query!

    If you can create a domain for each OPV then proceed with a command prompt with the UNION of 3 open-pollinated varieties clause

  • you place your order in xquery-distinct values

    I was surprised to see the return of the following different results, is this a bug in the XML Query rewrite, or is the order of not only guaranteed the distinct values?

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    With partitioning, OLAP, Data Mining and Real Application Testing options

    SQL > SELECT XMLQUERY)

    2 ' (string code points

    3 distinct-values ((99,98,97)))'

    4 ELECTION CONTENT) result

    5 FROM dual;

    RESULT

    --------------------------------------------------------------------------------

    ABC

    SQL > SELECT / * + NO_XML_QUERY_REWRITE * /.

    () 2 XMLQUERY

    3 ' (string code points

    distinct-values ((99,98,97))) 4'

    5 ELECTION CONTENT) result

    6 FROM dual;

    RESULT

    --------------------------------------------------------------------------------

    CBA

    SQL >

    Hello

    The specs say the order is "dependent application": fn: distinct values

    Summary so is (I guess), strict language point of view, should not rest on any apparent order in the resulting sequence.

    The results collected by the two queries probably be different for the same reason: different implementation.

    First one with XQuery Rewrite active is solved using the SQL operators and functions, something along these lines:

    SELECT 'CODEPOINT2STR_FUNC' ('SEQUENCE')

    DE)

    SELECT 'AGGREGATE_FUNC' (VALUE (T) SEPARATE) "SEQUENCES".

    TABLE ("SEQUENCE_FUNC"(99, 98, 97)) T

    ) ;

    While the second is evaluated by the XVM and apparently maintains the original order.

  • Return distinct values in a fuction

    Hi all

    I create a function, where it must take two parameters of the input string and return the distinct values of the two channels

    input parameters are: 2.71A2, 2.71X15, 2.71x15 and 2.71A2, 2.71X15, 2.71a2

    I get the output as 2.71A2 parameters, 2.71X15

    need to convert lower case to upper case and compare.

    post needed more information.

    Thank you.

    One way is:

    Select listagg (ds, ",") the Group (control 1)

    from (select distinct superior (REGEXP_SUBSTR (s, "[^,] +', 1, rownum")) ds)

    from (select '2.71A2, 2.71X15, 2.71x15, 2.71A2, 2.71X15, 2.71a2's)

    the double)

    connect by INSTR (s, ',', 1, level - 1) > 0

    and prior sys_guid() is not null)

    Another way xmlquery

    ----

    Ramin Hashimzade

  • List of distinct values-

    Hello

    I am building a list of values for a selection of a table.  I noticed that even if I do not SEPARATE in the select, at the time of the report, the LOV seems to use automatically SEPARATE.  Is this the case or should I use DISTINCT in the select?

    Thank you.

    Leah

    By definition, a value list item class will contain only distinct values.  A LOV containing an entry for each record with the value "2013" serve no real function. Being a LOV each displayed value will be unique.

    Kind regards

    Sharon

    Support of Oracle

  • Select the records from the first n distinct values of column

    I need to write a query in plsql to select records for the first 3 values distinct from a single column (example below, ID) and all lines for the next 3 distinct values of column and so on until the end of the number of distinct values in a column.
    for example:
    Age of name ID
    1 abc 10
    1 def 20
    2 IA 10
    2 20 JKL
    2 mno 60
    3 10 pqr
    4 the RST 10
    4 10 TÜV
    5 vwx 10
    6 10 XYZ
    hij 6 10
    7 lmn 10
    .
    .
    .
    so now... (up to a few County)
    Result must be
    1 the application should result->
    Age of name ID
    1 abc 10
    1 def 20
    2 IA 10
    2 20 JKL
    2 mno 60
    3 10 pqr

    Query 2 should lead to->
    4 the RST 10
    4 10 TÜV
    5 vwx 10
    6 10 XYZ
    hij 6 10

    Query 3 should lead to->
    7 lmn 10
    .
    .
    9... ..
    so now...
    How to write a query for this inside a loop.

    Hello

    Thus, a panel will consist of the lowest id value, the 2nd lowest and the 3rd lower, reggardless of how many lines is involved. The next group will include the 4th lowest id, the 5th lowest and the 6th lowest. To do that, you must assign the numbers 1, 2, 3, 4, 5, 6,... for the rows in order by id, with all lines with the same id, getting the same number and without jumping all the numbers.
    This sounds like a job for the analytical DENSE_RANK function:

    WITH     got_grp_id     AS
    (
         SELECT     id, name, age
         ,     CEIL ( DENSE_RANK () OVER (ORDER BY id)
                   / 3
                   )          AS grp_id
         FROM     table_x
    )
    SELECT     id, name, age
    FROM     got_grp_id
    WHERE     id     = 1     -- or whatever number you want
    ;
    

    If you would care to post CREATE TABLE and INSERT statements for your sample data, then I could test it.
    See the FAQ forum {message identifier: = 9360002}

  • Select the distinct value of a column in the collection in bulk.

    Hi all

    Collecting the data of a query to a variable of type table. I need to select a separate of a perticular column value in the collection.

    Collection has followiing values inside.
    Col(c).articleid,
    Col(c).userkey,
    Col(c).origin,
    Col(c).addnlorigindata,
    Col(c).avdest,
    Col(c).dispfmt,
    Col(c).sourcecode,
    Col(c).success_ind,
    Col(c).error_code,
    Col(c).entry_createddate,
    Col(c).createdby,
    Col(c).filenumber,
    Col(c).linenumber,
    Col(c).acctnum,
    Col(c).assetkey,
    Col(c).autocompletedterm,
    Col(c).accessionnumber,
    Col(c).requestdatetime,
    Col(c).requestorip,
    Col(c).articleordinal,
    Col(c).userinitiatedind,
    Col(c).captchastatus
    I need to select distinct column values (for example: Col (c) .sourcecode) collection and the need to insert in the table if the value in this column does not exist in the table.

    Say, Col (c) .sourcecode has the value XYZ, ABC. If the "XYZ" value does not exist in the table, so I need to insert in the table and if "ABC" exists in the tables then don't insert it. (something like fusion) after seecting to the distinct values in a column in the collection.

    Thanks n regards
    Nana Akkivalli.

    The collection must be inserted before you can use this topic.

    In the Begin block, you have to collect a loose and insert inside: something like

    SELECT *
    BULK COLLECT INTO l_array
    FROM ALL_USER
    ...CONDITIONS...
    
  • number of distinct values against a few distinct values

    Hello
    If I have a table with millions of records and I query this table with a where clause on a column with few unique values, it would execute faster than this column with many, many distinct values? If Yes, could someone please help me understand why? Where clause would simply like this:

    where column1 = 'xyz '.

    Could you please answer for cases where the column IS and is not indexed?

    Thank you!

    Hello

    arizona9952 wrote:
    Hello
    If I have a table with millions of records and I query this table with a where clause on a column with few unique values, it would execute faster than this column with many, many distinct values?

    It is the opposite; the query can be faster if you have more distinct values.

    If Yes, could someone please help me understand why? Where clause would simply like this:

    where column1 = 'xyz '.

    Could you please answer for cases where the column IS and is not indexed?

    Oracle will tend to use the indexes that are selective, meaning that there are many distinct values, and thus only a smaller percentage of the table than a given value.
    Imagine you are in a library, and you are looking for an author of some books.
    One way to do that is to look for the author of the catalogue, print a list of all books by this author and search for each of them. This is similar to using an index on a table.
    Another way is to go through the rays, look at each book and see if there is the author of right. This corresponds to a full table scan.
    If 5 authors wrote all the books in this librrary, while about 20% of the books in this library are by a given author, then the 2nd way might actually be faster; looking at each book can be faster than the search for many books, including, more you save the work of assistance from the catalog and store the results of catalog.

    If the column is not indexed, it make much difference how many distinct values are in colum1.

  • Distinct values on the ov Type NVARCHAR2 column

    Hello

    I have a Table with an Nvarchar2 column (255) on a 10.2.0.4 database.

    I've gathered statistics on the table in different ways, with or without the histograms. I know that the table has about 65,000 distinct values, but dba_tab_col_statistics shows always 10 lines.

    For a test, I created a new column of type VARCHAR2 (255) and copied the nvarchar2 data in varchar2 column. Once I've collected statistics, and for the varchar2 column, it displays the correct value.

    any ideas?

    Concerning

    PK

    Here are some other data:
    Select count (distinct (REPOSID_XMETA)) of tmp;
    COUNT (DISTINCT (REPOSID_XMETA))
    ------------------------------
    63933

    alter table tmp add tmp_col VARCHAR2 (255);
    Modified table.

    > tmp desc

    Name Null? Type
    ----------------------------------------------------------------------------------------------------- -------- --------------------------------------------------------------------
    REPOSID_XMETA NVARCHAR2 (255)
    TMP_COL VARCHAR2 (255)

    setting a day of tmp_col set tmp = REPOSID_XMETA;
    63933 lines to date.
    Commit;
    Validation complete.
    create index tmp_index1 on tmp (REPOSID_XMETA);
    The index is created.

    create index tmp_index2 on tmp (tmp_col);
    The index is created.

    Start
    (dbms_stats.gather_table_stats)

    ownname = > 'SYS ',.
    tabname = > 'TMP ',.
    estimate_percent = > null,
    Cascade = > TRUE,
    level = > 4,
    no_invalidate = > FALSE,
    granularity = > 'AUTO',
    method_opt = > 'for all COLUMNS INDEXED");
    end; /
    Select COLUMN_NAME, DENSITY, NUM_NULLS, NUM_DISTINCT, NUM_BUCKETS in dba_tab_col_statistics where table_name = 'TMP2';
    Separate column
    Name of the density of values NUM_NULLS NUM_BUCKETS
    -------------------------------------------------- ---------- ------- ---------- -----------
    10 0 0 10 REPOSID_XMETA
    63 933 0 0 75 TMP_COL

    Published by: user1131374 on July 1, 2011 05:27

    Just read below link where joze Scheid noted that Oracle's first 32octets even after DBMS_STATS statistics in the columns of multibyte characters.

    Conclusion - converting varchar2 nvarchar2.

    http://Joze-senegacnik.blogspot.com/2009/12/CBO-oddities-in-determing-selectivity.html

    Concerning
    Girish Sharma

  • Drop Dynamics: distinct values

    Hello everyone. Newb here.

    I just started to work on a dynamic web page in Dreamweaver CS3. I use WAMP (MySQL/PHP). I have my web page set up, plugged in and everything works fine.

    I just created a drop-down menu to display the dynamic value (State) of my recordset. My table related to this recordset has a bunch of files with one of the fields in the State. There are several records of each State. When I saw the page in the browser, the menu displays the State of my table, but it displays each status several times (no doubt the number of records that come from that State). Here's the question:

    How can I get this drop-down menu to display the distinct values for the State field?

    i.e. show LA, MS, TX, GA instead of, THE, THE, THE, LA, MS, MS, MS, MS, TX, TX, GA, GA, GA

    Any help would be greatly appreciated.

    Hello kmcamara86

    Yes you place the Select Distinct in the wrong place. The "Select".

    Separate must be in the recordset for the drop, not the drop-down list.

    Open the recordset in the data tab, and then click Advanced to

    the Recordset. Change the sql statement for

    "SELECT DISTINCT (state) FROM table_name";

    If you can email me the code for your page, I can change the

    record set for you.

    Thank you

    Stan Forrest

    Digital magic show

    Phone: (661) 979-8891

    E-mail: [email protected]

    Web: http://www.digitalmagicshow.com

    Our desire is to exceed your expectations

  • the sum of the column lines based on distinct values of column B

    Hi all
    Here is my xml
    rowset <>
    < ROW >
    < ORDER_NO > 103-4385509 < / ORDER_NO >
    < SITE_NO > 103 < / SITE_NO >
    < ORDER_ID > 4385509 < / ORDER_ID >
    < CUSTOMER_ID > 2676832 < / CUSTOMER_ID >
    < TAX_AMOUNT >.33 < / TAX_AMOUNT >
    < CREATED_DATE > 20/08/2010 < / CREATED_DATE >
    < USER_CREATED > TSDAL671 < / USER_CREATED >
    < Delivery_Method > CARRY OUT STORE < / Delivery_Method >
    < Entered_By > TSDAL671 < / Entered_By >
    < SKU_NO > 321182 < / SKU_NO >
    < NAME_TEXT > MGR_OVERRIDE < / NAME_TEXT >
    < > 319 ATTRIBUTE_ID < / ATTRIBUTE_ID >
    Override < ATTRIBUTE_VALUE > done < / ATTRIBUTE_VALUE >
    < DETAIL_SEQ_NO > 1 < / DETAIL_SEQ_NO >
    < / ROW >
    < ROW >
    < ORDER_NO > 103-4385509 < / ORDER_NO >
    < SITE_NO > 103 < / SITE_NO >
    < ORDER_ID > 4385509 < / ORDER_ID >
    < CUSTOMER_ID > 2676832 < / CUSTOMER_ID >
    < TAX_AMOUNT >.33 < / TAX_AMOUNT >
    < CREATED_DATE > 20/08/2010 < / CREATED_DATE >
    < USER_CREATED > TSDAL671 < / USER_CREATED >
    < Delivery_Method > CARRY OUT STORE < / Delivery_Method >
    < Entered_By > TSDAL671 < / Entered_By >
    < SKU_NO > 321182 < / SKU_NO >
    < NAME_TEXT > OEDTL_TAX_INFO < / NAME_TEXT >
    < > 314 ATTRIBUTE_ID < / ATTRIBUTE_ID >
    < ATTRIBUTE_VALUE > 441130760 | 441130760 | 441130760 | 1. 1. 1. 20100820 | 2676832 | 2. SPARE PARTS | < / ATTRIBUTE_VALUE >
    < DETAIL_SEQ_NO > 1 < / DETAIL_SEQ_NO >
    < / ROW >
    < ROW >
    < ORDER_NO > 103-4385509 < / ORDER_NO >
    < SITE_NO > 103 < / SITE_NO >
    < ORDER_ID > 4385509 < / ORDER_ID >
    < CUSTOMER_ID > 2676832 < / CUSTOMER_ID >
    < TAX_AMOUNT >.18 < / TAX_AMOUNT >
    < CREATED_DATE > 20/08/2010 < / CREATED_DATE >
    < USER_CREATED > TSDAL671 < / USER_CREATED >
    < Delivery_Method > CARRY OUT STORE < / Delivery_Method >
    < Entered_By > TSDAL671 < / Entered_By >
    < SKU_NO > 412679 < / SKU_NO >
    < NAME_TEXT > OEDTL_TAX_INFO < / NAME_TEXT >
    < > 314 ATTRIBUTE_ID < / ATTRIBUTE_ID >
    < ATTRIBUTE_VALUE > 441130760 | 441130760 | 441130760 | 1. 1. 1. 20100820 | 2676832 | 2. 0035 | < / ATTRIBUTE_VALUE >
    < DETAIL_SEQ_NO > 2 < / DETAIL_SEQ_NO >
    < / ROW >


    I have to display 3 lines but all the sum of TAX_AMOUNT grouped by ORDER_ID, I need sum for 2 records based on the distinct value of DETAIL_SEQ

    so my output should be something like below

    ORDER_ID | TAX_AMOUNT | DETAIL_SEQ | ATTRIBUTE_ID
    -----------------------------------------------------------------------------
    4385509 | 0.33 | 1. 319
    4385509 | 0.33 | 1. 314
    4385509 | 0.18 | 2. 314
    --------------------------------------
    SUM = 0.51
    ------------------------------------------


    Note: I can't make separate in the sql attribute_id is different for the same DETAIL_SEQ_NO.


    I tired to do <? sum ([xdoxslt:distinct_values (current - group () / DETAIL_SEQ_NO)] / TAX_AMOUNT)? >

    It did not work.

    Can someone help me please!



    Thanks in advance!

    This syntax will not work.

    A method to do so.

     
    
          
     
    
     
    
    
    
  • distinct values Ansdo_elem_info

    Hello

    How do I get distinct values in Ansdo_elem_info. I tried now but no luck. (I'm looking for different values in sdo_elem_info_array)

    Select * from parcels p
    where p.geometry.SDO_ELEM_INFO = mdsys.sdo_elem_info_array (1,1003,1)

    get "ora-00932 inconsistent data types: planned mdsys.sdo_elem_info_array had.

    Thank you
    Ramiz

    Hello
    I don't think you can compare two varrays using (=).
    You can use a PL/SQL function (as below) to achieve this.

    Select... from [your_table]
    where same_elem_info_array (array1, array2) = "TRUE";

    Jack

    create or replace function same_elem_info_array (array1 in mdsys.sdo_elem_info_array, in mdsys.sdo_elem_info_array array2)
    VARCHAR2 is back
    Start

    If (array1 is null or)
    Array2 is null) then
    Returns a null value.
    end if;

    If (array1.count! = array2.count) then
    Back to "FALSE";
    end if;

    because me in 1.array1.count
    loop
    If (array1 (i)! = array2 (i)) then
    Back to "FALSE";
    end if;
    end loop;

    Returns "TRUE".

    end same_elem_info_array;
    /

Maybe you are looking for

  • G20: Out stickers

    I tried to remove the stickers of the G20, and there is a huge amount of glue now standing on this beautiful glossy black plastic.What I'll use to get it out? Anyone has done out them? because they advise us not not to use any chemical liquid, so tha

  • graphics update in real time

    Hello In the attached VI in labview 8.5, I wanted to show two plots on the same graph in real time.  In other words, for each iteration in the 'loop', updates to the graph.  I am not able to do this with one of the plots (y1) but holds two data sets

  • My sx100 printer is not compatible with my new laptop Windpws 8

    Laptop is Acer E1 - 571 15

  • Need help with visuals of microsoft.

    I have a pc Toshiba S55 (64-bit X 64 OS base processor) with 8 pre-installed windows. I updated my pc a few days ago and when it was finished he took the program microsoft visual c ++ 2005 redistributable 8.0.56336 version & moved to my office under

  • Signatures being reset (WebOS 1.4)

    Whenever I go into the settings screen for one of my email accounts, signed to return to the default "-sent from my Palm Pre. If I change it, it sticks as new E-mails and responses have the correct signature.  However, as soon as I back up the settin