Problem obtaining row number in a TableView

I have a TableView configured by means of a MapValueFactory as it is shown in the code below:
private void configureColumns() {
    getColumns().clear();
    List<String> nonAnonymousVariablesNames = getNonAnonymousVariablesNames();
    if(nonAnonymousVariablesNames != null && !nonAnonymousVariablesNames.isEmpty()) {
        for(String nonAnonymousVarName : nonAnonymousVariablesNames) {
            TableColumn<Map<String, Term>, Term> dataColumn = new TableColumn<>(nonAnonymousVarName);
            dataColumn.setCellValueFactory(new MapValueFactory(nonAnonymousVarName));
            dataColumn.setMinWidth(130);
            Callback<TableColumn<Map<String, Term>, Term>, TableCell<Map<String, Term>, Term>>
                cellFactoryForMap = new Callback<TableColumn<Map<String, Term>, Term>, TableCell<Map<String, Term>, Term>>() {
                    @Override
                    public TableCell call(TableColumn p) {
                        TextFieldTableCell tableCell = new TextFieldTableCell();
                        TableRow row = tableCell.getTableRow();
                        final int index = row.getIndex();
                        StringConverter sc = new StringConverter() {
                            @Override
                            public String toString(Object t) {
                                //return something based on the current row and the object t
                            @Override
                            public Object fromString(String string) {
                                return null;
                        tableCell.setConverter(sc);
                        return tableCell;
            dataColumn.setCellFactory(cellFactoryForMap);
            getColumns().add(dataColumn);
I am trying to get the row number before printing the content of a cell. However, the call to row.getIndex(); triggers the following exception:
SEVERE: javafx.scene.control.Control impl_processCSS The -fx-skin property has not been defined in CSS for TableRow[id=null, styleClass=cell indexed-cell table-row-cell]
SEVERE: javafx.scene.control.Control loadSkinClass Failed to load skin 'StringProperty [bean: TableRow[id=null, styleClass=cell indexed-cell table-row-cell], name: skinClassName, value: com.sun.javafx.scene.control.skin.TableRowSkin]' for control TableRow[id=null, styleClass=cell indexed-cell table-row-cell]
java.lang.NullPointerException
    at org.jpc.commons.prologbrowser.model.QueryResultModel$1.call(QueryResultModel.java:74)
    at org.jpc.commons.prologbrowser.model.QueryResultModel$1.call(QueryResultModel.java:1)
    at com.sun.javafx.scene.control.skin.TableRowSkin.recreateCells(TableRowSkin.java:224)
    at com.sun.javafx.scene.control.skin.TableRowSkin.<init>(TableRowSkin.java:87)
    at sun.reflect.GeneratedConstructorAccessor6.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at javafx.scene.control.Control.loadSkinClass(Control.java:1044)
    at javafx.scene.control.Control.access$500(Control.java:70)
    at javafx.scene.control.Control$12.invalidated(Control.java:972)
    at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:127)
    at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:161)
    at com.sun.javafx.css.StyleableStringProperty.set(StyleableStringProperty.java:71)
    at javafx.scene.control.Control$12.set(Control.java:964)
    at com.sun.javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:59)
    at com.sun.javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:31)
    at com.sun.javafx.css.StyleableProperty.set(StyleableProperty.java:70)
    at com.sun.javafx.css.StyleHelper.transitionToState(StyleHelper.java:902)
    at javafx.scene.Node.impl_processCSS(Node.java:7415)
    at javafx.scene.Parent.impl_processCSS(Parent.java:1146)
    at javafx.scene.control.Control.impl_processCSS(Control.java:1154)
    at com.sun.javafx.scene.control.skin.VirtualFlow.setCellIndex(VirtualFlow.java:1598)
    at com.sun.javafx.scene.control.skin.VirtualFlow.addTrailingCells(VirtualFlow.java:1114)
    at com.sun.javafx.scene.control.skin.VirtualFlow.layoutChildren(VirtualFlow.java:1007)
    at javafx.scene.Parent.layout(Parent.java:1018)
    at javafx.scene.Parent.layout(Parent.java:1028)
    at javafx.scene.Parent.layout(Parent.java:1028)
    at javafx.scene.Parent.layout(Parent.java:1028)
    at javafx.scene.Parent.layout(Parent.java:1028)
    at javafx.scene.Parent.layout(Parent.java:1028)
    at javafx.scene.Scene.layoutDirtyRoots(Scene.java:516)
    at javafx.scene.Scene.doLayoutPass(Scene.java:487)
    at javafx.scene.Scene.access$3900(Scene.java:170)
    at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2203)
    at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:363)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
    at com.sun.javafx.tk.quantum.QuantumToolkit$9.run(QuantumToolkit.java:329)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
Is this a bug in JavaFX ? otherwise which is the correct way to obtain the row number in the string converter of the TextFieldTableCell ?

To get the content of a cell you have to make  setCellSelectionEnabled(true);
To get the selected row or selected column you can use the following: 
{code}
        table.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
        table.getSelectionModel().setCellSelectionEnabled(true);
        table.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {
            @Override
            public void changed(ObservableValue observable, Object oldvalue, Object newValue) {
                for (TablePosition t : (ObservableList<TablePosition>) table.getSelectionModel().getSelectedCells()) {
                    System.out.println("The selected column is: " + t.getColumn());
                    System.out.println("The selected row is: " + t.getRow());
{code}
If you need only the selected row  (TextFieldTableCell  selected)you can use the following:
{code}
        table.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
            @Override
            public void changed(ObservableValue observable, Number oldvalue, Number newValue) {
                System.out.println("Selected row is " + newValue);
{code}

Similar Messages

  • Problems with Row Number showing up in report

    I have a report question. When I have already created a report, and then I go back into the report to edit it, I want to be able to add the row number to the report. I go to tools, options, sheet, and select show row numbers. Even though the show row numbers option is selected, the report doesnt show the row numbers. Is this a bug? It'd be a major pain to go back and re-build 250 reports becasue I can't add the row number to a report after it is already built.
    Thanks in advance,
    -Mark

    Hey user519817.
    This is perplexing as it simply should work. I'm presently at a site running 4.x (hard after being at a site running 10gr2) and if I go to Tools -> Options -> Table, I can turn on or off the 'row numbers' box and it works as expected.
    If I alter it to a xtab, then the option isn't even there to choose from.
    I went into the Disco Admin as well thinking maybe there was a privilege (wierd but worth a look) that allowed you to have / have not row numbers, but nothing there.
    So it sounds like a 'feature'.
    What version / type of Disco are you running (ie: 4.x desktop, 10i Plus, etc.)?
    Russ

  • How to obtain row number when a new row is created (without commit)?

    I have this:
    <NamedData NDName="LineaNro"
    NDValue="#{bindings.VOIpmDistribucionManualEBS1.currentRowIndex}"
    NDType="oracle.jbo.domain.Number"/>
    When I push the New button, the value shows -1. If I push again, the value shows 0... but for third time an error occur:
    Too many objects match the primary key oracle.jbo.Key[0 0 2011-12-01 ID del comprobante 0 ]
    The problem is the last 0, it's the same 0 returned for the second button push.
    The commit must be do it at the end.
    Any suggestions?
    Thanks in advance.

    Can you elaborate a bit on what you are trying to do?
    And which jdev version you are using?
    If you try to use the current row index a a primary key for a new row this won't work. The first time you hit the new button you get -1 as the current row is not set. Then the new row get the current row and get the index 0. So, then you hit new again you get 0 back.
    It's never a good idea to use a row index as primary key as this won't work in multi user environments (which adf web apps are).
    You should use a db sequence as PK as this will work in all scenarios and guarantees that one number is only use once.
    Timo

  • Problem with row number in bc4j

    Hi,
    i used an ADF object view, and i made drag and drop in my jsp. but i always see 10 records in the table, i'd like to change this value. i tryed to change maxFetchSize property, but it doesn't work. how can i do?
    Thank you very much for reading this post

    i resolved.
    i ovverided findForward method, and here
    i applyed setRangeSize() Method on my object view, and i recalled executeQuery method

  • TableView -- get the row number of the top most current visible row

    Is there any way to get the row number of the top most visible row, and or bottom most visible row in TableView?

    If you already know the document's name, the sheet's name and the table's name, the easy way is :
    --Here you may replace the three values by the current ones
    set dName to 1
    set sName to 1
    set tName to 1
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    tell first cell of the selection range to set {rowNum1, columnNum1} to {address of its row, address of its column}
    tell last cell of the selection range to set {rowNum2, columnNum2} to {address of its row, address of its column}
    end tell
    Yvan KOENIG (VALLAURIS, France) mercredi 9 février 2011 17:22:21

  • Change transaction using BDC-problem for large number of lines on screen

    Hi All,
    I am developing BAPI (using BDC) which creates quality notification in SAP which is entered via front end web application. Structure p_qmsm contain 3 lines of task in notification. The code is as given below. To avoid problem of large no of lines on screen,code lines starting with * is used. This actually for pagedown after entering every 2 lines and creates new line. so that 2 lines always push up on screen and there will not be problem for creating large no of lines on screen
    perform bdc_dynpro using 'SAPLIQS0' '7200'.
    perform bdc_field using 'BDC_OKCODE' '=10\TAB11'.
    LOOP AT p_qmsm INTO wa_qmsm.
    *IF wa_qmsm_cntr > 2.
           wa_qmsm_cntr = 2.
           perform bdc_dynpro  using 'SAPLIQS0'                   '7204'.
           perform bdc_field   using 'BDC_OKCODE'                 '=PEND'.
    ENDIF.
    perform bdc_dynpro using 'SAPLIQS0' '7204'.
    perform bdc_field using 'BDC_OKCODE' '/00'.
    CONCATENATE 'VIQMSM-QSMNUM(' wa_qmsm_cntr ')' INTO wm_qmsm_qsmnum.
    CONCATENATE 'VIQMSM-MNGRP(' wa_qmsm_cntr ')' INTO wm_qmsm_mngrp.
    CONCATENATE 'VIQMSM-MNCOD(' wa_qmsm_cntr ')' INTO wm_qmsm_mncod.
    CONCATENATE 'VIQMSM-MATXT(' wa_qmsm_cntr ')' INTO wm_qmsm_matxt.
    perform bdc_field using wm_qmsm_qsmnum wa_qmsm-qsmnum.
    perform bdc_field using wm_qmsm_mngrp wa_qmsm-mngrp.
    perform bdc_field using wm_qmsm_mncod wa_qmsm-mncod.
    perform bdc_field using wm_qmsm_matxt wa_qmsm-matxt.
    wa_qmsm_cntr = wa_qmsm_cntr + 01.
    ENDLOOP.
    CALL TRANSACTION 'IQS2' USING wt_bdc
    MODE 'N' UPDATE 'A'  MESSAGES INTO P_MESSTAB.
    The same code is used in modify mode also. web application is sending all 3 lines in modify mode even if single line is modified. It is already decided to send all rows back from web application to SAP in same sequence. It is working fine if i comment 5 lines which is starting with *. But in modify mode, how can i ensure that correct row is modified? and how can i achieve problem of large no of lines on screen?Please suggest?

    Hi yogesh,
    how can i ensure that correct row is modified?
    1. For this we need to know two things ;
       a) the database table in which the entries are already stored
       b) the sequence in which they are displayed in the transaction.
    2. So before changing any line, we need to compare (the primary key values / important values)
       a) as per the database table and as per the incoming data from web application (using bapi)
      b) if the match is ok, it means that particular row was not modified, else modified.
    how can i achieve problem of large no of lines on screen?
    1. For this I am  not sure about the transaction and its screen. Manytimes for appending row on the screen,
      there is a PLUS + button on the grid toolbar. So for every entry, (inspite of some empty/filled rows already visible on the screen), we should use the + button, and this new row always appears on the top i.e. row number 1.
    hope this helps.
    regards,
    amit m.

  • Word Links not updating when row number changes in excel

    Hi,
    I have a huge excel file with employee name,code,dob etc as fields.I linked it to word documents using paste special and macros.Everything works fine and word also updates with changes in excel file, but problem arises when in excel , data is added in the
    middle rather than at the end of the file. This changes the row numbers of all the employees.Hence when I  open corresponding word document, some one else's details open. So now i have to edit links in word...office->prepare->edit links, Here i
    have an option called ITEM IN FILES... this is where the problem occurs...It requires mentioning the row no of the corresponding pasted link...but when i change data in excel and row no changes...this should be automatically detected by Word and row number
    should be updated there.Please help me find a way to resolve this.This is what it looks like....
     Data for VC!R1C2:R2C13
    I want R1 and R2 to change automatically if I change rows in excel file.
    Thank you

    Instead of specifying a cell range in the LINK field, name the range in Excel, then use the range name in the LINK field.
    For example, instead of:
    VC!R1C2:R2C13
    you might have:
    VC!MyRange
    in Word.
    That way, the LINK will point to the named range, regardless of how many rows and/or columns are added/deleted before it. Furthermore, if you expand or contract the range (e.g. by adding/deleting columns between the first & last column), the
    named range and, hence the linked range, will likewise expand/contract.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • How to give a checkbox the value "row number" (like [row selector])

    I like to define a checkbox with htmldb_item.checkbox and give the checkbox the value 'row number'.
    It has to be the row number as displayed. Therefore I cannot use rownum or row_number() because the htmldb sorting functionality change the sequence after the row numbers are given.
    How can I give the checkbox this value, or as alternative how can I get the current row (checkbox element) in javascript from the checkbox onclick event.

    Vikas,
    Thanks a lot.
    This works.
    I use this number also to construct javascript and I walk in problems which are also solved now.
    therefore for anyone else who also want to use '#ROWNUM#'. keep in mind that for the sql #ROWNUM# is just a string and should be treated as a string therefore use quotes around it. The #ROWNUM# string is translated after executing the query, when the page is constructed from the result of the query.
    Fred.

  • Calculating the row number with DAX

    Hello,
    Can somebody help me to obtain the row number in a calculated column using DAX (PowerPivot 2013) ?
    I do not have any column that would contain unique values (would be easy in that case !). I just want to obtain a different value in each row.
    Thank you.

    Hi DP17000,
    According to your description, you need to add a column with the RowNumber to your Pivot table by using DAX, right?
    Based on my tested, we can use a ranks function to achieve your requirement.
    =RANKX(case0305,[amount],[amount],0,dense)
    Reference
    https://msdn.microsoft.com/en-us/library/gg492185.aspx?f=255&MSPPError=-2147217396
    http://ayadshammout.com/2013/02/19/dax-rankx-function-scenarios/
    Regards,
    Charlie Liao
    TechNet Community Support

  • A system bug regarding to "base row number"

    Dear All,
    I may have found a system bug, which is causing problems.
    Would anyone have a way around? or should I raise the issue to SAP through our reseller?
    Basically, the "base row numbers", in some cases, can incorrectly relate to the row numbers in base documents.
    One example:
    We have 3 lines on one Sales order
    row number       |  Item code       
    1                       |   C001    
    2                      |     B002
    3                       |     A003
    If I need to duplicate row 2 (B002) on the order, or insert a new line in between the 3 items, to change the order to
    (Similiarly, you could double click on the column title i.e. Item code to sort the grid table)
    row number       |  Item code       
    1                       |   C001    
    2                      |     B002
    3                      |     B002
    4                       |     A003
    Then I copy the order to a Delivery, you will see the "base row number" in the database like so, which is wrong
    row number     | base row |  Item code       
    1                      |         1|   C001    
    2                      |          4|     B002
    3                      |          2|     B002
    4                      |          3|     A003
    This issue is causeing many problems (as existing in all documents) for reporting in terms of linking documents.
    Because there could be same items put on order more than once, we cannot use "item code" to link/track line details etc.
    Any idea? or I would be glad to see I was wrong.
    Many thanks
    Yang
    Edited by: Y on Nov 17, 2009 11:10 AM

    It is not a bug. In the documents two data describe the position of the row:
    1. The LineNum is the number assigned to the line when it is generated.  It does not change when you insert a line before it. The Base Row Number refer to this number, because it must point to the same line even when a new line is inserted before it.
    2. The VisOrder is the actual sequence number of the line in the document. It may change when you insert/delete lines in the document.
    What you may assume problem is that you can not make visible the LineNum by Form Settings. But you can define a UDF and an FMS setting it to the LineNum:
    Select $[RDR1.LineNum]

  • Is it possible to obtain row #

    when inserting a new record is it possible
    to obtain the row # of the just inserted
    record. Im using MS SQL 7.0
    Thank u for your time

    you can use getRow() to retrieve the current row number. Huh? I would guess that getRow() returns the row number in the result set, not in the table.
    And there is this from the suggested link...
    ResultSet.getRow() may return zero at certain, or even all, positions. Among other things, this means that usage of the valued ResultSet.last(), ResultSet.getRow() sequence to obtain the number of rows is not reliable across databases, or even drivers for the same database.

  • Graph canvas size problem - missing rows

    Hi all,
    we have a simple horizontal bar graph based on a view, with just one total value pr. company showing.
    Problem is, if we set the canvas size too a small value, e.g. 400x400, then instead of resizing bars down so that all rows are shown, the graph starts to omit rows at the end!
    Even when enabling "Zoom and Scroll", we're still missing those rows.
    Only way to make sure all rows are displayed is to increase canvas size to a large enough value. Problem is, the number of rows is dynamic - so "big enough" might change over time....
    Is this a bug in the OBIEE graph component, or are we missing something here?
    Regards,
    -Haakon-

    hi,
    can anybody give me a hand.i'm in urgent!
    my request is how to display line graph according to the table rows.
    for example:in the table,i have 100 records(values),then the table range size is 10,so,each time when i scroll down the table,then graph will oso change to the another 10 records(values).
    while,i m adding the graph using jheadstart(10g).
    thank you very much.

  • Returns wrong row number with ENTER key in JTable...

    I am having a problem to get exact row number ofJTable when ENTER key is pressed.
    table.getSelectedRow() always retuns one more value when ENTER key is pressed(fired). like
    if i have 5 rows in a table and when my focus is on 1st row and then i press enter key focus moves to next row and it returns 1 instead of 0 for the 1st row.
    I have written a code bellow, please check it out and tell me why it happens. Please click on Add Row button for creating rows in table.
    import javax.swing.*;
       import javax.swing.table.*;
       import java.awt.*;
       import java.awt.event.*;
       import java.util.Vector;
       class TableTest extends JFrame {
         MyTableModel myModel;
         JTable table;
         JButton button;
         JButton buttonQuery;
         int count = 0;
         public TableTest() {
           myModel = new MyTableModel();
           table = new JTable(myModel);
           table.setPreferredScrollableViewportSize(new Dimension(500, 200));
           JScrollPane scrollPane = new JScrollPane(table);
          table.addKeyListener(new KeyAdapter(){
              public void keyTyped(KeyEvent ke)
                if(ke.getKeyChar() == ke.VK_ENTER){
                  System.out.println(table.getSelectedRow());
           getContentPane().add(scrollPane, BorderLayout.CENTER);
           getContentPane().add(button = new JButton("Add Row"),
           BorderLayout.SOUTH);
           getContentPane().add(buttonQuery = new JButton("Query"), BorderLayout.NORTH);
           button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          Object [] aRow = new Object [8];
         String aRow1;
         for (int i=0; i<5; i++) {}
         myModel.addRow(aRow);
       buttonQuery.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           System.out.println(myModel.getRowCount());
           System.out.println(myModel.getValueAt(1, 3));
       addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
           System.exit(0);
       class MyTableModel extends AbstractTableModel {
       protected final String[] headers =
       { "No", "Vehicle No", "Date of Loss", "Image Type", "Image Description", "Claim Type", "Scan Date", "User Id" };
       Vector data;
       MyTableModel() {
        data = new Vector();
       public int getColumnCount() {
         return headers.length;
       public int getRowCount() {
        return data.size();
       public Object getValueAt(int row, int col) {
       if (row < data.size() && col < 8) {
         Object [] aRow = (Object []) data.elementAt(row);
       return aRow[col];
       } else {
         return null;
       public void addRow(Object [] aRow) {
         data.addElement(aRow);
        fireTableRowsInserted(data.size()-1, data.size()-1);
       public static void main(String[] args) {
       TableTest frame = new TableTest();
       frame.pack();
       frame.setVisible(true);
       }Regards..
    jaya

    Dear Jaya,
    I have a look at your code. And modified a bit as well to really check the getSelectedRow(). Here's the modified code: I think when key event fired, the table row is changed and then is displays the get selected row. You can check this, if you are on the last row, and you press enter, it displays 0, it means first it changes the row and then displays the selected row which is obviously rowNumber+1.
    Hope it helps.
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Vector;
    class TableTest
        extends JFrame {
      MyTableModel myModel;
      JTable table;
      JButton button;
      JButton buttonQuery;
      JButton buttonSelectedRow;
      int count = 0;
      public TableTest() {
        myModel = new MyTableModel();
        table = new JTable(myModel);
        table.setPreferredScrollableViewportSize
            (new Dimension(500, 200));
        JScrollPane scrollPane = new JScrollPane(table);
        table.addKeyListener(new KeyAdapter() {
          public void keyTyped(KeyEvent ke) {
            if (ke.getKeyChar() == ke.VK_ENTER) {
              System.out.println(table.getSelectedRow());
        getContentPane().add(scrollPane, BorderLayout.CENTER);
        getContentPane().add(button = new JButton("Add Row"), BorderLayout.SOUTH);
        getContentPane().add(buttonQuery = new JButton("Query"), BorderLayout.NORTH);
        getContentPane().add(buttonSelectedRow = new JButton("Get Selected Row Number"), BorderLayout.NORTH);
        button.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            Object[] aRow = new Object[8];
            String
                aRow1;
            for (int i = 0; i < 5; i++) {}
            myModel.addRow(aRow);
        buttonSelectedRow.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            System.out.println("Selected Row is: " + table.getSelectedRow());
        buttonQuery.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            System.out.println(myModel.getRowCount());
            System.out.println(myModel.getValueAt(1, 3));
        addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            System.exit(0);
      class MyTableModel
          extends AbstractTableModel {
        protected final String[] headers = {
            "No", "Vehicle No", "Date of Loss", "Image Type", "Image Description",
            "Claim Type", "Scan Date", "User Id"};
        Vector data;
        MyTableModel() {
          data = new Vector();
        public int getColumnCount() {
          return headers.length;
        public int getRowCount() {
          return data.size();
        public Object getValueAt(int row, int col) {
          if (row < data.size() && col < 8) {
            Object[] aRow = (Object[]) data.elementAt(row);
            return aRow[col];
          else {
            return null;
        public void addRow(Object[] aRow) {
          data.addElement(aRow);
          fireTableRowsInserted(data.size() - 1, data.size() - 1);
      public static void main(String[] args) {
        TableTest frame = new TableTest();
        frame.pack();
        frame.setVisible(true);

  • How to get row number in the fetch row itself in Sql Query ?

    Hi,
    i am fetching some rows from a sql query . Is there any way to get row number as well in each row while all rows are fetched ?
    like this :
    RowNum data1 data2
    1 abc ere
    2 bnh ioi

    Hello
    Ofcourse you can get the rownum inside a query, just keep in mind that the rownum is the number of order in which the records were fetched from the table, so if you do an order by, the rownum will not be sequential, unless you query the information in a subquery first.
    SELECT rown, col1, col1
    FROM table
    Or
    SELECT rownum, col1, col2
    FROM (SELECT col_1, col_2 FROM table ORDER BY col1)
    Regards
    Johan

  • Find row number of first cell in a relative range that is less than $B$3

    Thanks for any help. I've spent hours searching, trying, and reading iWork Help
    Example:   $B$3 = 3
    Column C
    1:  9
    2:  2
    3:  9
    4:  2
    5:  3
    6:  9
    7:  9
    Find the first occurrence that is less than $B$3 (=3) in the range C3:C6. Return the row # (relative to the range, or actual row number, I don't care)
    Fill Down the formula, so the next cell looks at the range C4:C7
    In this case, I want it to return Row 4 (not 5 or 2)
    Tried this with MATCH (last argument -1 or 1) which almost works, but if it finds an exact match, it returns that row (5) instead of the first one (4)

    The single formula in D2, filled down that column, returns the row number of every row where the value in column C is less than or equal to the value in $B$3.
    The second formula, which I placed in B4, but which can go wherever it's needed, searches a limited range of column D for the minimum value in that range.
    In the example, based on your initial question, the range is three cells.  In B4, it's D2:D4; in B5 it's D3:D5, etc., with Numbers automatically adjusting the cell references as the formula is filled down the column. In each case, the formula returns the minimum value it finds in the three cell range, which is the row number on which the value in column C first meets the condition (less than or equal to $B$3) within that three cell range.
    In the second example, the formula retrieves the same value (the row number) as above, but instead of displaying it, uses it as the row-offset value in an OFFSET statement to return the Date from the row where the row number was collected.
    NOTE: Looking back at it, I see that in my rush to other duties I made an error in this formula, setting the row offset too high. Revise the formula as shown below to get the date from the correct row:
    Existing: =IF(MAX(D2:D4)=0,"",OFFSET($A$1,MIN(D2:D4),0))
    Revised: =IF(MAX(D2:D4)=0,"",OFFSET($A$1,MIN(D2:D4)-1,0))
    You wrote:
    If I'm following the logic, it would require one column (like D in this example) for every set of rows searched (in my example, B5:B15  filled down, so the next search is B6:B16 and so on).
    No. Provided the values of X and Y are constant for each set of searches, you'll need an auxiliary column for each column of values to be searched. One auxiliary column is used to mark the rows in which the value in B meets the condition ">x", the second to mark the rows where the value in C meets the condition "<y".
    The search formula (above) searches a subset of its column and returns the lowest row number where the condition for that column is met,and either displays that number or uses it to return and display a date.
    Regards,
    Barry

Maybe you are looking for

  • Schedule and Items program is not picking the new Billing lines created PN

    Hi Gurus, I am using version 11.5.10. I am populating the data into Property manager billing lines of lease thru API. Once the Lines are inserted I am calling the Schedule and items program to for authorizatio. My program is not picking up lines crea

  • XSLT with DreamWeaver

    I am reading that we should be using XSLT for our web sites that we create and run. Does anyone have a comment for or against this option? Thanks

  • ALV to select more than one column by row using set_table_for_first_display

    Hello everyone, I am developing an application (ALV OO) to select more than 1 column by row ( one ). This is an a holiday application so the idea is: -One column will be the day, and the row will be the user. So I am trying to select more than one da

  • Problem with Multicolumn Listbox Scrolling

    Hello... Can anybody please tell me how to scroll according to row no. in multicolumn listbox?                 I'm working on a VI where I have to test some conditions which are depending upon RPMs... For testing ease I have sorted the conditions acc

  • Missing tmp file

    Using OSX Server 10.5.3 on a Mac Pro. End of the school year, so I wanted to run my server updates, as I am behind. I get an failed install message, "the installer could not create the folder "private/tmp/MacOSXServerUpd10.5.4.pkg.1849c19JVv" Sure en