assignment of sequential value that resets to a group of records

Hello all and happy FRIDAY!

I do a conversion of data to a new system and I can't seem to come with a query.

Running Oracle 10.2

Sample data:
create table test (GRP number, PART varchar2(20), SEQ number);
insert into test values(9000, 'lskdjf', null);
insert into test values(9000, 'alsdk', null);
insert into test values(9000, '492kjsfjsldk', null);
insert into test values(9000, 'lkjasdf0982j', null);
insert into test values(9001, 'likfjajsd', null);
insert into test values(9001, '234-092838', null);
insert into test values(8934, '000-192893aj', null);
insert into test values(8934, 'anotherpart', null);
insert into test values(8934, 'jjjj0-aa-2001', null);
insert into test values(8934, 'encifudy', null);
insert into test values(8934, 'asfdjslkjdfklsj', null);
insert into test values(8934, 'lksjdflj', null);
insert into test values(4736, 'l;ask---jdflasj', null);
commit;

Select * from test;
Do select * at this stage will give you the elements of nulls for the third column.

Problem:
I'm trying to run a query that spits out a sequence for each "group" of records. If there are 5 records in a group, I would like the sequence start at 1 and go to 5... may be ordered by a party. (not quite sure that the command, but to do babysteps here): P

Here is an example of the output data, I would like that in the example above:
GRP     PART               SEQ
9000     lskdjf               1
9000     alsdk               2
9000     492kjsfjsldk          3
9000     lkjasdf0982j          4
9001     likfjajsd          1
9001     234-092838          2
8934     000-192893aj          1
8934     anotherpart          2
8934     jjjj0-aa-2001          3
8934     encifudy          4
8934     asfdjslkjdfklsj          5
8934     lksjdflj          6
4736     l;ask---jdflasj          1
In that result, SEQ is not applied to the drive control part, but ultimately, this might be something I would do. So far only community-eager to get these figures here. I read using rankover(), but it's still a bit confusing for me on how it works. I'll go than I suspect it's probably what I'll have to use a search.

In the end, this is part of a slider that is powered by a bulk collect. I might be able to fill this SEQ in PL/SQL, but I thought it would be easier to get them just at the level of the query so that they are already part of the collection, instead of having to build the logic to create this numbering system prior to insertion of an intermediate table.

Anyhoo... any help would be greatly appreciated! If I've omitted something or am not clear anyway, please let me know! Thank you!

Published by: dvsoukup on July 27, 2012 16:25

Hello

dvsoukup wrote:
Running Oracle 10.2

Sample data:

create table test (GRP number, PART varchar2(20), SEQ number);
insert into test values(9000, 'lskdjf', null); ...

Thanks for posting your version and CREATE TABLE and INSERT PMT ts; It's very useful!
>

Do select * at this stage will give you the elements of nulls for the third column.

Problem:
I'm trying to run a query that spits out a sequence for each "group" of records. If there are 5 records in a group, I would like the sequence start at 1 and go to 5... may be ordered by a party. (not quite sure that the command, but to do babysteps here): P
I read using rankover(), but it's still a bit confusing for me on how it works.

You got that right! Analytical functions are looking very strange and confusing at first. After awhile, they don't seem so strange, and then they get even less confusion.
One thing to remember: "PARTITION OF x" (this is always optional) means that each value of x is a world full. It's like a separate query is made for each value of x, and when they are all finished, the results are clauses together. In this case, you want to PARTITION BY grp.

I'll go than I suspect it's probably what I'll have to use a search.

You are very close; only, as the first response said, it is not RANK you want, but its close relative ROW_NUMBER. The difference between the two, it's how they deal with the links. If you have duplicates, RANK assigns a number in doubles. I suppose you want the unique numbers, even if you have identical parts on the same grp.

In the end, this is part of a slider that is powered by a bulk collect. I might be able to fill this SEQ in PL/SQL, but I thought it would be easier to get them just at the level of the query so that they are already part of the collection, instead of having to build the logic to create this numbering system prior to insertion of an intermediate table.

It is quite easy to assign numbers when you generate the table.

