Sort by Last column

Hello
I want to sort in descending order by sales and 2005
     Calyear               
         2002     2003   2004     2005
Material1     2          5566     400
Material2          5     5     300
Material3                    200
Material4     700          200     100
How its possible?
Pints are guaranteed!

Hi Aleksandrs,
If you use a structure for the CALYEAR and have the offests..
You could specify the exact column you want the condition on..
Hope this helps
Ashish..

Similar Messages

  • How to get last column used in report sorting?

    hi,
    how to get last column used in report sorting?
    simon

    How to identifiy which column was sorted having different reports on page?
    just use:
    'YOUR_STATIC_REGION_NAME' instead of p_static_id,
    :APP_ID for p_app_id,
    :APP_PAGE_ID for p_page_id
    :APP_USER_ID for p_app_user.
    and dont forget to grant SELECT on #OWNER# to APEX_030200.WWV_FLOW_PREFERENCES$
    good luck and thank you Juergen.Schuster
    Simon

  • I have downloaded and installed the latest version of numbers on my mac. Everytime I save and then try to reopen that document, I receive a message telling me that I need a new version of numbers. Also, when I try to sort the date column, it sorts out of

    I have downloaded and installed the latest version of numbers on my mac. Everytime I save and then try to reopen that document, I receive a message telling me that I need a new version of numbers. Also, when I try to sort the date column, it sorts out of order. The last version sorted fine.

    Welcome to Apple Support Communities
    When you install the new iWork version, the old iWork version is kept, so it looks like you are opening your old version.
    To fix this, open a Finder window, choose Applications in the sidebar and drag the new Numbers version to the Dock, so you can access to it quickly. Open all documents from this version. I don't recommend you to delete the old Numbers version in case you need it.
    Respecting to the second question, you will get better answers in the Numbers for OS X forum

  • How can I get the address book to sort by "Last" name (using v 31.3.0).

    After a computer crash, I had to load Thunderbird (v31.3.0) back into my machine running Windows 8.1, and I successfully imported my address book back up file into Thunderbird (v31.3.0).
    My problem is that I don't see an option to sort the address book by "Last" name, which was available with the version of Thunderbird I had before the crash.
    How can I get the address book to sort by "Last" name?

    In 'Address Book'
    Select address book
    'View' > 'Show name as' > 'Last/First'
    The you can sort by Name.
    Either click on 'Name' column header to change sort order,
    If reversed, then click on 'Name' column header again to reverse the order.
    Or
    'View' > 'Sort By' > choose 'Name' and 'Ascending'

  • How to enforce always sorting on a column in a TableView?

    Hello,
    I have a requirement to always sort on a column in a TableView.
    So basically, I need a TableColumn's SortType go from Ascending to Descending and back to Ascedning when user clicks on a column header repeatedly.
    I guess that means making sure a TableView's SortOrder list is not empty. Am I right?
    I tried to listen to SortOrder list changes like below:
    tableView.getSortOrder().addListener(new ListChangeListener<TableColumn<String, ?>>() {
         @Override
         public void onChanged(final javafx.collections.ListChangeListener.Change<? extends TableColumn<String, ?>> arg0) {
    if (tableView.getSortOrder().size() > 0) {
                   // fine. nothing to do
              else {
    // add the removed column back
    Is this the right approach?
    I'm not sure how to use arg0 and add the removed column back.
    Can people with experience in this area provide some sample code?
    Thanks.

    The solution I came up with was to save the last column added to the SortOrder list to a map.
    Whenever the SortOrder list becomes empty, I add the last saved column back to the SortOrder list.
    That seems work.
    Edited by: 925616 on Aug 3, 2012 3:33 PM
    Edited by: 925616 on Aug 3, 2012 3:33 PM

  • Sorting NULLS LAST in BI Publisher

    Hi all,
    Is there a way that I can sort column in descending order with NULLS LAST? Need to do that in BIP not in a querry.
    Thanks in advance,
    Stefan

    hi all,
    thx for the reply.
    i can display the data in all column. the point is i can't sort using EventParentName column.
    maybe some of you has experience like this, please share with me.
    thx
    dityo
    Edited by: user13655637 on Apr 12, 2011 7:17 PM

  • Table Sorting based on Column Selection

    Dear All,
    I am using an AbstractTableModel. I would like to implement the sorting based on Column selection. Could anyone help me in this please.
    Thanks in advance,
    Regards
    Irfaan

    check this
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.UIManager;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.TableColumnModel;
    import java.awt.Component;
    import java.awt.GridLayout;
    import java.awt.Insets;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.util.Hashtable;
    public class TableSorter extends JPanel
        private boolean             DEBUG       = false;
        private Object[]            columnNames = { "First Name", "Last Name", "Sport", "# of Years",
                                                    "Vegetarian"};
        private Object[][]          data        = { { "Mary", "Campione", "Snowboarding", 1, 2 },
                { "Alison", "Huml", "Rowing", 3, 4 }, { "Kathy", "Walrath", "Knitting", 5, 9 },
                { "Sharon", "Zakhour", "Speed reading", 6, 10 }, { "Philip", "Milne", "Pool", 7, 11 },
                { "Isaac", "Rabinovitch", "Nitpicking", 8, 12 }, };
        private SortFilterModel     m_modSortFilterModel;
        private TableColumnModel    m_modColumnModel;
        private TableHeaderRenderer m_btnSorterRenderer;
        protected boolean           m_bAbCOC    = true;
        JTable                      table       = new JTable();
        public TableSorter()
            super(new GridLayout(1, 0));
            m_modSortFilterModel = new SortFilterModel();
            m_modSortFilterModel.addMouseListener(table);
            table.setModel(m_modSortFilterModel);
            m_btnSorterRenderer = new TableHeaderRenderer();
            m_modColumnModel = table.getColumnModel();
            for (int i = 0; i < columnNames.length; i++)
                m_modColumnModel.getColumn(i).setHeaderRenderer(m_btnSorterRenderer);
            JScrollPane scrollPane = new JScrollPane(table);
            add(scrollPane);
        private class SortFilterModel extends AbstractTableModel
            int[]           indexes;
            ATSTableSorter  sorter;
            public String[] tableHeadersArray;
            boolean         isAscent = true;
            public void addMouseListener(final JTable table)
                table.getTableHeader().addMouseListener(new MouseAdapter()
                    public void mouseClicked(MouseEvent event)
                        int tableColumn = table.columnAtPoint(event.getPoint());
                        m_btnSorterRenderer.setPressedColumn(tableColumn);
                        m_btnSorterRenderer.setSelectedColumn(tableColumn);
                        if (TableHeaderRenderer.DOWN == m_btnSorterRenderer.getState(tableColumn))
                            isAscent = true;
                        else
                            isAscent = false;
                        // translate to table model index and sort
                        int modelColumn = table.convertColumnIndexToModel(tableColumn);
                        sortByColumn(modelColumn, isAscent);
            public Object getValueAt(int row, int col)
                int rowIndex = row;
                if (indexes != null)
                    rowIndex = indexes[row];
                return data[rowIndex][col];
            public void setValueAt(Object value, int row, int col)
                int rowIndex = row;
                if (indexes != null)
                    rowIndex = indexes[row];
                super.setValueAt(value, rowIndex, col);
            public void sortByColumn(int column, boolean isAscent)
                if (sorter == null)
                    sorter = new ATSTableSorter(this);
                sorter.sort(column, isAscent);
                fireTableDataChanged();
            public int[] getIndexes()
                int n = getRowCount();
                if (indexes != null)
                    if (indexes.length == n)
                        return indexes;
                indexes = new int[n];
                for (int i = 0; i < n; i++)
                    indexes[i] = i;
                return indexes;
            public int getRowCount()
                return data.length;
            public String getColumnName(int c)
                return columnNames[c].toString();
            public int getColumnCount()
                return columnNames.length;
            public Class getColumnClass(int col)
                switch (col)
                case 0:
                    return String.class;
                case 1:
                    return String.class;
                case 2:
                    return String.class;
                case 3:
                    return Integer.class;
                case 4:
                    return Integer.class;
                          default:
                    return Object.class;
        class ATSTableSorter
            SortFilterModel model;
            public ATSTableSorter(SortFilterModel model)
                this.model = model;
            public void sort(int column, boolean isAscent)
                int n = model.getRowCount();
                int[] indexes = model.getIndexes();
                for (int i = 0; i < n - 1; i++)
                    int k = i;
                    for (int j = i + 1; j < n; j++)
                        if (isAscent)
                            if (compare(column, j, k) < 0)
                                k = j;
                        else
                            if (compare(column, j, k) > 0)
                                k = j;
                    int tmp = indexes;
    indexes[i] = indexes[k];
    indexes[k] = tmp;
    public int compare(int column, int row1, int row2)
    Object o1 = model.getValueAt(row1, column);
    Object o2 = model.getValueAt(row2, column);
    if (o1 == null && o2 == null)
    return 0;
    else if (o1 == null)
    return -1;
    else if (o2 == null)
    return 1;
    else
    Class type = model.getColumnClass(column);
    if (type.getSuperclass() == Number.class)
    return compare((Number) o1, (Number) o2);
    else if (type == String.class)
    return ((String) o1).compareTo((String) o2);
    else
    return ((String) o1).compareTo((String) o2);
    public int compare(Number o1, Number o2)
    double n1 = o1.doubleValue();
    double n2 = o2.doubleValue();
    if (n1 < n2)
    return -1;
    else if (n1 > n2)
    return 1;
    else
    return 0;
    class TableHeaderRenderer extends JButton implements TableCellRenderer
    public static final int NONE = 0;
    public static final int DOWN = 1;
    public static final int UP = 2;
    int pushedColumn;
    Hashtable state;
    public TableHeaderRenderer()
    pushedColumn = -1;
    state = new Hashtable();
    setMargin(new Insets(0, 0, 0, 0));
    setHorizontalTextPosition(LEFT);
    public Component getTableCellRendererComponent(JTable table, Object value,
    boolean isSelected, boolean hasFocus,
    int row, int column)
    setText((value == null) ? "" : value.toString());
    setBorder(UIManager.getBorder("TableHeader.cellBorder"));
    boolean isPressed = (column == pushedColumn);
    getModel().setPressed(isPressed);
    getModel().setArmed(isPressed);
    return this;
    public void setPressedColumn(int col)
    pushedColumn = col;
    public void setSelectedColumn(int col)
    if (col < 0)
    return;
    Integer value = null;
    Object obj = state.get(new Integer(col));
    if (obj == null)
    value = new Integer(DOWN);
    else
    if (((Integer) obj).intValue() == DOWN)
    value = new Integer(UP);
    else
    value = new Integer(DOWN);
    state.clear();
    state.put(new Integer(col), value);
    public int getState(int col)
    int retValue;
    Object obj = state.get(new Integer(col));
    if (obj == null)
    retValue = NONE;
    else
    if (((Integer) obj).intValue() == DOWN)
    retValue = DOWN;
    else
    retValue = UP;
    return retValue;
    private static void createAndShowGUI()
    JFrame frame = new JFrame("TableDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    TableSorter newContentPane = new TableSorter();
    newContentPane.setOpaque(true); // content panes must be opaque
    frame.setContentPane(newContentPane);
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args)
    javax.swing.SwingUtilities.invokeLater(new Runnable()
    public void run()
    createAndShowGUI();

  • How to get the last column info of the given table

    Hi All,
    I want to get the last column information like :
    column name, datatype of the last column in the given
    table use PL statement. Please help.
    Thanks,
    JP

    SCOTT@orcl SQL> desc emp
    Name                                                  Null?    Type
    EMPNO                                                 NOT NULL NUMBER(4)
    ENAME                                                          VARCHAR2(10)
    JOB                                                            VARCHAR2(9)
    MGR                                                            NUMBER(4)
    HIREDATE                                                       DATE
    SAL                                                            NUMBER(7,2)
    COMM                                                           NUMBER(7,2)
    DEPTNO                                                         NUMBER(2)
    SCOTT@orcl SQL> select column_name, data_type from user_tab_columns
      2  where table_name = 'EMP'
      3  and column_id = (select max(column_id) from user_tab_columns
      4  where table_name = 'EMP');
    COLUMN_NAME                    DATA_TYPE
    DEPTNO                         NUMBER
    SCOTT@orcl SQL>                                                                      

  • Error importing text file into SQL Server when last column is null

    Hello all. Happy holidays!
    I'm trying to import a text file into a SQL Server table, and I get the error below when it gets to a row (row 264) that has null in the last column. I'm guessing the null jumbles up the delimiters somehow. The nulls are not errors, and I need to import
    them into the table with the rest of the rows. Any idea how I can do that?
    Thanks!
    [Flat File Source [1]] Error: Data conversion failed. The data conversion for column "XYZ" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
    [Flat File Source [1]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "output column "XYZ" (178)" failed because error code 0xC0209084 occurred, and the error row disposition on "output column "XYZ"
    (178)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
    [Flat File Source [1]] Error: An error occurred while processing file "ABC.txt" on data row 264.
    [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "Flat File Source" (1) returned error code 0xC0202092.  The component returned a failure code when the pipeline engine called PrimeOutput().
    The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
    WeeLass

    Hi WeeLass,
    The error that” Data conversion failed. The data conversion for column "XYZ" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".” is generally error message, and the error indicates
    that there is data type mismatch issue between the input columns and the output columns.
    Based on your description, the issue is that you trying to convert a column contains empty value from string to integer data type for the output column "XYZ" in Flat File Source [1]. Please note that we cannot type an empty value as integer data
    type column value, so the error occurs.
    To fix this issue, just as you did, we should convert the data type for the output column "XYZ" in Flat File Source [1] back to DT_WSTR or DT_STR, then use a derived column task to replace the current column (UBPKE542). But the expression should
    be like below:
    LEN(TRIM(UBPKE542)) > 0 ? (DT_I8)UBPKE542 : NULL(DT_I8)
    In this way, the data type of the column in SQL table would be int, and the empty value would be replaced with NULL.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Unable to filter the report by clicking the last column's name

    Hi,
    I have interactive report page having lots of column. All columns were not fitting in the screen so I added a code in the region--- header and footer section---
    <div style="overflow: auto; width: 1220px; height: 700px;">
    I got a scroll bar at the bottom. But a new problem arised. When I am trying to filter the report by clicking the column name in the report page , a popup is opening for the first column but the pop up is not opening for the last column. For the middle columns, the popup is opening but not below its name. This pop is for filtering the report based on that columns.
    Please give some idea to fix this bug.
    Thanks,
    Chandra Bhanu

    You could try to display as many columns as fit your screen, and put the rest of your columns as form fields in a detail view, somewhat like this:
    http://apex.oracle.com/pls/apex/f?p=vincentdeelen:report_details_in_iframe_v1
    Please tell the steps how to do it.
    Thanks,
    Chandra Bhanu

  • How do I create a new row on tab out of the last column, last row?

    JDev 11.1.2.1.0.
    I've seen a few topics on this but none that I think were really very good solutions.
    Use Case:
    On tab out of the last column in the last row, a new row should be added to the end of the table. Bonus points for setting the focus to the first <af:inputText> of the newly created row.
    Complications:
    1. I'm having a heck of a time trying to find a function that returns the column's displayed index. Sadly, <column binding>.getDisplayIndex() returns -1 unless the user has manually re-ordered the column.
    2. Value Change Listeners only fire if there is a value change. Guess that means I need to do client/server listeners to check each and every <af:inputText> for a tab press?
    3. I'm not even going to get into setting the focus. With all the templates, regions, etc. going on, it's dang near impossible.
    Any ideas on how to attack this one?
    Will

    Hi,
    You will need to use the Run Engine Installation Wizard found on the Tools menu. In addition you need to create a installation set for the operator interface.
    Look at Chapter 16 Distrubuting TestStand ( chapter 17 for version 2).
    Once you have created your installation, install is on your new system.
    The serial number etc is part of the process model. When you run the entry point 'Test UUTs' the PreUUT callback is executed which asks the user for the serial number.
    Hope this helps
    Ray Farmer
    Regards
    Ray Farmer

  • I can't sort a single column only (ignoring the next column)

    I can't sort a single column only (ignoring the next column) in NUMBERS

    Numbers sorting follows a database model in which each row is a 'record' rather than a collection of unrelated data items. When a table is sorted, the integrity of the individual records (rows) is maintained.
    If you need to sort a single column, that column (or its data) must be separated from the rest of the table.
    That can be done using copy/paste (as described above by Wayne), or by taking the column to be sorted out of the table, dropping it on the sheet to form a new, single column table, doing the sort, then returning the column to the original table.
    The 3 1/2 step process takes longer to describe than to do.
    Regards,
    Barry

  • Finder in column view has no expander divider on the last column

    I deal with a lot of graphics on my computer and I have a lot of subfolders. While in finder in column view there is no expanding divider for the last column when it is showing a graphic. When I first open a photo or graphic in finder the last column shows the graphic smaller than regular size. In SL there was a column divider to expand only that last column so I could make the graphic larger to see it better. Now in Lion there is no divider on the right side of that last column to expand the last column where the grahic is showing. In order for it to finally expand I have to drag the right side of the Finder window all the way across my display until the bottom slider bar disappears and then that last column will expand. This is frustrating having to have my Finder all across my display just to get the graphic larger.
    Is there a way to get an expander divider to show up for the last column when viewing a graphic in column view? I know I can click on the "eye" icon to see it, but the column view will expand the graphic larger than 100% so I can see more details.
    Thanks for any and all help.
    Connie

    Yes, that is how my whole finder window expands across my display until the bottom slider bar disappears....then and only then does the last column expand. I have to have open as many as 8 columns to get to my graphic. Keeping the Finder window to a smaller size and using the bottom slide bar to navigate to the far right column is nice, but all I want is that far right column where my graphic is showing to expand so I can see it better.
    Thanks but what you suggest only resizes the whole Finder window until it can expand no further, then the last column expands the graphic. But then my whole display is a huge Finder window.

  • Birthday calendar on iCloud sort by last name first name like my contacts

    birthday calendar on iCloud sort by last name first name like my contacts

    Curiously, the most recently inputted entries do sort properly, as do all company entries.
    Does that mean "most recently inputted" AFTER you upgraded to Snow Leopard?
    If that is true, it would mean that something about your existing records before the upgrade, for the records that are people contacts (with first and last names) instead of business contacts, do not agree with Snow Leopard and/or Snow Leopard's version of Address Book.
    This may not be feasible, but if you exported the records with this problems and then imported them, maybe they will be re-inputted so that are properly sorted.
    If you use Time Machine, maybe you can use the +flying through space+ interface to restore one of the records with this problem to see if the restore process makes the record sort properly.

  • Issue with the last column stretching in ADF table

    There is an issue wherein when  I try stretching the last column of the ADF table to reduce its width it does stretch. But whenever I try stretching it back to this original position it doesn't despite having columnstretching attribute set to multiple and assign widths in percentages to columns . When I set the columnstretching attribute to none, the last column does stretch back and forth but on page load the table does not stretch to its full width despite having styleClass="AFStretchWidth". Now I dont want to be assigning fixed width in pixels to the columns. I would want the last column to stretch back and forth with columnstretching="multiple" and styleClass="AFStretchWidth". I see the same issue on components demo page as well. Tag Guide

    If you are trying that each column gets equally stretched based on the browser, its not possible as adf doesn't supports that.
    If your table is not stretching use styleClass="AFStretchWidth".
    But if all your columns are not stretching you can only try setting column widths + columnStretching property (where you can specify which column to stretch to fill all the spaces)
    Amit

Maybe you are looking for

  • HP PSC 1350 Series Printer will NOT print from the internet ~ but will print a word document.

    I have an HP PSC all-in-one PSC 1350 Series printer. the operating system is Windows XP to the computer it's USB connected to.   Earlier this week I was having troubles with the WIFI and IT helpers changed setting on the modem and the router.  Still

  • Printed PDF not able to copy text

    This is a weird problem I've had on a few distros, and I am trying to find out what is going on. When I print a PDF from Firefox, Kate, etc. to either cups-pdf or kprinter's pdf function and then open it in Adobe Acrobat, any text that I highlight an

  • HT201365 how do i reset to factory settings on iPhone 4S?

    how can i dump my iphone and set to factory settings?   I did a sync with itunes and after i noticed my camera and siri are gone!   its a 4s so i really hate not having these two features,  the guy at apple store had never seen it before and found my

  • EXPORT FILE을 SPLIT하여 받는 방법

    제품 : ORACLE SERVER 작성날짜 : 2002-04-19 EXPORT FILE을 SPLIT하여 받는 방법 ================================= PURPOSE 이 자료는 export시 2GB이상의 export dump file을 만들지 못하는 제약사항에 대하여 여러 export file로 나누어 받는 방법을 설명한다. Explanation !!! IMPORTANT: 이 방법은 반드시 KORN SHELL (KSH)

  • How to migrate iBooks after clean install

    I want to do a Yosemite 10.10.01 clean install on my MBPr. Before that I make a SuperDuper copy so that I can restore some date . Yet I do not know how to do  this with my iBooks. Can I just copy ~/Library/Containers/com.apple.BKAgentService/Data/Doc