Need help with Advanced Selection in MSA

Hi,
Has anyone managed to identify how to create additional
advanced selection criteria using links to existing combo engines ? Documentation on Mobile system maint is limited so looking for some additional help. Some criteria you can run the check against but not all why ? What should go in the hierachy fields and how do you select the choice list values ?
Thanks in advance
M

Hi,
Thanks,my issue is I want to use the combo box so the user can select from the drop down the relevant code from the choice list. Not rocket science really.
Example of sql generated for profession whch is kna1 field.
select  KNA1.TITLE,KNA1.SFAKNA2,KNA1.SFAKNA1,KNA1.PROFRESSION as PROFESSION,KNA1.PAFKT,KNA1.NAME2,KNA1.NAME1,KNA1.KVTGRP,KNA1.KVCPPOS,KNA1.KUNNR,KNA1.KTOKD,KNA1.BPACT,KNA1.ANRED,KNA1.ABTNR,ADRC.TELNR_LONG,ADRC.STREET,ADRC.POST_CODE1,ADRC.CITY1,ADRC.ADRCDFLT,ADDR.SFAKNBP , (KNA1.PROFESSION ='MIC') as ReturnValue1 from SMOKNA1 KNA1,SMOADRC ADRC,CDBD_ADDREXT ADDR where kna1.deleted='0' and KNA1.Source='CON' and ADRC.deleted='0' and ADDR.deleted = '0' and (ADRC.ADRCDFLT='S' or ADRC.ADRCDFLT='P') and (1=1) and kna1.sfakna1=adrc.sfakna1 and adrc.sfaadrc = addr.sfaadrc order by kna1.name1
Code fails !
I have set VAR1 as a free Combo with Bdoc as Choice, segment as Choice List with fields chkey/Textx so hiearchy fields looks like this //*/Profession hiearchy params being mandt/spras/list
It will not check is this because there is an error in this definition ?
Regards
MM

