Sort  only some columns

Hello
As some users asked for this feature, I wrote a short AppleScript doing the job.
You may grab it from my iDisk:
<http://idisk.mac.com/koenigyvan-Public?view=web>
in the folder:
ForiWork:ForNumbers:
Download the item: sort_column.zip with a click on the small down arrow displayed near the right edge of the window.
Yvan KOENIG (from FRANCE lundi 5 mai 2008 10:39:49)

Something like:
SQL> CREATE TABLE t (cola NUMBER, colb NUMBER, colc VARCHAR2(10));
Table created.
SQL> ALTER TABLE t ADD CONSTRAINT t_unq UNIQUE (cola, colb);
Table altered.
SQL> INSERT INTO T VALUES(1,null, 'Cola 1');
1 row created.
SQL> INSERT INTO T VALUES(null, 1, 'Colb 1');
1 row created.
SQL> INSERT INTO T VALUES(1, null, 'Cola 1');
INSERT INTO T VALUES(1, null, 'Cola 1')
ERROR at line 1:
ORA-00001: unique constraint (OPS$ORACLE.T_UNQ) violatedYou could add NOT NULL constraints for column c and d if required.
John

Similar Messages

  • How to disable sorting for some columns in a ALV GRID?

    Hi i have requirement where I have to disable sorting for some columns in a ALV GRID. i am using REUSE_ALV_GRID_DISPLAY function module.
    Can anybody help me. how to acieve this? Any code snippets will really be appreciated.

    Hi,
    I have tried this but not completely successful. I think this can be done using the OOPS method.
      DATA: it_event_exit TYPE  slis_t_event_exit.
      DATA: w_exit TYPE slis_event_exit.
      w_exit-ucomm = '&ODN'.
      w_exit-before = 'X'.
      CLEAR w_exit-after.
      APPEND w_exit TO it_event_exit.
      w_exit-ucomm = '&OUP'.
      w_exit-before = 'X'.
      CLEAR w_exit-after.
      APPEND w_exit TO it_event_exit.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program          = w_repid
          i_callback_top_of_page      = 'ALV_TOP_OF_PAGE'
          i_callback_html_top_of_page = 'ALV_HTML_TOP_OF_PAGE'
          i_callback_user_command     = 'USER_COMMAND'  <- User command form
          is_layout                   = wm_layout
          it_fieldcat                 = wt_fieldcat
          it_events                   = i_events
          it_event_exit               = it_event_exit    <- Need to fill
          it_sort                     = wt_sort
          i_default                   = 'X'
    Now you can capture this events in the user command
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
      IF r_ucomm = '&OUP' and rs_selfield-SEL_TAB_FIELD = 'Your field name'.
      ENDIF.
    ENDFORM.                    "user_command
    In this form you will get the function code in 'r_ucomm' and the field selected for sorting in 'rs_selfield-SEL_TAB_FIELD'. But reseting 'r_ucomm' will not work.
    May be somebody else can give some help on this.
    But this will work if you follow the oop method.
    Please see this document for more info.
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an easy reference for alv grid control.pdf
    Thanks
    Vinod

  • How to filter rows where multiple columns meet criteria, ignoring rows where only some columns meet criteria

    Hi All,
    Question: How do I filter rows out of a query where multiple columns are equal to a single question mark character?
    Background: I'm using SQL 2008 R2.  Furthermore, the part of my brain that helps me create less-than-simple queries hasn't been working for the last 4 days, apparently, and now I need help.
    We have about 4,000 rows in a table.  This data set was generated from an exported report, and many of the rows in the detail table were not actual data rows but were simply "header" rows.  For those table rows, most of the columns have
    a single question mark as the value.
    Some of the detail rows have one or more question mark values, too, so it's important that these rows don't get filtered out.
    When I include criteria like "WHERE col1 <> '?' AND col2 <> '?' AND col3 <> '?' AND col4 <> '?'", all rows with a question mark value for even a single one of those columns get filtered out.  How do I filter out rows
    where all columns 1-4 contain a question mark value?
    Thanks for your help,
    Eric

    I just tried to create to create a scenario for you. Please see ig you're looking for something like this.
    Create table test_Question_mark
    RecordID INT identity(1,1),
    Col1 varchar(10),
    Col2 varchar(10),
    Col3 varchar(10),
    Col4 varchar(10),
    insert into test_Question_mark (Col1, Col2, Col3, col4) values ('?','?','?','?')
    insert into test_Question_mark (Col1, Col2, Col3, col4) values ('?','??','?','?')
    insert into test_Question_mark (Col1, Col2, Col3, col4) values ('?','??','??','?')
    insert into test_Question_mark (Col1, Col2, Col3, col4) values ('??','??','??','??')
    insert into test_Question_mark (Col1, Col2, Col3, col4) values ('?','?','?','?')
    insert into test_Question_mark (Col1, Col2, Col3, col4) values ('??','test ??','??','??')
    insert into test_Question_mark (Col1, Col2, Col3, col4) values ('??','test ?','??','??')
    --drop table test_Questio_mark
    select * from test_Question_mark
    select * from test_Question_mark 
    WHERE 
    (CHARINDEX('?', Col1,1) > 0 AND CHARINDEX('?', Col1, CHARINDEX('?', Col1,1)+1) = 0) AND 
    (CHARINDEX('?', Col2) > 0 AND CHARINDEX('?', Col2, CHARINDEX('?', Col2,1)+1) = 0) AND 
    (CHARINDEX('?', Col3,1) > 0 AND CHARINDEX('?', Col3, CHARINDEX('?', Col3,1)+1) = 0) AND 
    (CHARINDEX('?', Col4,1) > 0 AND CHARINDEX('?', Col4, CHARINDEX('?', Col4,1)+1) = 0) 
    --drop table test_Questio_mark
    I hope above solution will help.
    Thanks!
    Ashish.

  • Change the colour of some column headers

    Hello All,
    I have a table with a few columns. I want to colour some of the column headers. I want to do this as these columns represent a KEY.
    Regards,
    Aayush

    Hi Aayush,
    As such there doesn't exist any way to colour only some column <b>headers</b>. The two existing options are :
    1) Show the data of some columns in a different colour. For this use text views (default one) as the column elements, and select one among the few built-in colours for the property 'semanticColor' of the text view.
    2) Attach a small image to the primary column's header, using the 'imageSource' property of the table header.
    Hope this helps,
    Best Regards,
    Nibu.

  • User need to have the ability to sort on Multiple columns

    Hi,
    I have one report on Dashboard, for that report user want to sort all columns at a time. But  i am not find any option to set like this.
    Right now i am able to sort only one column at time, Please let me know is there any option like this.
    Thanks in advance.
    Ramana

    Hi Ramana,
    This we cannot acheive in Analytics,You can do this in RPD BMM
    Below the url for more info,
    http://oraclebizint.wordpress.com/2008/04/28/oracle-bi-ee-101332-handling-sort-order-in-hyperion-essbase-931-evaluate-and-mdx/
    Mark if helps,
    Thanks,

  • 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

  • Do not allow to sort some columns in Alv Grid

    Dear friends,
    Please help me.
    I want to tell to the method set_table_for_first_display - make one of the columns not sortable.  Let's say the column name is "My Icon".
    What I mean with that is:
    when User will highlight column "My icon" and then click on sort buttons in the toolbar - no sort will happen on this column.
    I was trying to identify a field in lvc_s_sort which would say "do not sort this column".  Is there any?
    Or the only way to accomplish my task is to make sort buttons in the toolbar disable if column "My Icon" is clicked?
    gt_sort      TYPE lvc_t_sort.
        CALL  METHOD grid1->set_table_for_first_display
             EXPORTING i_structure_name = 'IT'
                       is_layout        = gs_layout
                       is_print         = gs_print
             CHANGING  it_outtab        = it
                       it_fieldcatalog  = gt_fcat
                       it_sort = gt_sort
    Thank you,
    Tatyana.

    Got a solution for ya, but you have to handle it thru coding.   So you will need to handle an event from your ALV grid. 
    First thing is that you need a local class as your event handler,  copy and paste this code.  Here we are using the name ALV_GRID for your alv object
    data: alv_grid       type ref to cl_gui_alv_grid.
    *       CLASS lcl_event_receiver DEFINITION
    class lcl_event_receiver definition.
      public section.
        methods handle_user_command
          for event before_user_command of cl_gui_alv_grid
          importing e_ucomm.
      private section.
    endclass.
    *       CLASS lCL_EVENT_RECEIVER IMPLEMENTATION
    class lcl_event_receiver implementation.
      method handle_user_command.
        data: icols type lvc_t_col,
              xcols like line of icols.
    * Get the currently selected column
        call method alv_grid->get_selected_columns
           importing
             et_index_columns = icols.
        read table icols into xcols index 1.
    * If the selected column is not one that should be sorted
        check xcols-fieldname = 'MATNR'.    "<-- Whatever columns that you don't want to allow sorting on.
    * Now check the function code, if sort ascending or descending, then give message
        check e_ucomm = cl_gui_alv_grid=>mc_fc_sort_asc
          or  e_ucomm =  cl_gui_alv_grid=>mc_fc_sort_dsc.
        message i001(00) with 'Can not sort on this column'.
    * Now set the UCOMM as if the user didn't click anything.
        call method alv_grid->set_user_command( space ).
      endmethod.
    endclass.
    data: event_receiver type ref to lcl_event_receiver.
    Also, you will need to set the event hanlder after calling the SET_TABLE_FOR_FIRST_DISPLAY.
      call method alv_grid->set_table_for_first_display
          changing
               it_outtab       = i_alv[]
               it_fieldcatalog = ifc[].
    *  Set the handler for ALV grid
      create object event_receiver.
      set handler event_receiver->handle_user_command for alv_grid.
    Just tested this, and works quite well.
    Regards,
    Rich Heilman

  • JTABLE - horizontal scrolling only for some columns

    Hi all,
    In my JTABLE I have to scroll the horizontal scrollbar only from column 5 to the last, the columns 0 - 4 should be fixed ! Is this possible ?
    Thanks in advance,
    Arpana

    Please see
    http://www.senun.com/Left/Programming/Java_old/Examples_swing/JTableExamples1.html
    http://www.senun.com/Left/Programming/Java_old/Examples_swing/src/examples/FixedColumnExample.java

  • Sorting by Multiple Columns in Numbers 3.0

    The new Numbers 3.0 update has moved some stuff around I need, and can not find. 
    Where is "Reorganize"?  The ability to sort multiple by columns.  (e.g. Sort Ascending Column A, THEN Column B, THEN Column C)
    mf

    this didn't work for me - i have item, then price, then checkbox. using the formula just gave an amalgamation of the three cells.
    Hi Saqib,
    The very idea of the workaround is to give an amalgamation, more often called "concatenation", and then just sort on the column containing the concatenated "string."
    As you've discovered, the =A&C&B formula only works if A,C, and B are all text. If you've got numbers in the mix then you have to pad them with leading zeros for them to sort as you want. That's easily done.
    Let's say C is a number and A and B are strings. You could put somethng like this in column D:
    =A&RIGHT("0000"&C,4)&B
    It's certainly not convenient to have to add a new column and put in a formula. But this is not *that* difficult as a workaround until the day multcolumn sort is added back in.
    SG

  • How can I sort alphabetically three columns?

    Hi to everybody!
    I've got some problems sorting alphabetically three columns. If I try to sort one column it changes also the others. I want three independent columns and each of them must be sorted out alphabetically.
    In Excel it's so easy: I just have to select the column and push the button "sort the column alphabetically". Why is that so difficult in numbers?
    Check it out: http://yfrog.com/j6screenshot01tj

    l,
    What is the nature of the content in the three columns? If the content is just data, and not calculations or the input to calculations, you can easily accomplish a single column sort in Numbers.
    I see from your screen shot that you are still in the Excel mindset. You have a large table with more rows and columns empty than occupied. To work most effectively in Numbers we usually use only as many rows and columns as necessary, and if we have data that is of another set and not related, we begin a new table.
    So, if your data meets the requirements of the first paragraph and you have trimmed away the excess rows and columns we can do the following: Click once on the label of the column you wish to independently sort. Then click again on this label and drag it up and away from the table to a blank area of the canvas. Perform the sort on the separated column. Then grab the sorted column in the same way as before and move it over the original table, watching the borders between columns highlight as you move over them. The double line between columns identifies the insertion point. When you have your sorted column in the right place, drop it back into the original table.
    Jerry

  • ALV List only 80 Columns when runinning as background job

    Hello Guys,
    I have a Problem with an ALV List.
    We use the FM REUSE_ALV_HIERSEQ_LIST_DISPLAY for a Document Journal.
    When I run it in foreground it works fine. But when I view the spool in background the list makes a break at excactly 80 signs, but the line size should be about 120.
    In the report the Line-Size is set correctly, even the print parameters seem to be ok. We are running it with X_65_255.
    I saw that there are some SAP Notes to this topic, but on our release (SAP_BASIS 700) the notes are already implemented.
    Has anyone a solution to this topic?
    Thanks and regards
    Roland

    Try this.
    [ALV List only 80 Columns when running in background job|https://forums.sdn.sap.com/click.jspa?searchID=25735042&messageID=5686003]

  • Set filter for only one column in tableview

    Hi
    i am using in MVC a htmlb:tableview with filter in only one column of 8.
    This is all working fine, except that the user can enter a searchsting in the filterfield for all columns, but in handle_event (of the controller) ; i only react to a text in the filterfield of column 4 and ignore all other filtertext , which were maybe entered in the other columns.
    My question:
    how can i  enter the filter only for one column, in a way that the user cannot enter any text in the filterfield of the other columns, only in column 4 ?
    my view:
    <htmlb:tableView id             = "requirements"
                     table          = "//model/pdst_reqs"
                     filter         = "APPLICATION"                
                     keyColumn       = "EXTID"
                     iterator        = "<%=model%>"
                     footerVisible   = "FALSE"
                     encode          = "TRUE"
                     visibleRowCount = "<%=model->rowcount%>"
                     width           = "100%"/>
    Best Regards
    Britta

    You can disbale the Filter for the particular column by setting the DISABLE_FILTER in the Iterator method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS. Here is the sample code
    method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS .
      CLEAR p_column_definitions.
      CLEAR p_overwrites.
      data tv_column TYPE TABLEVIEWCONTROL.
      tv_column-COLUMNNAME          = 'FLDATE'.
      tv_column-SORT                = 'X'.
      tv_column-EDIT                = 'X'.
      tv_column-ONCELLCLICK         = 'MyCellClick1'.
      tv_column-title               = 'Date '.
      APPEND tv_column TO p_column_definitions.
      CLEAR tv_column.
      tv_column-COLUMNNAME          = 'PRICE'.
      tv_column-horizontalAlignment = 'right'.
      tv_column-verticalAlignment   = 'middle'.
      tv_column-ONCELLCLICK         = 'MyCellClick2'.
      tv_column-title               = 'Currency'. 
      tv_column-EDIT                = 'X'.
      tv_column-DISABLE_FILTER      = 'X'.    " <-------Like this
      APPEND tv_column TO p_column_definitions.
    endmethod.
    Hope this will solve your problem.
    Raja

  • Access for update only one column in table?

    Hi all,
    My need is to grant access for update only one column c1 in table t1.
    I guess I should use view, could you please give me some example? Maybe other ideas?

    Hi,
    You can grant privileges on individual columns.
    GRANT   UPDATE (c1)
    ON      t1
    TO      grantee_name;Look up GRANT in the SQL language manual. Annoyingly, in recent editions of the manual, GRANT is not indexed, but it's in alphabetic order with all the other statements:
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_9013.htm#i2155015

  • Removing header, border for only single column in mx:DataGrid

    Hi,
        I am using Flex4 SDK and FlashBuilder4.
    I have a requirement where i need to remove column header, borders and grid lines for only last column in datagrid.
    It should look like there is no column present. This column will be used to show some icon for only selected row.
        Can any one suggest how to implement this. Please provide any sample if you can.
    Thanks

    hi Johnny, it was helpfull for me.
    With the given example i am still getting the grid line gaps with the selected row or hover color between verticle cells of the column.
    As gridlines can only be removed for complete datagrid not for a single column. is it possible ?
    Thanks

  • How to read only particualr columns from excel sheet to internal table

    Hi,
    I have and excel sheet which has around 20 columns, in which i want to read only 6 columns. They are at different column positions, means the 1st column, 6thcolumn, 8th column so on..
    Can we do this in sap? do we have any FM to do this?
    Thanks.
    Praveena.

    hi,
    Use the below logic to fetch the data into internal table..You need to read the data cell by cell and update the internal table,
    DATA l_count TYPE sy-tabix.
       CONSTANTS: lc_begin_col TYPE i VALUE '1',
                  lc_begin_row TYPE i VALUE '2',
                  lc_end_col   TYPE i VALUE '2',
                  lc_end_row   TYPE i VALUE '3000'.
      CLEAR p_i_excel_data. REFRESH p_i_excel_data.
    * Function module to read excel file and convert it into internal table
       CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
         EXPORTING
           filename                = p_p_file
           i_begin_col             = lc_begin_col
           i_begin_row             = lc_begin_row
           i_end_col               = lc_end_col
           i_end_row               = lc_end_row
         TABLES
           intern                  = i_data
         EXCEPTIONS
           inconsistent_parameters = 1
           upload_ole              = 2
           OTHERS                  = 3.
    * Error in file upload
       IF sy-subrc NE 0 .
         MESSAGE text-006 TYPE 'E'.
         EXIT.
       ENDIF.
       IF i_data[] IS INITIAL .
         MESSAGE text-007 TYPE 'E'.
         EXIT.
       ELSE.
         SORT i_data BY row col .
    * Loop to fill data in Internal Table
         LOOP AT i_data .
           MOVE i_data-col TO l_count .
           ASSIGN COMPONENT l_count OF STRUCTURE p_i_excel_data TO <fs_source> .
           MOVE i_data-value TO <fs_source> .
           AT END OF row .
    * Append data into internal table
             APPEND p_i_excel_data.
             CLEAR p_i_excel_data.
           ENDAT .
         ENDLOOP .
       ENDIF .

Maybe you are looking for

  • Don't want to view previous items in month view

    Hi guys, I don't use iCal for much, but I'm trying to make a simple calendar of events. There are several events, and they last for a month and a half or so each. I've created the event and I'm having it repeat until the specified date. Let's say the

  • Merging numbers documents into single PDF for emailing

    I have 23-50 numbers documents (invoices) that I want to send as one single PDF (to save time). When I select them all in Finder and open in Preview they are not full size and are rotated the wrong way. When I open them seperately in Numbers and cmd

  • Error in update query with join

    hi all, im using oracle 10g in windows. im not able to use this update query having join...... UPDATE b SET b.is_stud = 1 FROM boy b INNER JOIN relationship r ON b.id = r.boy_id; thanks a lot..................

  • Can't add iChat agent password to keychain...

    Here's one for you veteran iChatters...Is there some reason why I must type in the password for iChat agent each and every time I reboot? I've tried adding it manually to the keychain, but it still pops up with that annoying dialog at startup. It's t

  • Period parameter

    Hello, i am stuck up in building a report thru Report Painter from GRR1. The report involves ratio calculation like debt-equity, RONW, etc.. In the Lead column, i have put various selection parameters like Fiscal Year, Co Code, Period etc which is wo