Padding query results with dummy records

I have a dashboard report that has one group and subsequest detail rows.  The detail rows consist of a string representation of a date and 6 indicators which go with that date.  My user would like to have a consistent number of records (e.g. the last 12 months) show for each group.  If there is no data available for a given period he wants to display blank indicators in the color gray.
I am interested in any feedback for the best way to do this or if this is even possible.
Using Crystal Xi sp2.
Thaks in advance,
Don

Crystal is driven by the data it gets from the database.  It is far, far easier (IMHO) to make the database return the data to make the Crystal report straight forward than to try to force Crystal to do things driven by logic.
Is it impossible to do in another way?  Probably not.  Is it rational to try?  Probably not! 
BTW, I don't think there's anything in my sample SQL that wouldn't work in Oracle (but it's been a while since I used Oracle, so I could be wrong).
HTH,
Carl

Similar Messages

  • Script for Save Options- Save Query Results with document

    Hi,
    Is there any javascript for Save query results with document in save options? If so where can i find that?
    Thanks
    Kalai

    hi guys,
    I found the answer.The following example shows you how to save the results with the query
    section named “SalesQuery”.
    ActiveDocument.Sections["SalesQuery"].SaveResults=true

  • Query results:every other record/row grey and white

    Hello guys,
    query results:every other record/row grey and white
    how would you make every other record/rows a different color
    just like the forums color. Lightest grey and white?
    <cfquery name="Myqueryname"
    datasource="#Request.MainDSN#">
    SELECT
    CompanyID,
    CompanyName,
    Address,
    City,
    State,
    ZipCode,
    Comments
    FROM
    Company
    ORDER BY
    CompanyName ASC
    </cfquery>
    <html>
    <head>
    <title>CF TUTORIALS</title>
    <link rel="stylesheet" href="styles.css">
    </head>
    <body>
    <h1>All CO Listings</h1>
    <table>
    <tr>
    <td><b>ID</b></td>
    <td><b>Name</b></td>
    <td><b>Address</b></td>
    <td><b>City</b></td>
    <td><b>State</b></td>
    <td><b>ZIP Code</b></td>
    <td> </td>
    </tr>
    <cfoutput query="Myqueryname">
    <tr>
    <td>#CompanyID#</td>
    <td>#CompanyName#</td>
    <td>#Address#</td>
    <td>#City#</td>
    <td>#State#</td>
    <td>#ZipCode#</td>
    <td>
    <a href=" ALL Emps.cfm?CompanyID=#CompanyID#">ALL
    Emps</a>
    <a href=" AddCO Form.cfm">AddCO</a>
    <a href="
    Editco.cfm?CompanyID=#CompanyID#">Editco</a>
    <a
    href="CoDeleteForm.cfm?CompanyID=#CompanyID#">Delete</a>
    </td>
    </tr>
    </cfoutput>
    </table>
    </body>
    </html>

    There is a cool tool in Coldfusion called MOD
    This basically calculates the remainder of the row number
    when divided.
    I interpreted its use to something like this, which has
    worked for me.
    <cfoutput query="qry_requestedlist" maxrows="30"
    startrow="1">
    <cfset EvenRow=#CurrentRow# +1>
    <cfif CurrentRow Mod 2 IS 1>
    <tr>
    <th class="grey" CurrentRow#</th>
    <cfelse>
    <th class="white">#CurrentRow#</th>
    <tr>
    </cfif>
    </cfoutput>
    I doubt this is precisely what you want but this is the sort
    of thing.

  • Numbering query results with a line number in SQL*Plus

    Doesn't it stand to reason that in SQL*Plus there would be a way to number each query results sequentially with line numbers starting at 1 to n -- something option like from a SET command? I'm not talking about linesize.

    There's a column rownum the engine adds into the result sets, just add it to the select list. Can use it to limit the result set (with some limitations) i.e.:
    select rownum, ... from ... where rownum <= 100
    Can't use ">=", that condition will never be met but a subset could be used:
    select * from ( select rownum as linenr, tab1.* from ... ) where linenr between 10 and 20

  • Incorrect query results with conformResultsInUnitOfWork

    Hi,
    has anybody experienced this:
    Take two classes User and Group
    Group has a 1:n Mapping to User (attribute users)
    User has a 1:1 Mapping to User (attribute partner).
    Following query returns too many objects
    User user1 = someUserObject;
    ReadAllQuery readAllQuery = new ReadAllQuery(Group.class);
    Expression e = builder.anyOf("users").get("partner").equal(user1);
    readAllQuery.setSelectionCriteria(e);
    readAllQuery.conformResultsInUnitOfWork();
    Vector vector = (Vector) unitOfWork.executeQuery(readAllQuery);
    It returns
    - the correct Group object as determined from the sql query +
    - any other objects of the same class that are fully instantiated (users is instantiated and for each user, partner is instantiated), even if they don't conform to the expression.
    The same query works properly ;
    - without conformResults
    - or if the other objects are not fully instantiated

    Hi,
    we need an workaround badly and the support is moving at exactly the rate I feared it would.
    So I thought, since we only hit this bug with existing objects and we use conformResultsInUnitOfWork because we want to find the newly created objects, is there a way to get
    - the SQL Query results
    + any new objects that conform to the query
    We still might get new objects that don't conform to the query (this is the bug) but I'll worry about that later if it happens.
    My first attempt at a solution looks like this:
    1. turn off conformResults
    2. manually add all new objects that conform to the query
    I had to guess a little for 2, since I don't know what exactly toplink does to select the "conform" objects.
    private static List findConformNewObjects(UnitOfWork unitOfWork, ReadAllQuery query) {
    List result = new ArrayList();
    Class resultClass = query.getReferenceClass();
    Expression selectionCriteria = query.getSelectionCriteria();
    Enumeration enumeration;
    IdentityHashtable newObjectsCloneToOriginal = unitOfWork.getNewObjectsCloneToOriginal();
    if (newObjectsCloneToOriginal != null && newObjectsCloneToOriginal.size() > 0)
    enumeration = newObjectsCloneToOriginal.keys();
    while (enumeration.hasMoreElements())
    Object o = enumeration.nextElement();
    if (resultClass.isInstance(o))
    if (selectionCriteria != null && selectionCriteria.doesConform(o, unitOfWork, null, query.getInMemoryQueryIndirectionPolicy()))
    result.add(o);
    return result;
    Does this look OK to you? Is there a better way to do it?
    Ana

  • Using an LSMW program with dummy recording.

    Hi all,
       I am new to lsmw, and i am facing some issues with a program i am working on.
    In my current program I created a dummy recording, and bypassed other steps by manually writing my code in the step  'Maintain Field Mapping and Conversion'. I supplied dummy data to all the other steps. When i run the step convert data, the output I get is supposedly redundant because the data generation is already happening in the 'Read Data' step.
    Right now I am generating the output data manually through the conversion program generated for the program I wrote in the  step  'Maintain Field Mapping and Conversion'. Essentially the same thing is happening when i run the 'Read Data' step.
    is it possible to access the data already generated in the 'Read Data' step in the 'Convert Data' step, instead of generating the data all over again(i am doing just that right now) through the conversion program.
    In Short, is there a way to manipulate the data generated in the 'Read Data' step in the 'Convert Data' step.
    Thanks,
    Abhinay

    Hi ,
    Read step is to read the data from the input fyou specified. No code or progam , written in " filed mapping and conversion" step is executed during the read data step. It is executed only during the conversion step.You can modify the data read during the read step anyways during the Coversion step by writing your own logic.
    Regards
    Vijay

  • Copy BW query results with formatting

    When copying a query's results to another workbook, the formatting (namely coloring) changes.  Is there any way to copy the query results to a new workbook and keep the exact same formatting as in original query?

    One way to do this would be to copy the worksheet with the results to the other workbook, as follows:
    Edit --> Move or copy sheet... --> change "To book:" to the 2nd workbook --> check "Create a copy" option --> OK
    After doing that, you can cut & paste from the copied worksheet to other worksheets in the workbook, if necessary, and the formatting will be maintained.
    Hope this helps...
    Bob

  • Query error - with filtering records

    Hi. I have a gallery that shows 9 records at a time, which
    you can then move on to subsequent pages. I added filters to narrow
    down the record search, however, I am receiving query errors. This
    is my code:
    <!----- This is setting the initial defaults for the filter
    variables ---->
    <cfparam name="form.ART_CATEGORY_ID" default="">
    <cfparam name="form.ART_TYPE_ID" default="">
    <cfparam name="form.FINE_ART_CLASS_ID" default="">
    <cfparam name="form.searchfield" default="">
    <!----- Populate the CATEGORIES filter drop-down ---->
    <cfquery name="categories" datasource="nancy">
    SELECT *
    FROM CATEGORIES
    ORDER BY ART_CATEGORY_ID
    </cfquery>
    <!----- Populate the TYPES filter drop-down ---->
    <cfquery name="types" datasource="nancy">
    SELECT *
    FROM TYPE
    ORDER BY ART_TYPE_ID
    </cfquery>
    <!----- Populate the CLASS filter drop-down ---->
    <cfquery name="class" datasource="nancy">
    SELECT *
    FROM CLASS
    ORDER BY FINE_ART_CLASS_ID
    </cfquery>
    <!----- Create the filter drop-down selections ---->
    <form method="post" action="root_fineart.cfm">
    <select name="ART_TYPE_ID">
    <option value="" <cfif trim(form.ART_TYPE_ID) eq
    "">selected
    </cfif>> All </option>
    <cfoutput query="types">
    <option value="#ART_TYPE_ID#"
    <cfif form.ART_TYPE_ID eq
    types.ART_TYPE_ID>selected</cfif>>#ART_TYPE#</option>
    </cfoutput>
    </select>
    <select name="ART_CATEGORY_ID">
    <option value="" <cfif trim(form.ART_CATEGORY_ID) eq
    "">selected
    </cfif>> All </option>
    <cfoutput query="categories">
    <option value="#ART_CATEGORY_ID#"
    <cfif form.ART_CATEGORY_ID eq
    categories.ART_CATEGORY_ID>selected</cfif>>#ART_CATEGORY#</option>
    </cfoutput>
    </select>
    <select name="FINE_ART_CLASS_ID">
    <option value="" <cfif trim(form.FINE_ART_CLASS_ID) eq
    "">selected
    </cfif>> All </option>
    <cfoutput query="class">
    <option value="#FINE_ART_CLASS_ID#"
    <cfif form.FINE_ART_CLASS_ID eq
    class.FINE_ART_CLASS_ID>selected</cfif>>#FINE_ART_CLASS#</option>
    </cfoutput>
    </select>
    <!----- This also creates a SEARCH capability ---->
    <input name="searchfield" type="text" size="10"
    value="#form.searchfield#" /></cfoutput> </label>
    <input name="submit" type="submit" value="Submit" />
    <!----- I got this part of the code from a site, that allows
    me to display the 9 records at a time in my gallery ---->
    <cfparam name="start" type="numeric" default="1">
    <cfparam name="step" type="numeric" default="9">
    <!----- My query to retrieve the records... This may be where
    I have something wrong... ---->
    <cfquery datasource="nancy" cachedwithin=".01"
    name="queryResults">
    SELECT *
    FROM ART
    WHERE 1 = 1
    <cfif val(form.ART_CATEGORY_ID) GT 0>
    AND ART_CATEGORY_ID = <cfqueryparam
    value="#form.ART_CATEGORY_ID#" cfsqltype="cf_sql_integer">
    </cfif>
    <cfif val(form.ART_TYPE_ID) GT 0>
    AND r.ART_TYPE_ID = <cfqueryparam
    value="#form.ART_TYPE_ID#" cfsqltype="cf_sql_integer">
    </cfif>
    <cfif val(form.FINE_ART_CLASS_ID) GT 0>
    AND i.FINE_ART_CLASS_ID = <cfqueryparam
    value="#form.FINE_ART_CLASS_ID#" cfsqltype="cf_sql_integer">
    </cfif>
    <cfif trim(form.searchfield) neq "">
    AND ART_TITLE LIKE '%#form.searchfield#%'
    </cfif>
    ORDER BY ART_TITLE ASC
    </cfquery>
    <!----- This is also code I got somewhere else to display the
    gallery ---->
    <cfif queryResults.recordcount gt 0>
    <cfoutput>
    <p class="style1">
    <!--- if past start --->
    <cfif (start-step-step) gt 1>
    <a href="#cgi.SCRIPT_NAME#?start=1"><img
    src="images/Beginning_blue.png" alt="Beginning" width="31"
    height="21" align="absbottom" /></a>
    </cfif>
    <cfif start gt 1>
    <a href="#cgi.SCRIPT_NAME#?start=#start-step#"><img
    src="images/previous_blue.png" alt="Previous" align="absbottom"
    /></a>
    </cfif>
    <strong>#start# - #iif(start * 3 + step gt
    queryResults.recordcount,queryResults.recordcount,start + step-1)#
    of #queryResults.recordcount# records</strong>
    <!--- if still some not displayed --->
    <cfif (start + step) lte queryResults.recordcount>
    <a href="#cgi.SCRIPT_NAME#?start=#start+step#"><img
    src="images/next_blue.png" alt="Next" align="absbottom"
    /></a>
    </cfif>
    <cfif (start+step+step) lte queryResults.recordcount>
    <a
    href="#cgi.SCRIPT_NAME#?start=#queryResults.recordcount-step+1#"><img
    src="images/end_blue.png" alt="End" align="absbottom"
    /></a>
    </cfif>
    </p>
    </cfoutput>
    </cfif>
    <cfloop query="queryResults" startrow="#start#"
    endrow="#start + step/3-1#">
    <table width="100%" border="1" bordercolor="#FFFFFF"
    cellspacing="0" cellpadding="2">
    <tr> <cfoutput query="queryResults"
    startrow="#start#" maxrows="3">
    <td width="33%"
    class="style1">#queryResults.ART_TITLE#</td>
    </cfoutput>
    <cfset #start# = #start# + 3>
    </tr>
    </table>
    </cfloop>
    </td>
    </tr>
    </table></form>
    It seems that the CATEGORIES filter is the only one that does
    not return a ERROR EXECUTING DATABASE QUERY error. However, it does
    not filter all the records... it only seems to filter and return
    the first 4 or 5 records.
    Any thoughts?

    your queryResults query selects only from ART table, while in
    the WHERE
    clause you are apparently using other tables whihc are not in
    your FROM
    clause...
    you need to use JOIN/INNER JOIN/LEFT JOIN/RIGHT JOIN in your
    FROM clause
    to link the other tables. check your db manual for proper
    usage of those
    operators.
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • Incorrect query result with Top N condition and two structures

    Hi,
    I have created a query on a FI-GL infocube with the characteristic 0BUS_AREA in rows and two structures in columns. The first structure has two items / selections (each item is a selection of several GL accounts). The second structure has two items (the first one contains the key figure 0BALANCE for the current period and the second item is a formula that calculates the absolute value of the first item. The first item is hidden). The (simplified) result looks like this (sorry, not very pretty!):
    Business Area Clients Clients fae
    Business Area1 10 15
    Business Area2 20 7
    Business Area 3 15 8
    Overall result 45 30
    I then added one condition using the Top N operator. The condition is defined for all the elements of the structures. When I execute the query, I sometimes obtained an incorrect number of Top N records selected. The problem seems to occur when N is greater than the number of available Business Areas for an element of the structure.
    For example, if N = 8 and data only exists for 5 Business Areas for the structure element Clients, I may end up with 10 Business Areas for the second structure element Clients fae when I only expect 9 (i.e. the top 8 Clients fae + 1 of the Top 8 Clients for which there is no data under Clients fae).
    Has anybody encoutered that kind of problem ?
    Many thanks.
    François.

    Pascal,this is a known behavior with conditions.When you apply condition it just hide the extra rows and it does not impact the result row.So your result row actually shows the value irrespective of the condition you apply.
    Now with the help of local functions like calculate result as summation you can show the correct sum after applying the condition but when you try to use that result in some calculation then it takes the original value thereby discarding the calculated value.
    Same is happening in your case as well.Its taking the original value i.e 350 and not the calculated sum after condition i.e 270.
    Hope this helps.
    Regards,
    AL

  • Need to hide rows in the Query results with blank values

    Hi All,
    We have a requirement like this for Stock Report, we need to display both movements and balance in that report. We display the movement data directly from the Standard cube with input as Fiscal period/year.  When we do like this, we are not able to get the opening balance as fiscal period was in char restrictions pane.
    We have created a dummy keyfigure restricted to Fiscal period ( so that the global filter is not applied and get the inventory data irrespective of fiscal period input ). We have created 3 variables of processing type customer exit and acheived calculating opening balance, current movement and closing balance.
    If FP input is 009.2010 to 010.2010, it will get whatever Qty moved before 009.2010 ( 001.1990 - 009.2010 in exit ) as opening balance and closing balance ( 001.1990 - 010.2010 )  and the Qty KF restricted with another exit varibale ( 009.2010 to 010.2010 ).
    Hope everyone understood the scenario and issue here is, though I give the input 009.2010 - 010.2010 , I get the rows displayed for different periods ( this is because I am retreiving data for all the fiscal periods but restricting it based on input ). How to restrict/hide these rows.
    Your inputs and suggestions are valued.
    Thanks,
    Chandra.

    Hi,
    Try creating a query level field which would populate as "X" (with the IF condition ) if the record falls in the period which you have given for input variable (009.2010 - 010.2010). Then place a query level filter for this field where only records with value "1" for this field is displayed.
    Hope this helps.
    Happy to help further.
    Regards
    Venky

  • Question about different query results with wildcard

    Hi, I'm working with a third party app on SQL Server 2000, and from what I can gather, programmed in C# & VisualFoxPro.
    When we search with
        Note contains 94949
    we get 571 results, when we search with
        Note contains 94949*
    we get 575 results.
    There should be at least a hundred different entries that start with "94949-1" so I expected the query with the wildcard to return something like 680 results, not an additional four rows.
    Searching with
        Note contains 94949-1*
    got 483 results
        Note contains 94949-10*
    got 0 results
    Could someone explain or point me to more documentation on the difference results we get?
    Thanks

    Hi Arnie, thanks for your response.
    My situation is more basic than what appears in your example. Unfortunately, I am working solely through this application so I do not have access to the SQL to test out what you supplied, so my question is more of a need for an explanation of the search results. I do find lots of references to LIKE, Wildcards and pattern matching, but I don't find a way to explain to the users the best and most complete way to search. They mostly need a "this will always get us the results without missing anything" search technique and then to be able to select from a smaller group. I guess I need a basic course in understanding search results: how to get different ones and what they mean.
    Using 
            Note contains 94949-'%'
    returned one more result than when using an asterisk. I don't understand this difference.
            Note contains 94949-'%1'   or
            Note contains 94949-'1%'
    brings nothing nor does not using quotes. But there are hundreds of records which have the string starting with 94949-1 and a varying number of characters after that.
    ?Does the dash read not as a character in the string but as an expression?
    When I use WITHIN 3 characters, I get too few results (eight). If I use AND, I get text unrelated to the account number I am looking for.
    Again when I tried to narrow the search by adding one digit to the string to be matched, I did not get any results, but 500 results from the more general search is too much to scan by opening individual records.
    Thanks for pondering this with me.

  • SQL Query Result with Random Sorting

    Hi Experts,
    My Oracle Version : Oracle9i
    I have three tables which are given below,
    Table Name:     check_team
    team_id      team_code
    100          A
    101          B
    102          C
    103          D
    Table Name:     check_product
    product_id     product_code
    1          XXX
    2          XYZ
    Table Name:     check_team_products
    tprod_id     tprod_team_id     tprod_product_id
    1          100          1
    2          100          2
    3          101          1
    4          101          2
    5          102          1
    6          102          2
    7          103          1
    8          103          2
    Required Output First Time:
    team_id   team_code   product_id   product_code
    100       A           1             XXX
    101       B           2             XYZ
    102       A           1             XXX
    103       B           2             XYZ
    Required Output Second Time:
    team_id   team_code   product_id   product_code
    100       B           2             XYZ
    101       A           1             XXX
    102       B           2             XYZ
    103       A           1             XXXI need the result as Required Output specified above and also the result has to be random too.. Can someone help me in writing a SQL Query to get results as that?
    Added Oracle Version

    So, is it something like this you want?
    SQL> ed
    Wrote file afiedt.buf
      1  with check_team as (select 100 as team_id, 'A' as team_code from dual union all
      2                      select 101, 'B' from dual union all
      3                      select 102, 'C' from dual union all
      4                      select 103, 'D' from dual)
      5      ,check_product as (select 1 as product_id, 'XXX' as product_code from dual union all
      6                         select 2, 'XYZ' from dual)
      7      ,check_team_products as (select 1 as tprod_id, 100 as tprod_team_id, 1 as tprod_product_id from dual union all
      8                               select 2, 100, 2 from dual union all
      9                               select 3, 101, 1 from dual union all
    10                               select 4, 101, 2 from dual union all
    11                               select 5, 102, 1 from dual union all
    12                               select 6, 102, 2 from dual union all
    13                               select 7, 103, 1 from dual union all
    14                               select 8, 103, 2 from dual)
    15  --
    16  -- end of test data
    17  --
    18  select team_id, team_code, product_id, product_code
    19  from (
    20        select t.team_id, t.team_code, p.product_id, p.product_code
    21              ,row_number() over (partition by team_id order by dbms_random.random()) as rn
    22        from check_team t join check_team_products tp on (tp.tprod_team_id = t.team_id)
    23                          join check_product p on (p.product_id = tp.tprod_product_id)
    24       )
    25* where rn = 1
    SQL> /
       TEAM_ID T PRODUCT_ID PRO
           100 A          2 XYZ
           101 B          1 XXX
           102 C          2 XYZ
           103 D          1 XXX
    SQL> /
       TEAM_ID T PRODUCT_ID PRO
           100 A          2 XYZ
           101 B          1 XXX
           102 C          2 XYZ
           103 D          1 XXX
    SQL> /
       TEAM_ID T PRODUCT_ID PRO
           100 A          1 XXX
           101 B          2 XYZ
           102 C          1 XXX
           103 D          1 XXX

  • Problems in query result with infoset and timedep infoobject

    Hi,
    I have the following situation:
    infoobject ZEMPLOYEE timedep
    Infocube 0C0_CCA_C11 (standard cost center/cost element postings)
    -> infoset with infoobject and infocube linked with outer join
    My query should show all active employees in one month without any posting in the infocube.
    My testdata looks like this:
    pernr date from    date to         cost center
    4711  01.01.1000 31.12.2002
    4711  01.01.2003 31.01.2009   400000
    4711  01.02.2009 31.12.9999
    That means the employee is only active between 01.01.2003 and 31.01.2009.
    I expect the following result in the query with key-date 31.01.2009:
    4711  01.01.2003 31.01.2009   400000
    I expect the following result in the query with key-date 01.02.2009:
    no result
    -> because the employee is not active anymore, I don't want to see him in the query.
    My query delivers the following result:
    4711  01.02.2009 31.12.9999
    The first and the last entry in master data is automatically created by the system.
    I tried to exclude the not active employees by selection over cost center in the filter (like cost center between 1 and 9999999, or exclude cost center #). But unfortunately the filter selection does not work, because obviously the attributes are not filled in the last entry.
    Is there anyone who can tell me how I can exclude the last entry in the master data in the query?
    Any help is much appreciated! Points will be assigned!
    best regards
    Chris

    HI,
    problem is that I can't use employe status in this case, beacuse for any reason the people don't use it.
    I have also tried with exceptions and conditions, but the attributes ar enot filled, so it seems that nothing works.
    Do you have any other suggestions?
    Thanks!
    best tregards
    Chris

  • Combine two Query Results with Rank

    Dear All,
    I am business analyst working DB for first time:
    I have two queries:
    1)
    select * from (select "CAFNo","ActionDate","ActionDetail", rank() over (partition by "CAFNo" order by "ActionDate") rnk,
    from "ABC"
    where "ActionDetail"
    like 'CRF successfully submitted and routed to Fulfillment Team%')
    where rnk=1
    Results in
    CAFNo","ActionDate1","ActionDetail"
    2)
    select * from (select "CAFNo","ActionDate","ActionDetail", rank() over (partition by "CAFNo" order by "ActionDate") rnk
    from "ABC"
    where "ActionDetail"
    like '%Customer ID%')
    where rnk=1
    Results in
    CAFNo","ActionDate2","ActionDetail"
    I would like to combine results of two as:
    CAF no, Actiondate1, actiondate2,ActionDetail
    I tried full outer join and other options but with no success. Please help
    Please share concept of joining the two results not the actual query.

    Actually, my query is not equivalent to original. I missed ActionDetail can be something like:
    'CRF successfully submitted and routed to Fulfillment Team A by Customer ID X'Then it fits both LIKE conditions. If such case of ActionDetail is possible then:
    with t as (
                select  *
                  from  (
                         select  1 weight,
                                 "CAFNo",
                                 "ActionDate",
                                 "ActionDetail",
                                 rank() over (partition by "CAFNo" order by "ActionDate") rnk
                           from  "ABC"
                           where "ActionDetail" like 'CRF successfully submitted and routed to Fulfillment Team%'
                  where rnk=1
               union all
                select  *
                  from  (
                         select  2 weight,
                                 "CAFNo",
                                 "ActionDate",
                                 "ActionDetail",
                                 rank() over(partition by "CAFNo" order by "ActionDate") rnk
                           from  "ABC"
                           where "ActionDetail" like '%Customer ID%'
                  where rnk=1
    select  "CAFNo",
            max(
                case weight
                  when 1 then "ActionDate"
                end
               ) "ActionDate1",
            max(
                case weight
                  when 2 then "ActionDate"
                end
               ) "ActionDate2",
            max(
                case weight
                  when 1 then "ActionDetail"
                end
               ) "ActionDetail1",
            max(
                case weight
                  when 2 then "ActionDetail"
                end
               ) "ActionDetail2"
      from  t
      group by "CAFNo"
    /SY.

  • WRONG QUERY RESULT WITH REPORTQUERIES AS SUBQUERIES

    hi,
    i create a ReadAllObject - Query with
    a ReportQuery as SubQuery.
    when execute the query the result at the SubQuery
    contains the data from the database.
    the result does not contain the change of these
    data in memory of the aplication.
    method public void conformResultsInUnitOfWork()
    has no effect
    i have a simple example
    public class A{
    private int id;
    private String name;
    private Collection B = new ArrayList();
    public class B{
    private int id;
    private String name;
    private C c ;
    public class C{
    private int id;
    private String name;
    and the query is
    ReadAllQuery query = new ReadAllQuery();
    query.setReferenceClass(A.class);
    ReportQuery subQuery = new ReportQuery(A.class, subQueryEb);
    subQuery.addAttribute("id");
    subQuery.setSelectionCriteria(eb.anyOf("B").get("C").get("name").equal("Test")));
    query.querysetSelectionCriteria (eb.get("id").notExists(subQuery));

    Conforming subqueries and report queries are not supported in memory. You should be getting an exception thrown stating this.
    Your code does not show the call to conform, make sure it is on the root query, not the subquery.

Maybe you are looking for

  • Dynamic header based on frame

    I have a report which has three layouts in the main section.Like topic A,B,C.I could generate all the three topics one after another by giving page breaks on the frames.But for each topic the header and footer changes. on each frame's format trigger

  • EDI X12 over File Protocol - Handling multiple Interchange Ids

    Hi I am having two types of EDI X12 payloads (with different names). With different Interchange Ids. In my Agreement I have give given one Interchange Id. my tip.properties: allTPInoneDirectory= true identifyFromTP= ANY oracle.tip.adapter.b2b.edi.ign

  • Category search box?

    Hi I'm trying to create a category search similar to NetBeans 6.5 or Safari (Mac OS X) search box, which displays an arrow and magnifying glass on the left for selection of a category (or a field in a table to search on). How is this best done? Help

  • Additive Presets in Lightroom

    For full information please see this discussion: http://forums.adobe.com/thread/421572?tstart=0 I think it is a really useful possible feature. Josh

  • Error Message on Updating Software

    Hi there I keeping getting the following error message when trying to update my BB software on my BB Bold 9900 using MacBook Pro: BlackBerry® Desktop Software failed to validate your BlackBerry® device update. Aborting install due to validation failu