ALV Tree - Color Specific Column based on value in that cell?

Hi Forums,
I have searched the forum and I am unable to find the answer to my question.
I am using an ALV tree and I would like to color a cell RED is the value in the cell is negative.
I have set my field catalog to many different emphasize numbers and no luck either?
  CLEAR ls_fieldcatalog.
  ls_fieldcatalog-fieldname  = 'ORG_TXT'.
  ls_fieldcatalog-coltext    = text-d02.
  ls_fieldcatalog-scrtext_m  = text-d02.
  ls_fieldcatalog-col_pos    = 2.
  ls_fieldcatalog-outputlen  = '30'.
  ls_fieldcatalog-no_out     = 'X'.
  ls_fieldcatalog-emphasize  = 5.
  APPEND ls_fieldcatalog TO et_fieldcatalog.
I am using 
    gr_alv_tree_control  TYPE REF TO cl_gui_alv_tree
as my class to display my tree and I have found no methods that would set the color in there either?
What else could be checked?

To those interested, i was able to color the TEXT of a First coloumn of the TREE. Using this code:
That said it will not work without BOTH
       ls_layout_item-fieldname = gr_alv_tree_control->c_hierarchy_column_name.
      ls_layout_item-style   =
                           cl_gui_column_tree=>style_intensifd_critical.
    IF ls_vip_display-vip_diff_tot > 0.
       ls_layout_item-fieldname = gr_alv_tree_control->c_hierarchy_column_name.
      ls_layout_item-style   =
                           cl_gui_column_tree=>style_intensifd_critical.
    ENDIF.
    IF ls_vip_display-vip_diff > 0.
      ls_layout_item-style   =
                           cl_gui_column_tree=>style_intensifd_critical.
    ENDIF.
    ls_layout_item-t_image = '@GZ@'.
    ls_layout_item-style   =
                        cl_gui_column_tree=>style_intensifd_critical.
    APPEND ls_layout_item TO lt_layout_item.
*   add leaf nodes
    CALL METHOD gr_alv_tree_control->add_node
      EXPORTING
        i_relat_node_key     = lv_parent_id
        i_relationship       = cl_gui_column_tree=>relat_last_child
        i_node_text          = lv_node_text
        is_outtab_line       = ls_vip_display
        it_item_layout       = lt_layout_item
        is_node_layout       = ls_node_layout
      IMPORTING
        e_new_node_key       = lv_new_key
      EXCEPTIONS
        relat_node_not_found = 1
        node_not_found       = 2
        OTHERS               = 3.
Anybody else who can shed some light to why both are needed OR possibly how I can change the position of the colored text to a different cell?
Edited by: Keith Warnock on Feb 9, 2011 6:48 PM

