Problem updating a control on one panel based on a value change in another control on a different panel

Hi,
I am trying to update the value of a control on one panel when the value of another control on a different panel is changed.  The two panels are saved in two different .uir files, so there are two associated .h files generated by CVI.  The problem is that, inside the callback function for the control that is being modified (Ctrl_Id_A on Panel_A), when I call SetCtrlVal(Panel_B, Ctrl_Id_B, Value); 'Panel_B' and 'Ctrl_Id_B' (which have the same numeric values as Panel_A = 1 and Ctrl_Id_A = 2 in their respective .h files) are being interpreted as Panel_A and Ctrl_Id_A.  I never understood how CVI makes this distinction, eg. knowing which of PANEL_A = 1 and PANEL_B = 1 is being referred to, but didn't worry about it since I never needed cross-communication between panels until now.  Any help on how to implement this would be greatly appreciated.  Thanks!
Solved!
Go to Solution.

This is a basic issue on which you can find tons of forum posts
The online help for the function recitates:
int SetCtrlVal (int panelHandle, int controlID, ...);
Parameters
Input
Name
Type
Description
panelHandle
int
Specifier for a particular panel that is currently in memory. You obtain this
handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID
int
The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
value
New value of the control. The data type of value must match the data type of the control.
That is, you must not use the panel constant name in the first parameter of SetCtrlVal, use the panel handle instead. The system guarantees that all panel handles are unique throughout the whole application whichever is the number of panels used in every moment.
int SetCtrlVal (int panelHandle, int controlID, ...);
Purpose
Sets the value of a control to a value you specify.
When you call SetCtrlVal on a list box or a ring control, SetCtrlVal
sets the current list item to the first item that has the value you
specify. To set the current list item through a zero-based index, use SetCtrlIndex.
When you call SetCtrlVal on a text box, SetCtrlVal appends value to the contents of the text box and scrolls the text box to display value. Use ResetTextBox to replace the contents of the text box with value.
Note   This function updates the displayed value immediately. Use SetCtrlAttribute with ATTR_CTRL_VAL to set the control value without immediately updating the displayed value. For this reason, SetCtrlAttribute with ATTR_CTRL_VAL is generally faster than SetCtrlVal. However, if the control in which you are setting the value is the active control in the panel, SetCtrlAttribute with ATTR_CTRL_VAL displays the value immediately.
Note   This function is not valid for graph and strip chart controls.
Parameters
Input
Name
Type
Description
panelHandle
int
Specifier for a particular panel that is currently in memory. You obtain this
handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID
int
The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
value
New value of the control. The data type of value must match the data type of the control.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?