If the situation is what you have posted, that is your table already exists, but the number of seq is not filled yet, then you can do:

MERGE INTO     test     dst
USING   (
         SELECT  grp
         ,         part
         ,         ROW_NUMBER () OVER ( PARTITION BY  grp
                                                ORDER BY      part
                           )       AS seq
         FROM    test
     )          src
ON     (     src.grp          = dst.grp
     AND     src.part     = dst.part
     )
WHEN MATCHED THEN UPDATE
SET     dst.seq   = src.seq
;

The MERGE statement preceding assumes that the combination (grp, part) is unique.
Once executing, this query:

SELECT       *
FROM       test
ORDER BY  grp
,            part
;

will these results:

`      GRP PART                        SEQ
---------- -------------------- ----------
      4736 l;ask---jdflasj               1
      8934 000-192893aj                  1
      8934 anotherpart                   2
      8934 asfdjslkjdfklsj               3
      8934 encifudy                      4
      8934 jjjj0-aa-2001                 5
      8934 lksjdflj                      6
      9000 492kjsfjsldk                  1
      9000 alsdk                         2
      9000 lkjasdf0982j                  3
      9000 lskdjf                        4
      9001 234-092838                    1
      9001 likfjajsd                     2

The USING clause above is almost identical to the query, published in the last post, but in the analytic clause, instead of "ORDER BY grp", part it says "COMMANDER PARTIALLY. He never has any sense to PARTITION BY and ORDER BY the same column in the same function. Why? Discuss.

Tags: Database

Similar Questions

  • Hi can I reset the value that is assigned to < af:inputtext

    Hi, please find the code below

    IAM trying to find the value on which the user has clicked in the outputtext in a pop up


    < af:forEach var = "item" items = "#{backing_TestSample.friendlist}" >
    < af:inputText value = "#{point}" id = "inputText" >
    < af:clientListener method = "clientMethodCall" type = "click on" / >
    < af:serverListener type = "customEvent" method = "#{backing_TestSample.onPreRender}" / >
    < af:showPopupBehavior popupId = "popup1" triggerType = ' click on ' align = 'afterEnd' >
    < / af:showPopupBehavior >
    < / af:inputText >
    < br >
    < here >
    < / af:forEach >


    < af:popup id = "popup1" >

    < af:inputText text = "Say" id = "inpu1" >


    < f: event listener = "#{backing_TestSample.changePopup}" type = "preRenderComponent" / > "
    < / af:inputText >
    < / af:popup >



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

    public list getFriendlist() {}
    frndsList = new ArrayList < String > ();
    frndsList.add ("a");
    frndsList.add ("ba");
    frndsList.add ("c");
    frndsList.add ("d");
    frndsList.add ("f");
    frndsList.add ("g");

    Return this.frndsList;
    }


    {} public void onPreRender (event ClientEvent)
    InputText RichInputText = (RichInputText) event.getComponent ();
    this.chatId = (String) inputText.getValue ();

    }



    {} public void changePopup (ComponentSystemEvent event)


    System.out.println ("change POP" + this.chatId);


    ((RichInputText) FacesContext.getCurrentInstance () .getViewRoot () .findComponent ("inpu1")) .setValue (this.chatId);

    }


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

    In the console, I am able to see the correct output, I want to say if I click on 'a' I could see the POS 'POP A change' and even in the pop up it shows me the correct value, but if I click on another aoutputtext value in the menu contextual does not evolve, it's always show the first value that is "a".


    Please let me know what that iam missing to update the values in the pop-up window

    You can set the following property to the pop-up window contentDelivery = "lazyUncached" ?









    contentDelivery = "lazyUncached" >



    Thank you
    Nini

  • can I have non sequential values in the round of menu?

    I create rings of menu which are intended to replace what has been a hexadecimal numeric field.

    The definition of registry itself is one thing for a long time within our FPGA and out of my hands.  So let's say it is a field of 2 bits set as follows:

    B00: not used

    B01: CRC-WE

    B10: not used

    B11: CRC-OFF

    So I want my menu ring to have only the CRC WE and CRC-OFF options, but so far the only way I see to do this is to create also 2 unused fields, because I can not change the values manually in the properties of menu ring.  I don't want 2 'empty options' is displayed on the menu ring.

    I also tried the enum ring but he wanted too things sequentially.  What do I have to use a different type of control, or what I need to add code that translates the value selected in the ring of menu the value I want?

    You should be able to have only two options you want in the menu ring. Right click on the control of the ring and choosing "edit items...". ", you should get a dialog box with a table and values of the elements. If you uncheck the box 'Sequential values', you can then change the values associated with these elements.

  • How to assign the next value in the sequence directly in a variable?

    How to assign the next value in the sequence directly in a variable without using a table TWICE in PL/SQL.

    BluShadow wrote:

    How about a quick test on 11g, just to see if you directly select a sequence in a variable is significantly better than the mark of DOUBLE.

    ...

    Nope... no obvious difference.

    This is because there is none: Oracle's SELECT sequence. NEXTVAL FROM DUAL under the covers. The direct assignment is just a convenient encoding for us, but it does not change the work that accomplishes Oracle.

    create sequence s;
    alter system flush shared_pool;
    declare
    l_num number;
    begin
    l_num := s.nextval;
    end;
    /
    select sql_text from v$sql where parsing_schema_name = user;
    
    SQL_TEXT
    Report the number of l_num; begin l_num: = s.nextval; end;
    Select sql_text from v$ sql where parsing_schema_name = user
    Select double S.NEXTVAL
  • Assignment of specific values of CI practitioners

    Hello

    We try to customer approval of road tasks to those who are defined as stakeholders at a specific value of the CI.  So if someone chose a value of 'GMBO' of a QD field on the submission form, I would like to as the workflow to send the approval to Executive Director task "of stakeholders: role" for the selected CI.

    In order to define, in the customer approval task, I chose "Interested party", then "request no. / query CIs and stakeholders."  However it seems to set the CI in the detail screen of the application (within the CIs section) in the model in order to have it correctly routed to an intervener linked.  Here, the problem seems to be that he forward tasks of customer approval to all stakeholders associated with ALL the listed CI (under the section related CIs).

    Is it possible to have the 'Bound CIs' field dynamically filled in the details screen of application based on the value that is selected in the submission form?

    I hope I'm missing something right here in the way I set it up.  We run a 9.1.4 VSM environment. Thanks for any help/direction with it.

    -Syed

    Hi Syed,

    It is very important that your custom QD CI field is created in the screen assigned to your application either in all screen common called "request". You can take a look here for more information on this subject.

    If she asks is the value or inherited then you should be able to select your players in the custom field in a form of selection of feline recipients (cust.appr.task):

    There is really no need to use the "CI-related" field at all so you don't need.

    Gytis

  • Oracle how to assign a date value in a parameter declaration

    How can I assign a date value to a parameter declaration in SQL?

    Here are my existing script.

    CURRENT SITUATION:

    select distinct as summary ' iCash EAD error Summary", count (*).
    AAA. BKS_ICASH_EAD_ERRORS
    where creation_date > to_date (' 26/05/12 08:50 "," mm/dd/yy HH24 ')
    Summary group


    I want to assign the date I'm looking for a parameter and use the setting in my query.


    OBJECTIVE:

    DECLARE
    pCreateDate DATE;

    exec: pCreateDate: = 5/26/12-08:50 ';

    select distinct as summary ' iCash EAD error Summary", count (*).
    AAA. BKS_ICASH_EAD_ERRORS
    where creation_date > to_date (: pCreateDate, "mm/dd/yy HH24 '")
    Summary group

    Hello

    In SQL * Plus, you can do this:

    VARIABLE     pcreatdate     VARCHAR2 (20)
    EXEC           :pcreatedate := '5/26/12 8:50';
    
    SELECT    summary          AS "iCash EAD Error Summary"
    ,       COUNT (*)          AS "Total Count"
    FROM        aaa.bks_icash_ead_errors
    WHERE       creation_date  > TO_DATE (:pcreatedate, 'MM/DD/RRRR HH24:MI')
    GROUP BY  summary
    ;
    

    'GROUP BY summary' means that you will get a line of output for each distinct value of the summary. He has no need of SELECT DISTINCT since the GROUP BY is already ensuring that the lines are separate.

    There is no variable binding DATE in SQL * Plus, so you must use a VARCHAR2.
    If you do something similar in PL/SQL, you can use a DATE variable. Make sure that you do not call TO_DATE on something that is already a DATE.

    Published by: Frank Kulash on June 26, 2012 14:01

  • Calculation value that is used in the Condition of year-round

    I found that if I have a text field element in a region and I put its value in a calculation (after the region) that this element will not work in a "condition to evaluate.

    Text field element is FirstName. No set of default values and "always replace...". "
    Calculation (after the regions), the value as a static assignment to JOHN.

    There is a second computation (after Regions) for another article with a condition. The condition is "the point value to expressin 1 = value of element in the expression 2".
    First name in JOHN and expression1 in expression2.

    When I look at the debugging session FirstName prepares to JOHN, but the second calculation does not run.

    Now if I give FirstName, a default value of JOHN where the element is defined, then the second calculation runs.
    It appears to me that something different is happening with a calculated value that does not allow to use in a condition. Can anyone help.
    Thank you very much.

    Hello

    I tried to reproduce your case:

    I have a region containing two elements P6_X1 and P6_X2 (no default value and always...):
    For P6_X1, I created the static calculation (after region, sequence 1)
    For P6_X2, I created the math static (after region, order of the sequences 10) with the conditon (value of the element / column is 1 Expression = Expression 2), where Expression1 = P6_X1 and Expression2 = JOHN

    And in my case it works:

    You can see what is happening in my debug

    0.09112     0.00030     Computation point: After Box Body
    0.09142     0.00031     ...Perform computation of item: P6_X1, type=STATIC_ASSIGNMENT
    0.09173     0.00046     ...Performing static computation
    0.09219     0.00093     ...Session State: Save "P6_X1" - saving same value: "JOHN"
    0.09312     0.00031     ...Perform computation of item: P6_X2, type=STATIC_ASSIGNMENT
    0.09342     0.00039     ...Performing static computation
    0.09381     0.00038     ...Session State: Save "P6_X2" - saving same value: "LITTLE"          
    

    Have you checked the sequence of your calculation?
    What is your exact condition for the calculation? For expression2 don't you user JOHN or "JOHN"?

    Kind regards
    Aljaz

  • I tunes do not recognize my iphone 5 C Windows will recognize it, but itunes won't and I can't sync to my phone. Are there suggestions that reset phone, computer or download itunes?

    I tunes do not recognize my iphone 5 C Windows will recognize it, but itunes won't and I can't sync to my phone. Are there suggestions that reset phone, computer or download iTunes?

    See if the AMDS restart help.

    Instructions here > restart the Service Apple Mobile Device (AMDS) on Windows

  • Mr President, how can I enter two rows at the same time with different default values that only the first line to use see?

    Mr President.

    My worm jdev is 12.2.1

    How to enter two rows at the same time with different default values that only the first line to use see?

    Suppose I have a table with four fields as below

    "DEBIT" VARCHAR2(7) , 
      "DRNAME" VARCHAR2(50),
      "CREDIT" VARCHAR2(7) , 
      "CRNAME" VARCHAR2(50),
    

    Now I want that when I click on a button (create an insert) to create the first line with the default values below

    firstrow.png

    So if I click on the button and then validate the second row with different values is also inserted on commit.

    The value of the second row are like the picture below

    tworows.png

    But the second row should be invisible. It could be achieved by adding vc in the vo.

    The difficult part in my question is therefore, to add the second row with the new default values.

    Because I already added default values in the first row.

    Now how to add second time default values.

    Concerning

    Mr President

    I change the code given by expensive Sameh Nassar and get my results.

    Thanks once again dear Sameh Nassar .

    My code to get my goal is

    First line of code is

        protected void doDML(int operation, TransactionEvent e) {    
    
            if(operation != DML_DELETE)
                 {
                     setAmount(getPurqty().multiply(getUnitpurprice()));
                 } 
    
            if (operation == DML_INSERT )
                       {
                               System.out.println("I am in Insert with vid= " + getVid());
                           insertSecondRowInDatabase(getVid(),getLineitem(),"6010010","SALES TAX PAYABLE",
                            (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                           }
    
            if(operation == DML_UPDATE)
                              {                                                    
    
                                 System.out.println("I am in Update with vid= " + getVid());
                             updateSecondRowInDatabase(getVid(),
                                 (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                              }                      
    
            super.doDML(operation, e);
        }
        private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object value4, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "Insert into vdet (VID,LINEITEM,DEBIT,DRNAME,AMOUNT) values " +
                 "('" + value1 + "','" + value2 + "','" + value3 + "','" + value4 + "','" + value5 + "')";  
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }
                  }  
    
                  private void updateSecondRowInDatabase(Object value1, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "update vdet set  AMOUNT='"+ value5+"' where VID='" + value1 + "'";                     
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);  
    
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }                  
    
                  }
    

    Second line code is inside a bean method

        public void addNewPurchaseVoucher(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("VoucherView1Iterator");
                   RowSetIterator rsi = dciter.getRowSetIterator();
                   Row lastRow = rsi.last();
                   int lastRowIndex = rsi.getRangeIndexOf(lastRow);
                   Row newRow = rsi.createRow();
                   newRow.setNewRowState(Row.STATUS_NEW);
                   rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
                   rsi.setCurrentRow(newRow);
    
                   BindingContainer bindings1 = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter1 = (DCIteratorBinding) bindings1.get("VdetView1Iterator");
                   RowSetIterator rsi1 = dciter1.getRowSetIterator();
                   Row lastRow1 = rsi1.last();
                   int lastRowIndex1 = rsi1.getRangeIndexOf(lastRow1);
                   Row newRow1 = rsi1.createRow();
                   newRow1.setNewRowState(Row.STATUS_NEW);
                   rsi1.insertRowAtRangeIndex(lastRowIndex1 +1, newRow1);
                   rsi1.setCurrentRow(newRow1);
        }
    

    And final saveUpdate method is

        public void saveUpdateButton(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindingsBC = BindingContext.getCurrent().getCurrentBindingsEntry();      
    
                   OperationBinding commit = bindingsBC.getOperationBinding("Commit");
                   commit.execute(); 
    
            OperationBinding operationBinding = BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Commit");
            operationBinding.execute();
            DCIteratorBinding iter = (DCIteratorBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("VdetView1Iterator");// write iterator name from pageDef.
            iter.getViewObject().executeQuery();  
    
        }
    

    Thanks for all the cooperation to obtain the desired results.

    Concerning

  • How to add a transient attribute of a table values in the new attribute group wise transient that is to say wise customer?

    Mr President.

    How to add a transient attribute of a table values in the new attribute group wise transient that is to say wise customer?

    as below

    custwisevalue.png

    Concerning

    Hello world

    for an overview in the following form

    This is the sql query that reach this format

    SELECT c.name customer_name,
            p.name product_name,
            sl.sal_qty,
            sl.unit_sal_price,
            sl.sal_qty*sl.unit_sal_price AS salesvalue,
            CASE
              WHEN ROW_NUMBER () OVER (partition by c.cust_id order by p.prod_id desc,sl.sal_id desc) = 1 THEN
                  SUM (sl.sal_qty*sl.unit_sal_price) OVER (PARTITION BY c.cust_id)
            END totals
    FROM customer c INNER JOIN sales s ON s.cust_id = c.cust_id
    INNER JOIN salesline sl ON sl.sal_id = s.sal_id
    INNER JOIN product p ON p.prod_id = sl.prod_id
    ORDER BY c.cust_id,p.prod_id,sl.sal_id
    

    Cheers and enjoy

    Respect of

  • How to calculate values that have a checked box beside them?

    Hi people,

    I'm new to Acrobat forms and have recently completed a complicated shape of the 7 page for a client and I'm very happy with it.

    But the customer comes back with the following query:

    They want checkboxes next to a series of values and, when a checkbox is checked, he added only makes TICK value. To show what I mean, please see the image below.

    sample.jpg

    So basically, there is a field at the side left (current monthly repayments) that cuts through all the values - in my example, this amounts to $50,00. Then, there is a field on the right side (repayments monthly future) to tally only values that have a checked 'yes' box to check next to them. In my example, this would produce a score of $20.00.

    Does anyone know how this could be done?

    Thank you

    Sorry, that line must be:

    CB = getField("CashFlowCheck"_+_i).valueAsString;

  • Assign the textfield value to a variable

    How can I transfer a textfield value in the variable?

    [CODE]

    import flash.text. *;

    import flash.events. *;

    import flash.display. *;

    Button named Player_save

    Player_save.addEventListener (MouseEvent.CLICK, savename);

    function savename(event:MouseEvent):void

    {

    playerlist. Text = Player_name. Text;

    trace (Player_name. (Text);

    Player_name. Text is the TextField

    }

    [/ CODE]

    First declare the variable, then assign the text value of the textfield object.

    var playerName:String = player_name.text;

  • find a value that is the most

    Let's say I have a column with different values, now I want to find a value located most, how is the best way to make this request?
    Is the best solution to do this way:
    WITH t AS
     (SELECT 'a' AS VALUE  FROM Dual  UNION ALL
      SELECT 'b'  FROM Dual  UNION ALL
      SELECT 'a' FROM Dual)
    SELECT VALUE
    FROM (SELECT t.Value, COUNT(*) AS Cnt
               FROM t
               GROUP BY t.Value
               ORDER BY Cnt DESC
              )
    WHERE Rownum = 1
    As you can see that the value 'a' is more time in table T, then the query must exit the 'a' and nothing more. If the number of occurrences of the 'a' and 'b' would be the same, then the application should exit one of them, no matter which.
    As you can see query now does not seem to be well optimized, I think.
    (Oracle 10g)

    Or

    SQL> with t
         as (
      select 'a' as value from dual union all
      select 'b' from dual union all
      select 'b' from dual
    )
    --
    --
    select max (value) keep (dense_rank last order by count (*)) value,
           count(*) cnt
      from t
    group by value
    /
    VALUE        CNT
    ----- ----------
    b              2
    1 row selected.
    

    Published by: MichaelS on December 14, 2010 10:39

    CNT added.

  • Value that is used when you apply a gradient to an RGB image map

    Hello:

    I'm doing a classification of the color in Photoshop using the map of gradient, so the colors of certain range in the initial image corresponds to a given color chosen Gradient of.

    The final product is somehow predictable if the original image is an image in grayscale. However, if the original scale is a RGB image, value that will be used to determine the color applied to each pixel of the slope?

    There are several ways to calculate the luminosity of an RGB image, such as (0.2126*R) + (0.7152*G) + (0.0722*B) . I tried to use some, but none of them can be used to predict the actual color used by Photoshop to generate gradient.

    Does anyone know the formula used by Photoshop to determine with a pixel RGB is the color?

    Thank you

    Shane Li

    About ((red) *.3 + (green) *.59 + (blue) *. 11)

  • TOP N function and OTHER values that are not in the TOP clause

    Hello... It's easier to explain with examples. Assume there is a table with 5 records. You will have to order them and use a TOP N feature to display 3 items albums. So far, it's easy!

    But I need to show all others 2 records like the OTHERS, and have all the summaries. It would be something like this:

    The flattened table:
    Code     Value
    1     2,000
    2     1,500
    3     1,000
    4     800
    5     600
    And I need to show it in responses like this:
    Name     Value
    Number1     2,000
    Number2     1,500
    Number3     1,000
    OTHERS     1,400
    How can I show OTHERS for these values that will be excluded when I create a TOP N function?

    Thanks in advance

    Hello

    Visit this link,

    http://obiee101.blogspot.com/2009/08/OBIEE-TopN-versus-rest.html

    Thank you
    Vino

Maybe you are looking for