Similar Messages

  • Color a column based on value in another column in tableview

    I am using a tableview iterator to display data in a bsp page. I want to color a cell in particular column (column 4), when a value in another column (column 2) on that same row is greater than 20. I can color the cell in column 2 but am not able to color the cell in column 4. How can I accomplish this?
    This is what I have. Looks like val1 is losing it's value.
    CASE p_column_index.
        WHEN 2.
          ASSIGN p_row_data_ref->* TO <row>.
          ASSIGN COMPONENT 'ZTGT' OF STRUCTURE <row> TO <col>.
          VAL = <col>.
          IF VAL GT '20'.
            val1 = p_row_index.
            p_style = 'celldesign:CRITICALVALUE_DARK'.
          ENDIF.
        WHEN 4.
            if p_row_index = val1.
              p_style = 'celldesign:CRITICALVALUE_DARK'.
            endif.
        WHEN OTHERS.
    do nothing
      ENDCASE.

    The reason val1 is "loosing its' value" is presumably because you have defined it in the method as a local variable. So each time you call the RENDER_CELL_START method it is is newly initialised. So if you make this an instance attribute it will retain its' contents across method calls.
    Cheers
    Graham Robbo

  • How to fill column value of a matrix with specific color when there is no value in that specific cell?

    Hi All,
    I need to create a 5/5  matrix in SSRS report. The data will be :
    Col_Side   Col_Header   Col_data
    1                  1                1
    1                  1                 1
    1                  2                1
    1                  5                1
    1                  5                1
    1                  5                1
    2                  3                1
    2                  5                1
    3                  1                2
    3                  1                2
    3                  1                2
    4                   2               1
    4                   4               1
    5                   1               1
    5                   1               1
    5                   5               1
    So, the matrix column will be Col_Header and matrix row will be Col_Side and count(Col_data) will be on the data.
    Finally, it will create a 5 by 5 matrix with Count(Col_data) as its data for each combinations. If there is no combination (for ex: in the above data we do not have no combination of (1,3) , (1,4) , (2,1) etc..) then the matrix will be filling that corresponding
    cell with zero.
    Here I need to fill the cells with some colors based on some criteria.
    I need to fill (5,3), (5,4), (5,5) combination with "Red" color.  Like this , I need to give different colors in each of the cells. Here, (5,5) combination will be having 1 in its cell.  (5,4) and (5,3) will be having zero in its corresponding
    cells. I 'm trying to fill all the 3 cells with "Red" color. But, I am able to fill only (5,5) with "Red" color. Since the other 2 cells (5,3) and (5,4), has zero in their cells, it will not fill the cells with "Red" color. 
    How can I fill those two cells (5,3) and (5,4) with red color?
    I know this is very vague. I have no option to give the picture here..
    Please suggest

    Hi Julie,
    According to your description, there is a 5/5 matrix with three fields: Col_Side, Col_Header, Col_data. You drag Col_Side field to Rows, Col_Header to Columns and Col_data to Data, then filling blank cells with zero using expression. Now you want to fill 
    (5,3), (5,4), (5,5) cells with red color using expression, but it has no effect on cells (5,3) and (5,4).
    According to my test, the expression has on effect on cells (5,3) and (5,4) since there is no corresponding data and the cells are blank. As a workaround, we can insert data for cells (5,3) and (5,4) in dataset, then use expression by following steps:
    In the dataset, insert two sets of data (5,3,0), (5,4,0).
    Right-click the cell of data, click Text Box Properties.
    Click Fill in left pane, click (fx) button, then type the expression like below, then click OK.
    =iif(Fields!Col_Side.Value=5 and Fields!Col_Header.Value >=3 ,"red","white" )
    The following screenshot is for your reference:
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu

  • Dynamic Link Column Based on Value

    I'm using Apex version 4.1.
    This is driving me nuts, I can't get it to work. I'm trying to create a dynamic link on a column (in a SQL report) based on the value. Here's my query:
    SELECT STRUCTURE_ENTITY_ID AS "Market ID",
    Structure_entity as "Market Name",
    CASE WHEN NVL2((select 'A' from PC_PAYROLL_DISTRIBUTION PD
    WHERE PROCESSING_YEAR = SUBSTR('2011-08',1,4)
    AND PROCESSING_MONTH = TO_NUMBER(SUBSTR('2011-08',6,2))
    AND PD.OPS_MARKET = SE.STRUCTURE_ENTITY_ID
    AND ROWNUM = 1),'Ready','Not Ready') = 'Ready' THEN '' ||'' ELSE 'Not Ready' END AS Status
    FROM STRUCTURE_ENTITY SE
    So when the value in that CASE statement equals 'Ready' then I need it to show the word Ready (in the Status column) as a hyperlink, otherwise it needs to show 'Not Ready' in normal text that's not clickable.
    The URL string I have in there DOES pick up the correct values for my parameters, but it stilll appears in the report as the whole string, and it's not clickable. Any help would be greatly appreciated!
    Thanks,
    Greg

    I see an a instead of <a and no </a> in this code.
    Oh, I guess your {a is <a ... B-)  Still no end tag, though.
    Edited by: InoL on Oct 7, 2011 2:27 PM                                                                                                                                                                                                                                                                                                                       

  • Custom table column based on value scale

    I want to custom table column based on the vaules.
    I understood I need to to /1000000 in the column definition and custom ###,###,###M.
    But sometimes it can be Kilos and sometimes Billions.
    I don't want to display 0.02M or 200000M.
    How can I define conditional custom according to the current value?

    Try doing what I said here and see if it works for you...
    Re: Represent numbers in thousands

  • ALV Tree/Grid: maximum columns

    Hello.
    How many columns can have a maximum of ALV Tree/Grid?
    Thanks.
    P.S. Sorry, self-solved: OO ALV : Maximum number of columns, Daixiong Jiang.

    Hello Emir
    Call the static method <b>cl_gui_cfw=>set_new_okcode</b> with your required ok-code. The short description of this methods says <i>"Be careful: This sets a new Fcode in Eventhandler for PAI",</i> exactly what you want.
    Regards
       Uwe

  • Duplicate Cell Contents n-times based on value in neighboring cell?

    I have a sheet/table that contains ~150 rows of 2 columns:
    A B
    COUNT CONTENT
    I am looking for a way to duplicate each CONTENT in a new sheet/table COUNT times, and do this for each row.
    For example
    A B
    2 RED
    1 BLUE
    3 GREEN
    Would give me a sheet/table that contains one column that reads:
    RED
    RED
    BLUE
    GREEN
    GREEN
    GREEN
    Any ideas? Thanks in advance.

    Here is a modified version .
    (1) I added comments helping you to understand its behaviour.
    (2) added a property (use_GUIscripting) allowing you to choose the script's behaviour.
    - if you use GUI scripting, the set of datas is inserted in the table as a whole.
    - if you doesn't use it, the values are inserted one by one which is a bit slower.
    So I decided to give you freedom. You may make your own choice.
    --[SCRIPT buildand_fill_newtable]
    Enregistrer le script en tant que Script : buildand_fill_newtable.scpt
    déplacer le fichier créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Merci à Scott Lindsey & Ed.Stockly du forum [email protected]
    qui m'ont aidé à construire le code récupérant le bloc sélectionné.
    Sélectionner le bloc de cellules contenant les paramètres à utiliser.
    aller au menu Scripts , choisir Numbers puis choisir buildand_fill_newtable
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    +++++++
    Save the script as a Script buildand_fill_newtable.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    une_valeur you would have to create the folder Numbers and even the folder Applications by yourself.
    Thanks to Scott Lindsey & Ed.Stockly from [email protected]
    which helped me to build the code grabbing the selected range.
    Select the range of cells containing parameters to use.
    go to the Scripts Menu, choose Numbers, then choose buildand_fill_newtable
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2010/09/02
    -- added comments and ability to choose between use GUIscripting and doesn’t use it
    --=====
    property use_GUIscripting : false
    true = use GUIscripting and paste values
    false = doesn't use GUIscripting
    property theApp : "Numbers"
    property les_valeurs : {}
    property nouvelles_valeurs : {}
    --=====
    on run
    local dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2, le_nombre, la_valeur
    if use_GUIscripting then my activateGUIscripting()
    my nettoie()
    try
    Extract infos about the source range *)
    set {dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
    tell application "Numbers" to tell document dName to tell sheet sName
    tell table tName
    Extract the values of selected cells *)
    set my les_valeurs to value of cells colNum1 thru colNum2 of rows rowNum1 thru rowNum2
    --> {{2.0, "bleu"}, {3.0, "blanc"}, {5.0, "rouge"}, {1.0, "vert"}, {4.0, "noir"}, {6.0, "violet"}}
    end tell -- table
    repeat with une_reference in my les_valeurs
    set {le_nombre, la_valeur} to contents of une_reference
    repeat le_nombre times
    copy la_valeur to end of my nouvelles_valeurs
    end repeat
    end repeat
    --> {bleu, bleu, blanc, blanc, blanc, rouge, rouge, rouge, rouge, rouge, vert, noir, noir, noir, noir, violet, violet, violet, violet, violet, violet]
    Build an unique name for the new table *)
    set nouveau_nom to (do shell script "date +table%Y%m%d%H%M%S")
    if use_GUIscripting then (*
    Create a small new table *)
    make new table with properties {name:nouveau_nom, row count:3, column count:3}
    else (*
    Create a new table with the needed rows *)
    set rows_needed to count of nouvelles_valeurs
    make new table with properties {name:nouveau_nom, row count:rows_needed + 1, column count:3}
    end if
    As the default table has header row an header column, remove such items *)
    tell table nouveau_nom
    remove row 1
    remove column 1
    set selection range to cell "A1"
    end tell
    end tell
    if use_GUIscripting then
    --> the handler 'recolle' concatenate the values of the list nouvelles_valeurs in a text with values separated by return character.
    bleu
    bleu
    blanc
    blanc
    blanc
    rouge
    rouge
    rouge
    rouge
    rouge
    vert
    noir
    noir
    noir
    noir
    violet
    violet
    violet
    violet
    violet
    violet
    set the clipboard to my recolle(my nouvelles_valeurs, return)
    Triggering the menu item paste the entire set of values in a single task *)
    my selectMenu("Numbers", 4, 7) (* Paste Applying Style *)
    else
    Here we aren’t using GUI scripting so we must fill cells one by one. *)
    tell application "Numbers" to tell document dName to tell sheet sName to tell table nouveau_nom to tell column 1
    repeat with r from 1 to rows_needed
    The coercion as text is required to get rid of a Numbers bug. If the system doesn’t use decimal comma,
    inserting AppleScript decimal numbers (which use the decimal period) inserts a value like 12.34 which is treated as a string.
    If we coerce as string, the cell receive 12,34 which is correctly treated as a number *)
    set value of cell r to item r of nouvelles_valeurs as text
    end repeat
    end tell -- Numbers…
    end if
    end try
    Clear properties so that their contents will not be stored in the script. *)
    my nettoie()
    end run
    --=====
    on nettoie()
    set my les_valeurs to {}
    set my nouvelles_valeurs to {}
    end nettoie
    --=====
    set {rowNum1, colNum1, rowNum2, colNum2} to my getCellsAddresses(dname,s_name,t_name,arange)
    on getCellsAddresses(d_Name, s_Name, t_Name, r_Name)
    local two_Names, row_Num1, col_Num1, row_Num2, col_Num2
    tell application "Numbers"
    set d_Name to name of document d_Name (* useful if we passed a number *)
    tell document d_Name
    set s_Name to name of sheet s_Name (* useful if we passed a number *)
    tell sheet s_Name
    set t_Name to name of table t_Name (* useful if we passed a number *)
    end tell -- sheet
    end tell -- document
    end tell -- Numbers
    if r_Name contains ":" then
    set two_Names to my decoupe(r_Name, ":")
    set {row_Num1, col_Num1} to my decipher(d_Name, s_Name, t_Name, item 1 of two_Names)
    if item 2 of two_Names = item 1 of two_Names then
    set {row_Num2, col_Num2} to {row_Num1, col_Num1}
    else
    set {row_Num2, col_Num2} to my decipher(d_Name, s_Name, t_Name, item 2 of two_Names)
    end if
    else
    set {row_Num1, col_Num1} to my decipher(d_Name, s_Name, t_Name, r_Name)
    set {row_Num2, col_Num2} to {row_Num1, col_Num1}
    end if -- r_Name contains…
    return {row_Num1, col_Num1, row_Num2, col_Num2}
    end getCellsAddresses
    --=====
    set { dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
    on getSelParams()
    local r_Name, t_Name, s_Name, d_Name
    set {d_Name, s_Name, t_Name, r_Name} to my getSelection()
    if r_Name is missing value then
    if my parleAnglais() then
    error "No selected cells"
    else
    error "Il n'y a pas de cellule sélectionnée !"
    end if
    end if
    return {d_Name, s_Name, t_Name, r_Name} & my getCellsAddresses(d_Name, s_Name, t_Name, r_Name)
    end getSelParams
    --=====
    set {rowNumber, columnNumber} to my decipher(docName,sheetName,tableName,cellRef)
    apply to named row or named column !
    on decipher(d, s, t, n)
    tell application "Numbers" to tell document d to tell sheet s to tell table t to ¬
    return {address of row of cell n, address of column of cell n}
    end decipher
    --=====
    set { d_Name, s_Name, t_Name, r_Name} to my getSelection()
    on getSelection()
    local _, theRange, theTable, theSheet, theDoc, errMsg, errNum
    tell application "Numbers" to tell document 1
    repeat with i from 1 to the count of sheets
    tell sheet i
    set x to the count of tables
    if x > 0 then
    repeat with y from 1 to x
    try
    (selection range of table y) as text
    on error errMsg number errNum
    set {_, theRange, _, theTable, _, theSheet, _, theDoc} to my decoupe(errMsg, quote)
    return {theDoc, theSheet, theTable, theRange}
    end try
    end repeat -- y
    end if -- x>0
    end tell -- sheet
    end repeat -- i
    end tell -- document
    return {missing value, missing value, missing value, missing value}
    end getSelection
    --=====
    on parleAnglais()
    local z
    try
    tell application "Numbers" to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z is not "Annuler")
    end parleAnglais
    --=====
    on decoupe(t, d)
    local oTIDs, l
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to oTIDs
    return l
    end decoupe
    --=====
    on recolle(l, d)
    local oTIDs, t
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set t to l as text
    set AppleScript's text item delimiters to oTIDs
    return t
    end recolle
    --=====
    on activateGUIscripting()
    (* to be sure than GUI scripting will be active *)
    tell application "System Events"
    if not (UI elements enabled) then set (UI elements enabled) to true
    end tell
    end activateGUIscripting
    --=====
    my selectMenu("Pages",5, 12)
    ==== Uses GUIscripting ====
    on selectMenu(theApp, mt, mi)
    tell application theApp
    activate
    tell application "System Events" to tell process theApp to tell menu bar 1 to ¬
    tell menu bar item mt to tell menu 1 to click menu item mi
    end tell -- application theApp
    end selectMenu
    --=====
    --[/SCRIPT]
    Yvan KOENIG (VALLAURIS, France) 2 septembre 2010 15:53:49

  • Populate multiple rows and columns based off of a single cell

    Does anyone know a way to populate multiple rows and columns based off of the input of a single cell. I'm trying to create a workout tracker that auto populates from a master list of workouts. Example, in A2 the user selects the workout from a drop down menu (St1, St2, St3, etc) and the workout is pulled from the master list and is populated into B2:C5.
    I'm using =LOOKUP(A2,Master :: A2:A32,Master :: C2:C32) right now, but it's only drawing the top column. I'm looking for an edit for the formula (or completely new formula) that will place the info from the 1st column of the Master table into the 1st column of the Auto Tracker 1 table and then on down until the 4th column.
    Here is a screen shot of what I have now:
    And an example of what I'd like to accomplish:
    Any and all help is appreciated, and please let me know if there is any more info that I can give that'd help out.

    Hi Mike,
    Your screenshots show that you have merged some cells in Column A of both tables. That may be the reason why the LOOKUP function is having trouble working out which range of cells to examine.
    Hope this helps.
    Regards,
    Ian.

  • Insert value into a column based on value of another column

    Hi,
    I am trying to insert a value into a record based on a column in
    the record, using a trigger. The complication arises because
    the new value is selected from the same table. For example:
    SELECT COL1, COL2, COL3, COL4 from TABLE1
    I want to set COL2 and COL3 based on the value of COL4. And to
    get the value of COL2 and COL3, I will go back to TABLE1 and set
    the condition to TABLE1.COL1 = :NEW.COL4
    I cannot seem to execute the trigger as I get the message "ORA-
    04091: table SYSTEM.TABLE1 is mutating, trigger/function may not
    see it" everytime.
    Is this the correct way to achieve what I wanted? Or is there
    another way?
    Appreciate your feedback. Thank you in advance.

    Hi,
    I am trying to insert a value into a record based on a column in
    the record, using a trigger. The complication arises because
    the new value is selected from the same table. For example:
    SELECT COL1, COL2, COL3, COL4 from TABLE1
    I want to set COL2 and COL3 based on the value of COL4. And to
    get the value of COL2 and COL3, I will go back to TABLE1 and set
    the condition to TABLE1.COL1 = :NEW.COL4
    I cannot seem to execute the trigger as I get the message "ORA-
    04091: table SYSTEM.TABLE1 is mutating, trigger/function may not
    see it" everytime.
    Is this the correct way to achieve what I wanted? Or is there
    another way?
    Appreciate your feedback. Thank you in advance. I'm not sure what you mean when you insert a value into a
    record, but if you are setting a value in a column of the same
    record using a trigger, then it's easy.
    :new.COL2 := ....:new.COL4...
    :new.COL3 := ....:new.COL4...
    The trigger must be 'INSERT or UPDATE' and 'FOR EACH RECORD'.
    If you are setting a different record in the same table, the
    solution is much more difficult.

  • Filter column based on values in second column

    I have a 7 columns (A-G). I want to add a filter to return rows if the value in column D exists anywhere in column C (values in column D and C do not necessarily match).
    Is this possible? I tried creating a filter for column D based on column C using the 'Filter based on results of another request' functionality, but it did not work.
    Create/Edit Filter>Filter based on results of another request
    Column: column D
    Relationship: is equal to any
    Saved Request: same request
    Use values in Column: column C

    Okay, it looks like you are using the same query for both the main and subquery. That won't work.
    1) Create a query with one column, column D. Name it and save it.
    2) Now build your main report with all the columns you desire and on column C, apply the filter "based on results..." and have it point to column D of the subquery in step 1.

  • Count of Column  based on Value

    Hi All
    In our database table we have 3 columns closedate,empcode,status.
    I am using the following query to fetch the data required :
    select closedate,count(empcode) COUNT,EMPCODE,status from dbcleaning WHERE STATUS='Fixed' and EMPCODE='E315' group by closedate,STATUS,EMPCODE.
    the result is like this :
    closedate count EMPCODE STATUS
    2010-10-10 98 E315 Fixed
    2010-10-11 15 E315 Fixed
    However i want the data to be based on DISTINCT EMPCODE , fo Eample :
    closedate EMPCODE(ST001)       EMPCODE(ST002) STATUS
    2010-10-10 *98 125* Fixed
    2010-10-11 *128 225* Fixed
    I hope i had explained properly
    Replies are highly appreciated.
    Thank You
    Edited by: user9366471 on Jun 30, 2010 12:29 AM

    It's always a better idea to post DDL of your table and INSERT statement. Also don't forget to mention the output you required. It's even better if you use tag for those DDL and DMLs.
    Your database version is a important thing for exact solution.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • I have tried everything! How to change the color of text based on value Acrobat 9

    How can I change the color of the text to red if the value is "Unacceptable" and leave it green for all other rating values? Where can I put it for it to work? Also, Unacceptable is set to an export value of 0.
    var n = +this.getField("NumericSummaryRating").value;
    var a = +this.getField("Rating1.0").value;
    var b = +this.getField("Rating1.1").value;
    var c = +this.getField("Rating1.2").value;
    var d = +this.getField("Rating1.3").value;
    var e = +this.getField("Rating1.4").value;
    if (n == 0) {
        event.value = "Not Rated";
    } else {
    if (a==0 || b==0 || c==0 || d==0 || e==0) {
        event.value = "Unacceptable";
    else {
        if (n>0 && n < 3.0){
            event.value = "Unacceptable";
        else if (n >= 3.0 && n < 3.6) {
            event.value = "Successful";
        else if (n >= 3.6 && n < 4.6) {
            event.value = "Excellent";
        else if (n >= 4.6) {
            event.value = "Outstanding";

    You can add this at the end of the code:
    if (event.value=="Unacceptable") event.target.textColor = color.red;
    else event.target.textColor = color.green;

  • Sort column based on value

    Hi All,
    Query result gives ou put like in the following order
    CITY NAME
    CHENNI
    DELHI
    LONDON
    RIO DEGENERO
    How to get output in the following sort order
    LONDON
    CHENNAI
    DELHI
    RIO DEGENERO
    i dont want to hardcode the column values ..it will be great if i get option to genrate dynamically.
    Thanks!

    Hi,
    user601042 wrote:
    Hi All,
    Query result gives ou put like in the following order
    CITY NAME
    CHENNI
    DELHI
    LONDON
    RIO DEGENERO
    How to get output in the following sort order
    LONDON
    CHENNAI
    DELHI
    RIO DEGENERO
    i dont want to hardcode the column values ..it will be great if i get option to genrate dynamically.If the sort order isn't hard-coded, how do you get it?
    If you call a function to get the sort order, then just call the function in the ORDER BY clause:
    ORDER BY  sort_key (city_name)If the sort order is in a table, join to that table, so you can use the appropriate column
    FROM     table_x  x
    JOIN      cities   c  ON  c.city_name = x.city_name
    ORDER BY  c.sort_key
    user601042 wrote:... i want to display the following order in screen
    3 LONDON
    1 CHENNI
    2 DELHI
    4 RIO DEGENEROThe question is, how do you determine that order? I don't see anything obvious in the data itself.
    If you were sorting by the id, either ascending or descending, then 1 wouldn't come between 3 and 2.
    If you were sorting by alphabetic order, either ascending or descending, then 'CHENNI' wouldn't come between 'LONDON' and 'DELHI'.
    If you were sorting by the length of the name, either ascending or descending, then 'DELHI' (5 characters) wouldn't come between 'CHENNI' (6 CHARACTERS) and 'RIO DEGENERO' (12 characters).
    By what are you sorting? If you can explain it in English, then someone can help you code it in SQL.
    Edited by: Frank Kulash on Oct 17, 2012 2:40 PM

  • Update column based on values of same table

    I have table T1 with 4 columns 'col1','col2','col3','col4', 'col5','col6' as follows
    Col1     Col2     Col3     Col4     Col5     Col6
    1111     City1     C     AA     DDD     A1
    2222     City 1          DD     HHH     A1
    3333     City2     B     EE     OOO     
    4444     City 1     B     JJ     SSS     A1
    5555     City2     C     KK     VVV     
    6666     City2          RR     QQQ     
    7777     City2     B     XX     BBB     
    I have already updated Column 6with value ‘A1’ where Column 2 is ‘City1’.
    Now I want to update col 6 where col2 is ‘S’ with following conditions
    If Col 3 = ‘B’ then Col6 should be = col4
    else it should be = col5

    SET col6=DECODE(col3,'B',col4,col5)
    WHERE col2='S'

  • Issue in populating values in a column based on values in other columns

    I have a situation as below:
    Src        Tar             New tar
    AC001  TAC001  
    AC002  TAC001      AC002
    AC003  TAC001
    AC011  TAC011
    AC012  TAC011      AC012
    AC021  TCA021
    AC022  TCA021
    Now, wherw I have New target as AC002, I need to copy the same value to TAC001 which is the 1st and 3rd row. Similarly, I need to copy AC012 to 4th record. And my last 2 rows will be null as I do not have any values for TCA021..Any thoughts on this would be apprecated..
    Thanks in advance..

    Hi
    almost all is said so i tip you How to Fish (with Pictures) - wikiHow because it is good asset for future when you are hungry
    Read also http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions004.htm#SQLRF06174
    "Analytic functions compute an aggregate value based on a group of rows. They differ from aggregate functions in that they return multiple rows for each group. The group of rows is called a window and is defined by the analytic_clause. For each row, a sliding window of rows is defined. The window determines the range of rows used to perform the calculations for the current row. Window sizes can be based on either a physical number of rows or a logical interval such as time.
    Analytic functions are the last set of operations performed in a query except for the final ORDER BY clause. All joins and all WHERE, GROUP BY, andHAVING clauses are completed before the analytic functions are processed. Therefore, analytic functions can appear only in the select list or ORDERBY clause.
    Analytic functions are commonly used to compute cumulative, moving, centered, and reporting aggregates."

Maybe you are looking for

  • Dynamic WHERE clause logic in SQL based on ITEM value

    Hi, I have a report based on following SQL query.    select dept_no,        dept_name,        dept_loc   from dept where dept_loc = :P1_DEPT_LOC    // If P1_DEPT_LOC is not null, I want the WHERE clause and IF  P1_DEPT_LOC is null, then I don't need

  • About IDoc Basics

    Hi, I am learning IDocs. But I am getting confused with basic concept only. Can any one clear me following points in simple manner: 1. What is Inbound proceesing? In which senario we use it? 2. What is Outbound proceesing? In which senario we use it?

  • WM Replenishment and 2-step picking with storage units.

    Dear Colleagues, I am attempting to use SAP standard fixed bin replenishment and implement it as a 2-step picking process. Generally, the process goes as follows: - Generate replenishment pick tasks - Place the picked products onto storage units in a

  • Kernel At 600% when plugged Into the power cord.

    Everytime my computer is at 0-9% and I plug it in to charge, my computer lags and today I contacted apple support and they told me to check my cpu usage, to my surprise the kernel was at 600% and when I unplugged my computer it went down to 2%. Why i

  • I downloaded the New numbers iOS and now i can't open any numbers documents

    I just recently downloaded the new Mavricks update and now all my numbers Documents say i need to download the new system before opening. I alread have the new numbers system so i am unsure of what I need to do to fix it. I use numbers all day for my