Similar Messages

  • Insert values to one table based on a value inserted into another table

    Hi,
    I've got a form based off a report which creates a new project. I've added an additional process to this form to insert four new values into another table as soon as the new project is created and the PK for that project is generated. This was working last week (of course!) and now seems to not work at all. It's complaining that the PK I was getting from my first insert was null. Here is one the the statements in my process I'm trying to run:
    insert into week_group values(week_group_seq.nextval, (SELECT trunc(NEXT_DAY(SYSDATE, 'FRIDAY')) FROM dual), 0, '', :P45_PROJECT_SEQ, sysdate, :APP_USER);
    The complaint I get that it's getting null where :P45_PROJECT_SEQ should be.
    Thoughts?
    Thanks,
    Jon

    Hi Andy,
    Thanks for the tip. Those two values didn't match and I updated them so they do and I'm still getting a "cannot insert NULL..." error.
    When I turn on debug I see that I'm getting the PK and I see the value. Here's my debug output:
    0.24: ...Process "Get PK": PLSQL (AFTER_SUBMIT) declare function get_pk return varchar2 is begin for c1 in (select PROJECT_SEQ.nextval next_val from dual) loop return c1.next_val; end loop; end; begin :P45_PROJECT_SEQ := get_pk; end;
    0.25: ...Session State: Saved Item "P45_PROJECT_SEQ" New Value="252"
    0.25: ...Process "Process Row of PROJECT": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER#:PROJECT:P45_PROJECT_SEQ:PROJECT_SEQ|IUD
    0.26: ...Session State: Save "P45_PROJECT_SEQ" - saving same value: "252"
    0.26: ...Process "reset page": CLEAR_CACHE_FOR_PAGES (AFTER_SUBMIT) 45
    0.27: Nulling cache for application "120" page: 45
    0.27: ...Process "Add Week Groups": PLSQL (AFTER_SUBMIT) insert into week_group values(week_group_seq.nextval, (SELECT trunc(NEXT_DAY(SYSDATE, 'FRIDAY')) FROM dual), 0, '', :P45_PROJECT_SEQ, sysdate, :APP_USER); insert into week_group values(week_group_seq.nextval, (SELECT trunc(NEXT_DAY(SYSDATE, 'FRIDAY') +
    0.28: Encountered unhandled exception in process type PLSQL
    0.28: Show ERROR page...
    0.28: Performing rollback...
    I notice that when it runs my process "Add Week Groups" it's not displaying all of the SQL. But the SQL is fine, it's right here:
    insert into week_group values(week_group_seq.nextval, (SELECT trunc(NEXT_DAY(SYSDATE, 'FRIDAY')) FROM dual), 0, '', :P45_PROJECT_SEQ, sysdate, :APP_USER);
    Hmmm....what about the "reset page" action in the last of the 0.26 lines?
    Thanks,
    Jon

  • If I have installed an operating system in one language and I want to change to another language how to do?

    If I have installed an operating system in one language and I want to change to another language how to do?

    I mean I can change the system language without having to erase me things in my MAC?

  • Display an exception on one keyfigure based on the value of another key fig

    Hello all,
    How to run a exception based on some condition i.e
    i want to highlight the sales(key figure) which r less than the  average sales..
    where sales and average sales r keyfigures...
    i also created a cal key fig which has has value 1 if sale > avg sale...
    i.e How do i display an exception on one keyfigure depending on the value of another keyfigure??
    plz reply its urgent...
    thnx in advance...

    Hello Ajay, did you got an answer for your problem? I'm interested...
    Thx Masen
    Edited by: Masen-Fuad Marei on Nov 25, 2009 6:26 PM

  • [Problem] Updating Numeric Controls on a Tab Problem

    Using LabWindows CVI 8.0.1
    I have a UIR with a button on it and a tab control.  On the tab control there are 23 numeric controls.
    When the button is pressed the code reads a file and populates an array.  It then populates 23 controls on the tab.
    I have a constant array defined for the controls.  The button call back gets the panel handle and then loops through each control and populates it from the array of values.
    The problem I am seeing is if I click the button 22 of the controls update, the first one does not.  If I save the data (another button) it saves the values which are loaded (i.e. it knows the first control contains a value even though it is displaying 0.000). 
    If I click the button twice, then all 23 controls update.
    I added ProcessDrawEvents and ProcessSystemEvents but it made no difference.  However if, in my code I modified the callback to call the function that populates the tab controls twice it populates all 23 controls correctly first time. 
    Is this a known issue, or has anyone seen this before?
    Should mention that the code is compiled as a DLL and is called via TestStand 3.5.  It makes use of #include "tsutil.h" library.  There is also a ActiveX control on the UIR (not on the tab) which is a date picker.
    Christopher Povey
    Senior Test Systems Engineer for BAE Systems.

    Global:
    #define NumberOfCrosses 23
    const int CrossCtrlAzimuthHandles [NumberOfCrosses]   = { CROSSPOSN_X_CROSS_1,  CROSSPOSN_X_CROSS_2,  CROSSPOSN_X_CROSS_3,  CROSSPOSN_X_CROSS_4,  CROSSPOSN_X_CROSS_5, 
                                 CROSSPOSN_X_CROSS_6,  CROSSPOSN_X_CROSS_7,  CROSSPOSN_X_CROSS_8,  CROSSPOSN_X_CROSS_9,  CROSSPOSN_X_CROSS_10,
                                 CROSSPOSN_X_CROSS_11, CROSSPOSN_X_CROSS_12, CROSSPOSN_X_CROSS_13, CROSSPOSN_X_CROSS_14, CROSSPOSN_X_CROSS_15,
                                 CROSSPOSN_X_CROSS_16, CROSSPOSN_X_CROSS_17, CROSSPOSN_X_CROSS_18, CROSSPOSN_X_CROSS_19, CROSSPOSN_X_CROSS_20,
                                 CROSSPOSN_X_CROSS_21, CROSSPOSN_X_CROSS_22, CROSSPOSN_X_CROSS_23 };
    const int CrossCtrlElevationHandles [NumberOfCrosses] = { CROSSPOSN_Y_CROSS_1,  CROSSPOSN_Y_CROSS_2,  CROSSPOSN_Y_CROSS_3,  CROSSPOSN_Y_CROSS_4,  CROSSPOSN_Y_CROSS_5, 
                                 CROSSPOSN_Y_CROSS_6,  CROSSPOSN_Y_CROSS_7,  CROSSPOSN_Y_CROSS_8,  CROSSPOSN_Y_CROSS_9,  CROSSPOSN_Y_CROSS_10,
                                 CROSSPOSN_Y_CROSS_11, CROSSPOSN_Y_CROSS_12, CROSSPOSN_Y_CROSS_13, CROSSPOSN_Y_CROSS_14, CROSSPOSN_Y_CROSS_15,
                                 CROSSPOSN_Y_CROSS_16, CROSSPOSN_Y_CROSS_17, CROSSPOSN_Y_CROSS_18, CROSSPOSN_Y_CROSS_19, CROSSPOSN_Y_CROSS_20,
                                 CROSSPOSN_Y_CROSS_21, CROSSPOSN_Y_CROSS_22, CROSSPOSN_Y_CROSS_23  };
    const int CrossCtrlDistortionTolerancesHandles [NumberOfCrosses] = { DISTTOL_TOL_CROSS_1,  DISTTOL_TOL_CROSS_2,  DISTTOL_TOL_CROSS_3,  DISTTOL_TOL_CROSS_4,  DISTTOL_TOL_CROSS_5,
                                       DISTTOL_TOL_CROSS_6,  DISTTOL_TOL_CROSS_7,  DISTTOL_TOL_CROSS_8,  DISTTOL_TOL_CROSS_9,  DISTTOL_TOL_CROSS_10,
                                       DISTTOL_TOL_CROSS_11, DISTTOL_TOL_CROSS_12, DISTTOL_TOL_CROSS_13, DISTTOL_TOL_CROSS_14, DISTTOL_TOL_CROSS_15,
                                       DISTTOL_TOL_CROSS_16, DISTTOL_TOL_CROSS_17, DISTTOL_TOL_CROSS_18, DISTTOL_TOL_CROSS_19, DISTTOL_TOL_CROSS_20,
                                       DISTTOL_TOL_CROSS_21, DISTTOL_TOL_CROSS_22, DISTTOL_TOL_CROSS_23 };
    Function:
     // Get the panel handles.
     tsErrChk (GetPanelHandleFromTabPage (panelHandle, MAIN_PANEL_TAB, 0, &calibrationTabHandle));
     tsErrChk (GetPanelHandleFromTabPage (panelHandle, MAIN_PANEL_TAB, 1, &tolerancesTabHandle));
     // Get the cross positions.
     for (loop = 0; loop < NumberOfCrosses && error >= 0; loop++)
      tsErrChk (SetCtrlVal (calibrationTabHandle, CrossCtrlAzimuthHandles   [loop],            calibrationValues.crossAzimuthPosition      [loop]));
      tsErrChk (SetCtrlVal (calibrationTabHandle, CrossCtrlElevationHandles [loop],            calibrationValues.crossElevationPosition    [loop]));
      tsErrChk (SetCtrlVal (tolerancesTabHandle,  CrossCtrlDistortionTolerancesHandles [loop], calibrationValues.crossDistortionTolerances [loop]));
    No errors are returned to TestStand.
    Christopher Povey
    Senior Test Systems Engineer for BAE Systems.

  • Updating a field on one screen based on values in another screen

    We have defined a new screen (ccalled Customer Data) for the Business Partner transaton BP.
    On this screen is a new field that has been defined and appended to BUT000. The field is a kind of customer GUID that allocates a unique ID string to a customer (we call it a matchcode, not to be confused with the SAP standard meaning).
    The value in the field is calculated by a function module, which needs uses some of the address data on the standard address tab of the BP transaction. If that data on the address screen changes, then the following needs to happen:
    1) The matchcode field on the Customer Data screen needs to be updated.
    2) When saved, the new matchcode is updated to the database (not a problem if the matchcode is recalcuated on the Customer Data screen).
    Here are the questions:
    1) How can I access the updated data on the address screen in the Customer Data screen? I was under the impression that the funtion modules which respond to events on each page are in their own function groups, so I cannot see the changed data from any function module bound to the Customer Data screen events. Is that true?
    2) How could I access the changed data on the address screen to re-calculate the matchcode field?
    BR,
    Tony.

    Closed; I spent a lot of time analysing this.Answer I think is no.
    1) No guarantee of the order in which the screens are processed (DSAVE event for addresses is after DSAVE for custom screen, so scratch that).
    2) Data exists in separate memory areas for separate screens and needs to be passed by EXPORT/IMPORT. 1) prevents this.

  • Forcing link in one web based PDF to open link to another PDF in new browser window

    We have created a form using LiveCycle Designer ES2.  The form is found on our website and is used by faculty to submit proposal information to our office.  Depending upon the answers to questions in the form if they say yes we had a link to another form that we would like them to complete and submit with the original PDF that they are working on.  The problem that we are having is that when they click on the form it opens the new PDF and all the data that they had entered in the original PDF is gone once the new form opens up.  Is there a way to force the new PDF via the use of some scripting that can go along with the link, or via the use of a button that can force the new form to open in a new browser window?  It is impractical for us to expect 1500 faculty members to change their browser settings to open new PDF's in a new window.  We have removed the links for now and have just put in text that says if they select yes they need to go out and complete the additional form.
    The form we are using can be found here: http://spo.usu.edu/files/uploads/SP-01.pdf
    The first three questions on page two where we reference the other forms is where we would like to be able to add the links to the new forms and have them open in a new browser window.  When the form is downloaded and opened in Adobe Acrobat/Reader the links functioned correctly, it just did not function properly when it opens in a browser.
    Thank you in advance for any assistance you can offer in regards to this issue.

    I used a button, removed the border/fill properties and underlined the caption to look like a URL.
    The click event is...
    // form1.page1.subform1.urlBtn::click - (JavaScript, client)
    app.launchURL("http://spo.usu.edu/files/uploads/SP-01.pdf",true);
    The PDF will open in a new window or tab, depending upon the browser configuration.
    Steve

  • Is there a way to auto populate one field based on a selection made in another field?

    We want to enter an account number and have the account name field auto populate.

    Yes there are many ways.
    Do you want to populate form a controlled source like a database?
    From data stored within the form?

  • How to view one photo with one XMP based adjustment side by side with another  XMP version?

    Hi,
    I was wondering if there is a simple way of quickly and easily comparing side by side the same photo that may have different adjustments made to it.
    I do some freelance work where in one job I receive up to 800 images to edit.  After my work is complete I send the XMP files back to my boss.  He may or may not further tweak them for correctness.  He then sends these files to the client.
    I want to compare the original XMP files I sent against the final XMP files that the client receives to see what changes were made.  My boss can't remember exactly which files he tweaked so I wanted to do that visually.
    Is there an easy way to do this in Bridge? Can I quickly switch the adjustments from one set of XMPs to the other, or better yet, view the same image side by side with different adjustments applied to them?
    Thanks!
    ZLeung1980

    Is there an easy way to do this in Bridge? Can I quickly switch the
    adjustments from one set of XMPs to the other, or better yet, view the same
    image side by side with different adjustments applied to them?
    As far as I know you can't see different versions of the same file in
    Bridge, I think you can do so in Aperture ;-0
    The easiest way I can think of is to have two sets of files by duplicating
    the current series you have tweaked. The duplicates have copy in the
    filename but will stay in the correct order when having file name selected.
    The duplicates stay as you have them tweaked, the originals will be modified
    with new XMP as you get them back.
    Choose sort by modification date to select the files with modified xmp data
    and color  label those. Again choose all the content with sort for filename
    and you can easily see the color labels next to the original duplicates.
    Select both one modified and one original and view them next to each other
    in the preview window.
    Maybe others have a better method?

  • Create a column on one sheet based on unique value in another

    Hello,
    I'm running Excel 2013 and I have one workbook with two sheets - sheet1 and sheet2. Sheet1 has 24 columns and 26K rows. Column "A" is titled "id" and contains
    id numbers that are also, some, found in column "A" of Sheet2 - which is also titled "id".
    Sheet1 has no "description" column. Sheet 2 only has 2 columns - "A" is the "id" column and "b" is the "description" column.
    A B
    ID Description
    58749651 a bunch of text
    How can I create a description column on sheet1 (it would be column "U") and populate it with the description from sheet2 only where the "id" values from column "A" match?
    Thanks!
    Rob

    Hi Rob,
    Utilize the VLOOKUP function and this should resolve it. 
    For example, in a new column on sheet 1 (Y) a formula like this should suffice assuming ID is in column A:
    =VLOOKUP(A1,Sheet2!A:B,2,FALSE)
    Or more elegant:
    =IFERROR(VLOOKUP(A1,Sheet2!A:B,2,FALSE),"")
    More information on VLOOKUP can be found here: VLOOKUP Function

  • How to modify F4 help of one parameter based on the value of another?

    Hi,
    My Query is as follows:
    I have 3 select-options / parameters on the selection screen.
    If I enter some value in the first parameter the values in the second parameter should reflect accordingly.
    For example: The 3 selection-screen parameters are:
    select-options: s_werks for pa0001-werks no intervals,
                          s_btrtl for pa0001-btrtl no intervals,
                          s_kostl for pa0001-kostl no intervals.
    On exceuting the report, say I do a F4 and select '1000' for the first parameter (s_werks).
    Now after selecting the value for the first parameter if I do a F4 on the second parameter (s_btrtl) then it should prompt me with a F4 help containing values only corresponding to '1000' entered in s_werks and not all the values maintainined for btrtl.
    I have tried AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_BTRTL-LOW.
    And then used the FM F4IF_INT_TABLE_VALUE_REQUEST.
    But At Selection-Screen On Value Request the selection screen parameter s_werks does not show any value. It reflects the value only once it reaches Start-of-selection.
    Can anyone please guide me how to go about it?

    hi
    Please do it in this way..
    TABLES: pa0001.
    select-options: s_werks for pa0001-werks no intervals,
    s_btrtl for pa0001-btrtl no intervals,
    s_kostl for pa0001-kostl no intervals.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_BTRTL-LOW.
      PERFORM sub_pop_btrtl .
    *&      Form  sub_pop_btrtl
          text
    -->  p1        text
    <--  p2        text
    form sub_pop_btrtl .
    DATA :  l_wa_dynp TYPE dynpread,
            l_i_dynp TYPE STANDARD TABLE OF dynpread,
            l_wa_temp LIKE LINE OF S_werks.
    REFRESH s_temp[].
      l_wa_dynp-fieldname = 'S_WERKS-LOW'.
      APPEND l_wa_dynp TO l_i_dynp.
    Get the screen values of template
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
        TABLES
          dynpfields           = l_i_dynp
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      IF sy-subrc <> 0.
    Do Nothing
      ENDIF.
    Put the screen value in the select-options
      READ TABLE l_i_dynp INTO l_wa_dynp INDEX 1.
      l_wa_temp-sign = 'I'.
      l_wa_temp-option = 'EQ'.
      l_wa_temp-low = l_wa_dynp-fieldvalue.
    Now you use l_wa_temp as plant field
    endform.                    " sub_pop_btrtl

  • Create a variable in one table based on a value on another.

    I have two existing tables, say TABLE1 and TABLE2.  I need to create a key variable in TABLE2 and insert values for that  variable from TABLE1 i.e. create an explicit relationship between the tables using a key variable.  There exists a relationship
    between the tables in that for each record in TABLE1 there are 28 records in TABLE2 and the records are arranged in sequential order. So:
    TABLE1 TABLE2
    REQUIREMENT
    RECORD 1 -->
    RECORDS 1 to 28 Copy key variable from RECORD1 in TABLE1 into RECORDS 1 to 28 in TABLE2
    RECORD 2 -->
    RECORDS 29 to 56 Copy key variable from RECORD2 in TABLE1 into RECORDS 29 to 56 in TABLE2
    RECORD 3 -->
    RECORDS 57 to 84 Copy key variable from RECORD3 in TABLE1 into RECORDS 57 to 84 in TABLE2
    RECORD n--> RECORDS (n-1) * 28 + 1 to n * 28
    Copy key variable from RECORD n in TABLE1 into RECORDS (n-1) * 28 + 1 to RECORDS n * 28 in TABLE2
    Please help if you can.  I am prepared to give any additional information when asked.

    TABLE1:
    USE [LFS_APRIL_2015]
    GO
    /****** Object:  Table [dbo].[HOUSING37854]    Script Date: 04/30/2015 15:52:37 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[HOUSING37854](
    [BatchNo] [float] NULL,
    [District] [float] NULL,
    [URBAN_RURAL] [float] NULL,
    [HHNUM] [float] NULL,
    [Cluster] [float] NULL,
    [Final_Result_Code] [float] NULL,
    [zBarcode] [float] NULL,
    [Person_NUMBER] [float] NULL,
    [HH1] [float] NULL,
    [HH2] [float] NULL,
    [HH6] [float] NULL,
    [HH4] [float] NULL,
    [HH3] [float] NULL,
    [HH5] [float] NULL,
    [HH7] [float] NULL,
    [HH8] [float] NULL,
    [HH9a] [float] NULL,
    [HH9b] [float] NULL,
    [HH9c] [float] NULL,
    [HH9d] [float] NULL,
    [HH9e] [float] NULL,
    [HH9f] [float] NULL,
    [HH9g] [float] NULL,
    [HH9h] [float] NULL,
    [HH9i] [float] NULL,
    [HH9j] [float] NULL,
    [HH9k] [float] NULL,
    [HH9l] [float] NULL,
    [HH9m] [float] NULL,
    [HH10a] [varchar](1) NULL,
    [HH10b] [varchar](1) NULL,
    [HH10c] [varchar](1) NULL,
    [ED_Number] [float] NULL
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    TABLE2:
    USE [LFS_APRIL_2015]
    GO
    /****** Object:  Table [dbo].[LISTING37854]    Script Date: 04/30/2015 15:47:15 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[LISTING37854](
    [HL1] [float] NULL,
    [HL3] [float] NULL,
    [HL4] [float] NULL,
    [HL5] [float] NULL,
    [HL6] [float] NULL,
    [HL7] [float] NULL
    ) ON [PRIMARY]
    GO
    Essentially The Housing table, TABLE1, lists households and the Listing table, TABLE2, lists members of the household and there are always 28 lines in the Listings although most of them may be just a number since almost no household will have 28
    members.  The Listings that is jut a number will be deleted,  but to know where the listing for the next household starts I need to create the linking variable in Listings table.  The is absolutely no doubt that the relationship that I specified
    in the first post above is as specified.

  • Conditionally Formatting One Column Based On The Value of Another Column

    I have the following requirement:
    I have 2 columns in a report showing Actual Sales & Budget Sales each year. I am using a bar chart to show the different values for these 2 columns.
    I need to conditionally format the column "Actual Sales" so that if it is less than the "Budget Sales" it will appear in red, and green if "Actual Sales" is greater than "Budget Sales." So in a nutshell,
    CASE WHEN "Actual Sales" < "Budget Sales" THEN
    RED
    ELSE
    GREEN
    END
    Thoughts anyone?

    CASE WHEN (COL1 - COL2) < 0 then Red else Green end
    regards
    John
    http://obiee101.blogspot.com

  • Finding value in one table based on date = maximum date in another

    I have an event table that shows event dates and attendees but a customer now wants to see the titles of attendees at the time of the event.  I have an audit table that shows changes in title and the dates on which the change occurred however I am not sure how to do a SQL statement that would find the title whose date is less than the date of the event but greater than earlier title changes.
    Example:  in audit table I have:
    name1, title1, 1/23/2011  
    name1, title2, 2/1/2012  
    name1, title3, 3/1/2013
    name2, title1, 5/3/2012
    name2, title2, 8/1/2013
    In event table I have
    event1, name1, 3/2/2012 
    event2, name1, 1/30/2011 
    event3, name1, 6/3/2013 
    event4, name1, 5/3/2012
    event4, name2,  6/1/2012
    event5, name2, 9/1/2013
    Result I want is:
    event1, name1, title2  (event date > 2/1/2012 (title2 date) but < 3/1/2013 (title3 date)  
    event2, name1, title1   (event date > 1/23/2011 but < other title dates) 
    event3, name1, title3   (event date > highest title date) 
    event4, name1, title2    same as first example above 
    event4, name2, title1
    event5, name2, title2
    Is it possible to get result with SQL alone?
    Pat

    Analytic funstion solution:
    with audit_tbl as (
                       select 'name1' name,'title1' title,to_date('1/23/2011','mm/dd/yyyy') dt from dual union all
                       select 'name1','title2',to_date('2/1/2012','mm/dd/yyyy') from dual union all
                       select 'name1','title3',to_date('3/1/2013','mm/dd/yyyy') from dual union all
                       select 'name2','title1',to_date('5/3/2012','mm/dd/yyyy') from dual union all
                       select 'name2','title2',to_date('8/1/2013','mm/dd/yyyy') from dual
         event_tbl as (
                       select 'event1' event,'name1' name,to_date('3/2/2012','mm/dd/yyyy') dt from dual union all
                       select 'event2','name1',to_date('1/30/2011','mm/dd/yyyy') from dual union all
                       select 'event3','name1',to_date('6/3/2013','mm/dd/yyyy') from dual union all
                       select 'event4','name1',to_date('5/3/2012','mm/dd/yyyy') from dual union all
                       select 'event4','name2',to_date('6/1/2012','mm/dd/yyyy') from dual union all
                       select 'event5','name2',to_date('9/1/2013','mm/dd/yyyy') from dual
    select  e.event,
            e.name,
            a.title
      from  event_tbl e,
             select  name,
                     title,
                     dt from_dt,
                     lead(dt - 1,1,date '9999-12-31') over(partition by name order by dt) to_dt
               from  audit_tbl
            ) a
      where a.name = e.name
        and e.dt between a.from_dt and a.to_dt
      order by e.event,
               e.name,
               e.dt
    EVENT  NAME  TITLE
    event1 name1 title2
    event2 name1 title1
    event3 name1 title3
    event4 name1 title2
    event4 name2 title1
    event5 name2 title2
    6 rows selected.
    SQL>
    SY.

  • How to navto from one article in an issue (June Issue)  to another article in a different issue (May Issue)?

    I need to navto to from one of our articles in the June issue to an article in the May issue. Is this possible? If so what do I put in the URL? navto://folderName…?

    Looks like my email didn't go through.  Here's what I sent:
    There is an unsupported way of doing this using the URL Scheme specified in DPS App Builder. It's iOS only and works well for free folios, not retail.
    URLscheme://v1/folio/folioname/articlename
    Plug in your own values for urlscheme, folioname, and articlename.
    See DPS Tips > Advanced Overlays > Advanced Linking for details.

Maybe you are looking for

  • URGENT: Need to read file on client side from a 9i form

    Hi I have developed a 9i form and I assumed I could use TEXT_IO to read a file on the client side and insert the data into a database table. However, I have just tested the form and discovered that TEXT_IO only looks for files on the application serv

  • Mac keeps freezing since upgraded to yosemite

    since I have upgraded to Yosemite on my MacBook pro 2009 safari and chrome and many other apps that I try to run freeze and lock up the entire computer. If I wait eventually it will unfreeze. I have tried restarting several times. Could I have a viru

  • Need help undoing photo transfer from iPhone 4s.

    Hello gang, I need some help with a photo transfer as things have gone awry! I had ~100 photos in my Camera Roll on my 4s.  Went to transfer these to a PC, as usual; however, I did (2) thiings differently this time: (a) did this directly to a USB (in

  • What is "Assisted GPS" on the iPad and how does it work?

    What is "Assisted GPS" on the iPad and how does it work?

  • ESSBASE Database Build Error :-

    Hi Gurus, I am running the Build process which build the dimensions and load the data from the Source Oracle databases through ESSCMD and MAXL scripts either. Sometimes we are getting the error and when we re-run the build process we get run successf