Similar Messages

  • I need help with a SELECT query - help!

    Hello, I need help with a select statement.
    I have a table with 2 fields as shown below
    Name | Type
    John | 1
    John | 2
    John | 3
    Paul | 1
    Paul | 2
    Paul | 3
    Mark | 1
    Mark | 2
    I need a query that returns everything where the name has type 1 or 2 but not type 3. So in the example above the qery should bring back all the "Mark" records.
    Thanks,
    Ian

    Or, if the types are sequential from 1 upwards you could simply do:-
    SQL> create table t as
      2  select 'John' as name, 1 as type from dual union
      3  select 'John',2 from dual union
      4  select 'John',3 from dual union
      5  select 'Paul',1 from dual union
      6  select 'Paul',2 from dual union
      7  select 'Paul',3 from dual union
      8  select 'Paul',4 from dual union
      9  select 'Mark',1 from dual union
    10  select 'Mark',2 from dual;
    Table created.
    SQL> select name
      2  from t
      3  group by name
      4  having count(*) <= 2;
    NAME
    Mark
    SQL>Or another alternative if they aren't sequential:
    SQL> ed
    Wrote file afiedt.buf
      1  select name from (
      2    select name, max(type) t
      3    from t
      4    group by name
      5    )
      6* where t < 3
    SQL> /
    NAME
    Mark
    SQL>Message was edited by:
    blushadow

  • Need help with advanced applet

    I need help with designing an applet as follows. Can someone give me a basic layout of code and material so i can fill in the rest or at leats give me some hints so i can get started since i am like no good at applets.
    Design and implement an applet that graphically displays the processing
    of a selection sort. Use bars of various heights to represent
    the values being sorted. Display the set of bars after each swap. Put
    a delay in the processing of the sort to give the human observer a
    chance to see how the order of the values changes.
    heres a website that does something similar
    http://www.cs.ubc.ca/spider/harrison/Java/sorting-demo.html

    elasolova wrote:
    i will not help you this time. but if you buy me a candy maybe i can reconsider the issue. :PI suggest an all-day sucker.

  • Need help with db select

    As usual I have been stuck for a while on what is probably a very simple solution so perhaps someone can help me, thanks.
    I have a portfolio page to which I post a url to filter the portfolio type (0, 1 or 2) and display the results.
    It works ok except that I can't get the url right to show all records. I have tried things like
    /portfolio.php?websitetype=1&2
    and
    /portfolio.php?websitetype=*
    /portfolio.php?websitetype>0
    Perhaps I need to change my select?
    $query_portfolio = "SELECT * FROM portfoliodb WHERE portfoliodb.websitetype='". $_GET['websitetype'] ."'  AND portfoliodb.visible = 1 ORDER BY portfoliodb.portfolio_id DESC";

    bikeman01 wrote:
    Ok I've now got it working as suggested so that's a big improvement, thanks but it's not quite what I was after. What I want is for all records to be retrieved by default when there is no url suffix and not require ?websitetype=ALL
    That is not what your OP asked for!
    It works ok except that I can't get the url right to show all records. I have tried things like
    /portfolio.php?websitetype=1&2
    and
    /portfolio.php?websitetype=*
    /portfolio.php?websitetype>0
    // determine if the URL parameter for websitetype is set.
    if (isset($_GET['websitetype'])) {
                   // run a query to filter only selected types
                   // based off value of URL parameter
                        $query_portfolio = "SELECT *
                        FROM portfoliodb
                        WHERE portfoliodb.websitetype='". $_GET['websitetype'] ."'
                        AND portfoliodb.visible = 1
                        ORDER BY portfoliodb.portfolio_id DESC";
    // else if the URL parameter for websitetype is not set.
    } else {
                        //  run query to display ALL types
                        $query_portfolio = "SELECT *
                        FROM portfoliodb
                        ORDER BY portfoliodb.portfolio_id DESC";
    // end condition if the URL parameter for websitetype is set.

  • Need Help With A Select Staement

    This is my data set.
    OPEN_DATE CLOSE_DATE
    02-JAN-08 02-JAN-08
    02-JAN-08 02-JAN-08
    02-JAN-08 02-JAN-08
    02-JAN-08 03-JAN-08
    04-JAN-08 04-JAN-08
    05-JAN-08
    07-JAN-08
    07-JAN-08 07-JAN-08
    07-JAN-08 07-JAN-08
    08-JAN-08 08-JAN-08
    08-JAN-08
    02-JAN-08
    02-JAN-08
    08-JAN-08
    09-JAN-08
    I'm need totals for those that are opened and closed per day. Here is what I'm trying to achieve...
    Status Value DATE
    Open 6 02-JAN-08
    Closed 3 02-JAN-08
    Open 0 03-JAN-08
    Closed 1 03-JAN-08
    Open 1 04-JAN-08
    Closed 1 04-JAN-08
    Open 0 05-JAN-08
    Closed 1 05-JAN-08
    Open 3 07-JAN-08
    Closed 2 07-JAN-08
    Open 3 08-JAN-08
    Closed 1 08-JAN-08
    Open 1 09-JAN-08
    Close 0 09-JAN-08
    This select statement gets me close but the problem is how to get the ones that should have a Value of 0
    select 'Open' "Status", count(*) "Value", to_char(open_date, 'DD-MON-YY') "DATE"
    from usar_log2
    where open_date IS NOT NULL and
    to_char(open_date, 'MON-YY') = to_char(sysdate, 'MON-YY')
    and (USAR_status like 'CLOSED' or usar_status like 'OPENED' or USAR_Status like 'WORKING')
    group by to_char(open_date, 'DD-MON-YY')
    UNION
    select 'Closed' "status", count(*) "Close", to_char(close_date, 'DD-MON-YY')
    from usar_log2
    where close_date is not null and
    to_char(close_date, 'MON-YY') = to_char(sysdate, 'MON-YY')
    and (USAR_status like 'CLOSED' or usar_status like 'OPENED' or USAR_Status like 'WORKING')
    group by to_char(close_date, 'DD-MON-YY')
    order by 3, 1 desc;
    The above select statement's results...
    Status Value DATE
    Open 6 02-JAN-08
    Closed 3 02-JAN-08
    Closed 1 03-JAN-08
    Open 1 04-JAN-08
    Closed 1 04-JAN-08
    Closed 1 05-JAN-08
    Open 3 07-JAN-08
    Closed 2 07-JAN-08
    Open 3 08-JAN-08
    Closed 1 08-JAN-08
    Open 1 09-JAN-08
    But I need this instead...
    Status Value DATE
    Open 6 02-JAN-08
    Closed 3 02-JAN-08
    <----- Open 0 03-JAN-08
    Closed 1 03-JAN-08
    Open 1 04-JAN-08
    Closed 1 04-JAN-08
    <----- Open 0 05-JAN-08
    Closed 1 05-JAN-08
    Open 3 07-JAN-08
    Closed 2 07-JAN-08
    Open 3 08-JAN-08
    Closed 1 08-JAN-08
    Open 1 09-JAN-08
    <----- Close 0 09-JAN-08
    Any help would be more appreciative.

    Thank you...You all are great. While I'm still
    looking at the various ways you all provided, from
    what I have looked at so far, they don't address
    05-JAN-08 which has a null open date. There are
    three possiblities, maybe four. Does 05-JAN-08 have a null open date in the data you supplied?
    You showed us:
    OPEN_DATE CLOSE_DATE
    02-JAN-08 02-JAN-08
    02-JAN-08 02-JAN-08
    02-JAN-08 02-JAN-08
    02-JAN-08 03-JAN-08
    04-JAN-08 04-JAN-08
    05-JAN-08
    07-JAN-08
    07-JAN-08 07-JAN-08
    07-JAN-08 07-JAN-08
    08-JAN-08 08-JAN-08
    08-JAN-08
    02-JAN-08
    02-JAN-08
    08-JAN-08
    09-JAN-08
    which looks like they all have open dates.
    Perhaps, if there was null open dates you should have used [code][/code] or [pre][/pre] tags around your data so it looked something like
    OPEN_DATE CLOSE_DATE
    02-JAN-08 02-JAN-08
    02-JAN-08 02-JAN-08
    02-JAN-08 02-JAN-08
    02-JAN-08 03-JAN-08
    04-JAN-08 04-JAN-08
              05-JAN-08
    07-JAN-08
    07-JAN-08 07-JAN-08
    07-JAN-08 07-JAN-08
    08-JAN-08 08-JAN-08
    08-JAN-08
    02-JAN-08
    02-JAN-08
    08-JAN-08
    09-JAN-08And then it would have required the ANSI outer join in my query to allow for outer joining on more than one column...
    SQL> ed
    Wrote file afiedt.buf
      1  WITH t as (SELECT to_date('02-JAN-2008','DD-MON-YYYY') as open_date, to_date('02-JAN-2008','DD-MON-YYYY') as closed_date from dual union all
      2             SELECT to_date('02-JAN-2008','DD-MON-YYYY'), to_date('02-JAN-2008','DD-MON-YYYY') from dual union all
      3             SELECT to_date('02-JAN-2008','DD-MON-YYYY'), to_date('02-JAN-2008','DD-MON-YYYY') from dual union all
      4             SELECT to_date('02-JAN-2008','DD-MON-YYYY'), to_date('03-JAN-2008','DD-MON-YYYY') from dual union all
      5             SELECT to_date('04-JAN-2008','DD-MON-YYYY'), to_date('04-JAN-2008','DD-MON-YYYY') from dual union all
      6             SELECT NULL, to_date('05-JAN-2008','DD-MON-YYYY') from dual union all
      7             SELECT to_date('07-JAN-2008','DD-MON-YYYY'), NULL from dual union all
      8             SELECT to_date('07-JAN-2008','DD-MON-YYYY'), to_date('07-JAN-2008','DD-MON-YYYY') from dual union all
      9             SELECT to_date('07-JAN-2008','DD-MON-YYYY'), to_date('07-JAN-2008','DD-MON-YYYY') from dual union all
    10             SELECT to_date('08-JAN-2008','DD-MON-YYYY'), to_date('08-JAN-2008','DD-MON-YYYY') from dual union all
    11             SELECT to_date('08-JAN-2008','DD-MON-YYYY'), NULL from dual union all
    12             SELECT to_date('02-JAN-2008','DD-MON-YYYY'), NULL from dual union all
    13             SELECT to_date('02-JAN-2008','DD-MON-YYYY'), NULL from dual union all
    14             SELECT to_date('08-JAN-2008','DD-MON-YYYY'), NULL from dual union all
    15             SELECT to_date('09-JAN-2008','DD-MON-YYYY'), NULL from dual)
    16      ,all_dates as (select minod+rownum-1 as dt
    17                     from   dual, (select min(open_date) minod, max(open_date) maxod from t)
    18                     connect by rownum <= maxod-minod+1)
    19      ,stat as (select 'open' as status from dual union all select 'closed' from dual)
    20  -- END OF DATA
    21  select all_dates.dt, stat.status, sum(decode(decode(stat.status, 'open', t.open_date, t.closed_date), all_dates.dt, 1, 0)) as cnt
    22  from   stat JOIN all_dates ON (1=1)
    23         LEFT OUTER JOIN t ON (NVL(t.open_date, NVL(t.closed_date, all_dates.dt)) = all_dates.dt)
    24  group by all_dates.dt, stat.status
    25* order by 1,2 desc
    SQL> /
    DT        STATUS        CNT
    02-JAN-08 open            6
    02-JAN-08 closed          3
    03-JAN-08 open            0
    03-JAN-08 closed          0
    04-JAN-08 open            1
    04-JAN-08 closed          1
    05-JAN-08 open            0
    05-JAN-08 closed          1
    06-JAN-08 open            0
    06-JAN-08 closed          0
    07-JAN-08 open            3
    07-JAN-08 closed          2
    08-JAN-08 open            3
    08-JAN-08 closed          1
    09-JAN-08 open            1
    09-JAN-08 closed          0
    16 rows selected.
    SQL>Make your requirements clear in the future.

  • Need Help with Advanced Filters

    I hope someone can please help A.S.A.P. my current project
    depends on getting the searches to function correctly I have found
    the Multiple Filters very useful all it needs is a little tweaking,
    I have tried but failed
    1st Main Problem
    The problem with the multiple filter it only work
    alphabetical, I need to be able to filter facilities
    for example a restaurant has up to 10 facilities I would like
    to tick the facility to show the live result
    in the DB there is either a 1 or 0 in the field, so I tried
    the following code
    this is what I am trying to achieve but with the Live
    Searches
    http://www.dinewithus.co.uk/dining/shropshiresearch.php
    var dsCounties = new
    Spry.Data.XMLDataSet("http://www.dinewithus.co.uk/new/xml/county.xml",
    "/counties/county");
    var dsLocation = new Spry.Data.XMLDataSet("
    http://www.dinewithus.co.uk/new/xml/{dsCounties::url2}",
    "export/row");
    var gEffectInProgress = null;
    var gPendingSetRowIDRequest = -1;
    function ffAH(ds, row, index){ var c =
    row.smoking_al_fresco.charAt(0); return c = '1' ? null : row; };
    function ffIP(ds, row, index){ var c =
    row.disabled_access_facilities_fac.charAt(0); return c = '1' ? null
    : row; };
    function ffQZ(ds, row, index){ var c =
    row.real_ales_fac.charAt(0); return c = '1' ? null : row; };
    function ToggleFilter(enable, f)
    if (enable)
    pvLocation.addFilter(f, true);
    else
    pvLocation.removeFilter(f, true);
    function RemoveAllFilters()
    document.forms[0]["fAH"].checked = false;
    document.forms[0]["fIP"].checked = false;
    document.forms[0]["fQZ"].checked = false;
    pvLocation.removeAllFilters(true);
    2nd Issue (not sure if possible?)
    currently using the paging example I am able to show all the
    records in different regions, the only problem is the filter Area
    is a text box I need this to be a dropdown search, fetching
    DISTINCT results from the towns filed in the DB, I managed to do
    this creating another dynamic data set DISTINCT town which showed
    all the towns but once selecting an option did not change the
    results below ideally I need something similar my county search but
    for towns the town are dynamically showing from DB but the counties
    are showing from 1 XML file
    http://www.dinewithus.co.uk/new/xml/county.xml

    That's just it. I select Library or Filters from the Window dropdown menu and neither window opens up. Could it be my 15.4" MacBook Pro screen isn't big enough to see the interface?

  • Need help with a SELECT statement

    Dear forumers,
    I'm a newbie in ABAP and I'm trying to figure out what the following line means (in bold letters):-
    SELECT SINGLE STAT2 FROM PA0000 INTO PA0000-STAT2
    WHERE PERNR = ITAB_DATA-STAFF_NO.
    Does this mean that the single data from the STAT2 field is selected and then placed back into the same field (doesn't quite makes sense, right)?
    Please help and many thanks in advance!

    SELECT SINGLE STAT2 FROM PA0000 INTO PA0000-STAT2
    WHERE PERNR = ITAB_DATA-STAFF_NO.
    Does this mean that the single data from the STAT2 field is selected and then placed back into the same field (doesn't quite makes sense, right)?
    it sense very much right.
    have you heared about table buffer concept?
    here this concept exactly comes.
    try with this below code:
    TABLES:pa0000."tables must be decleare
    SELECT SINGLE STAT2 FROM PA0000 INTO PA0000-STAT2.
      write:PA0000-STAT2.
    and since you are using select single than you should be use much key as much possible for getting accurate data.other wise system will pick first data which match your where condition.
    Amit.

  • Need help with cursor selection in control panels

    I can't get my cursor to work in the control panel at the top of the screen, for example, when I select text and want to change the font size, etc.  It won't even select to change from font to paragraph mode.  Other issues are trying to choose the selection tool, which I can only do with the "V" shortcut tool--escape doesn't work, nor does the cursor choose the  icons.  Help!

    Windows? see InDesign tools and panels don't respond to mouse clicks (Windows 7/Vista)

  • Need Help with Advanced Button Actions

    I am a brand new Captivate 5 user and I have created a image button that I want to have a double action. When the user clicks on the image button, I want it to SHOW a new button AND SHOW another image. I used the Advanced Actions but it does not work when I preview project.  Help!

    Hello and welcome to the forum,
    Did you assign the advanced action to the image button as Success action? And the new button + the image have to be on the same slide, but with the status Invisible. You can not show hidden objects that are sitting on another slide then the slide with the advanced action.
    If you want to have more information about advanced actions, I do blog a lot about them. Here is the link to my blog:
    http://lilybiri.posterous.com
    Lilybiri

  • Need Help with Advanced SQL Query

    It's advanced for me, at least. I have three tables that I
    need to use:
    Product (product_id and product_title are the fields)
    shipRegion (shipRegion_ID)
    product_shipRegion_shipCharge (product_id, shipRegion_ID,
    primaryShipCharge, secondaryShipCharge)
    What I am trying to do is create a query that will look for
    two things:
    1. Any product that is listed in the
    product_shipRegion_shipCharge table that has a primary or secondary
    ship charge of $0.00 or is NULL.
    That part is easy:
    SELECT DISTINCT p.product_id, p.product_title
    FROM product p
    INNER JOIN product_shipRegion_shipCharge pss ON p.product_id
    = pss.product_id AND (pss.primaryShipCharge IS NULL OR
    pss.primaryShipCharge = 0 OR pss.secondaryShipCharge IS NULL OR
    pss.secondaryShipCharge = 0)
    WHERE p.display = 1
    AND p.price > 0
    It's this next part that's tricky for me:
    2. Get the product_id and product_title (from the product
    table) that does NOT have any entry in the
    product_shipRegion_shipCharge table.
    I'm guessing that I need to include some kind of LEFT JOIN in
    the above query to find out what all of the regions are (from the
    shipRegion table) and then see what's missing for each product in
    the product_shipRegion_shipCharge table, but I have no idea how to
    do it.
    Anyone?
    Josh

    This should be what the query would look like using the left
    join:
    SELECT product_table.product_id, product_table.product_title
    FROM product_table
    LEFT OUTER JOIN product_shipRegion_shipCharge
    ON product_shipRegion_shipCharge.product_id =
    product_table.product_id
    WHERE product_shipRegion_shipCharge. product_id IS NULL
    SQL Server's query optimizer will probably turn the '...IN
    (subquery)' or '...exists (subquery)' into this kind of execution
    plan on its own - depending on your table structures.

  • Need help with advanced JTable

    The application I am converting to Java has a string grid (table) with special behavior that I need to be able to bring to the Java version. It let's users filter the column data (that I know how to do) using a locked first row (just below the column header) that always stays in place and that shows what filter is applied to each column (by showing a combo box).
    I usually write server apps and have only been trying to grasp Swing for about a week, and I find myself stuck :(
    Is this at all possible in Java? If not, can I make the header respond to mouse events and show a popup menu for each column? If so how?
    Please help!

    I have made an attempt as follows (to show where I am stuck).
    I have two TableModels that contain rows and data;
    a) the grid data that's coming from our EJB session facade
    b) the filter settings (a String[] with initially empty strings) which show what filter is used for each column.
    The two table models are shown in two tables that share a common TableColumnModel so that whenever i move or resize a column both tables are updated.
    The filter table shows it's header and the row of empty cells. The Table Model I've used for it is ripped from the Sorted Table example from Sun, so that I can capture mouse events, set the sort order for each column and notify the grid table that it needs to update accordingly.
    I attempted to use the filter table as a header view in a JScrollPane, which would keep it in place all the time while the user would be able to scroll and resize the grid table.
    This is where I fail - I can't even get it to show up in the header. And if I only put the two tables on a JPanel it seems impossible to get them to stick together when the pane is resized (aside from the fact that I no longer can capture the mouse events).
    I'd be happy to send someone the code fragments if you think you have a solution to this - that will allow users to resize, edit and move columns in a table where you initially have no clue as to how many columns it will contain.
    Please please continue to help me :)

  • Need help with advanced Query

    I am stuck on a query and hope someone can help me out with
    it. Basically I am trying to get the average score by team who has
    competed in four or more events.
    So far I have my query doing a join to pull in the teams name
    and their category. What I want to do is be able to count the
    unique locations and do an average of the four highest scores on a
    field called overall.
    I have tried putting a couple different COUNT in my query's
    WHERE statement but it errors out.
    Any ideas? Some how I have a feeling I need to create a new
    table.
    Thanks

    chieffan wrote:
    > I am stuck on a query and hope someone can help me out
    with it. Basically I am
    > trying to get the average score by team who has competed
    in four or more events.
    >
    > So far I have my query doing a join to pull in the teams
    name and their
    > category. What I want to do is be able to count the
    unique locations and do an
    > average of the four highest scores on a field called
    overall.
    >
    > I have tried putting a couple different COUNT in my
    query's WHERE statement
    > but it errors out.
    >
    > Any ideas? Some how I have a feeling I need to create a
    new table.
    >
    > Thanks
    You need to use GROUP BY. Will need to know more specifics
    about the
    table construction along with sample data, and an example of
    the
    expected results.
    Dooza

  • Need help with special select case

    Oracle DB 12c, I think 12.1.2
    drop table person_tests;
    create table person_tests (
    person_id number,
    test_type_id varchar2(1),
    test_date date
    insert into person_tests (person_id,test_type_id,test_date) values (1,'A',to_date('01012000','MMDDYYYY'));
    insert into person_tests (person_id,test_type_id,test_date) values (1,'A',to_date('01022000','MMDDYYYY'));
    insert into person_tests (person_id,test_type_id,test_date) values (1,'B',to_date('01032000','MMDDYYYY'));
    insert into person_tests (person_id,test_type_id,test_date) values (1,'B',to_date('01042000','MMDDYYYY'));
    insert into person_tests (person_id,test_type_id,test_date) values (1,'C',to_date('01052000','MMDDYYYY'));
    insert into person_tests (person_id,test_type_id,test_date) values (2,'C',to_date('01062000','MMDDYYYY'));
    insert into person_tests (person_id,test_type_id,test_date) values (3,'A',to_date('01072001','MMDDYYYY'));
    insert into person_tests (person_id,test_type_id,test_date) values (3,'A',to_date('01082000','MMDDYYYY'));
    insert into person_tests (person_id,test_type_id,test_date) values (3,'B',to_date('01092000','MMDDYYYY'));
    insert into person_tests (person_id,test_type_id,test_date) values (3,'B',to_date('01102000','MMDDYYYY'));
    insert into person_tests (person_id,test_type_id,test_date) values (3,'C',to_date('01102000','MMDDYYYY'));
    Persons as participating in certain tests: A, B and C where each test is tagged with a date when done.
    I need to output only people that completed 2 tests of type A, 2 tests of type B and 1 test of type C. I have to display the test type and the date of the most recent of those tests. In the example above, desired output would be
    1 C            05-JAN-00
    3 A            07-JAN-01
    Hope this problem definition makes sense

    Hi,
    Sorry, I missed the requirement about showing the most recent test_type_id.
    Assuming the date to be shown is the date the minimum requirements were fulfilled (whether of not gratutitous tests came afterwrds), you can do something like this:
    WITH    got_r_num    AS
        SELECT  person_id, test_type_id, test_date
        ,       ROW_NUMBER () OVER ( PARTITION BY  person_id, test_type_id
                                     ORDER BY      test_date
                                   )   AS r_num
        FROM    person_tests
        WHERE   test_type_id  IN ('A', 'B', 'C')
    SELECT    person_id
    ,         MIN (test_type_id) KEEP (DENSE_RANK LAST ORDER BY  test_date)  AS last_test_type
    ,         MAX (test_date)                                                AS last_test_date
    FROM      got_r_num
    WHERE     r_num  <= CASE  test_type_id
                            WHEN  'A'  THEN  2
                            WHEN  'B'  THEN  2
                            WHEN  'C'  THEN  1
                        END
    GROUP BY  person_id
    HAVING    COUNT (*)  = 5  -- 2 'A's  +  2 'B's  +  1 'C'
    What test_type_id would you want to display in case of a tie for the latest test?
    I just saw your post saying that a person with 3 or more type 'A' tests should be excluded.  In that case, my original solution (with = in the main WHERE clause) is what you want; only used LAST to get the latest test_type_id.  The solution in this message is for the situation where you don't care if someone had 3 or more 'A's, but you want to ignore all but the first 2.

  • PSE8 - Need help with bizarre selection problem with spot healing and clone tools

    In using clone stamp and spot healing brush--. When I Alt click for my sample I get entire image---acting as if I'm moving a layer---whether I'm working on a single or multi-layer image.  This is PSE8 3 gig ram windows ----Lenovo Core II duo  P8400  @ 2.26 GHZ  with ATI 256 meg graphics
    This sure is fun!!!
    I'm trying to get rid of an old numbering imprint on a film(not digital) image.

    Actually the overlay option is helpful. It shows the region that you are copying - and i dont think thats causing the issue.
    The issue is because you dont have the clip option checked along with Overlay.
    Just make sure you have both Overlay and Clipped options checked and you would not see this problem anymore.
    Regards,
    Pri
    (Attached an image of the settings)

  • Need help with advanced color adjustments

    Hello people,
    A costumer asked me to design a sofa brochure. All product images have the same yellowish lighting and I will have to adjust them of course. But I'm struggling with it.
    What is the best way to have 100% correct colors?

    Once you get a sample, you most likely will have to use curves to correct the color crossover of the color difference between the highlights (too yellow-red) and the shadows too cyan.  Depending upon your other images,  there are several ways to do this.  You can try just using straight curves to adjust the color difference between the highlights and the shadows, you can use color range to select the colors that are off and make a mask to balance those colors with either curves or hue/saturation, or if the other images have a solid color like this one, you can use a solid color adjustment layer set to color blend mode and tweak the blend if sliders to not have the deep shadows return them to a more neutral color.  The left half of the attached image uses the solid color fill layer, and the right half uses color range and curves.

Maybe you are looking for