Restrict records in Query

Hi All,
I need to restrict the records in my query based on transactions. 
Ex: Company Code     Date         Cost Center   Amount
         10000             1/1/2000          100             20000
                               2/1/2000          200             30000
                                                      100             40000
if more than one transaction, then only it has to show in the Report. 
Example: Two transactions done on 2/1/2000(this transaction has to show in the report). on 1/1/2000 only one transaction So, i willn't be display in the report.
What i need to to. Can i create keyfig count in cube?
Please help me on this.
Thanks,
KN

Hey you can try this.
Create a calculated Key figure.Put some key fig into it.
In the next step click the enhance button ---> there you can define exception aggregation as "Couting all values" and reference characteristic as your key date.And put the conditon count >1 in query.
or
Create a key fig COUNT as number and in aggregation choose exception aggregation as counting all values and ref char as tdate.This should do it,use it in the cube,dont map anything to it and use this in query condition as count >1.
Hope this helps.

Similar Messages

  • Creating Restrictions in BEx query designer for (1-a), where a is variable.

    Dear All,
    >>  Suppose for the variable in the BEx query designer, I've created restriction for 0FISCPER to the variable 0P_PER (as 0P_PER-1) by right clicking 0P_PER3, from that a dialog box appears.  In that I've selected 0P_PER3 and then clicked on offset variable and when I set the offset variable, it works for (0P_PER-1.etc, 0P_PER+1,etc..)
    But if I want to have (1-0P_PER), then plz tell me how to define this restriction?
    Plz explain me the steps to perform (1-0P_PER) restriction in BEx query designer in BW1.
    I'm using SAP BI 7.2 gui.
    Expecting your reply soon,
    with Regards,
    Jerald

    My requirement is that I want to have " 1-fiscal year"., But this I could not define using offset variables, since using offset we can define "fiscal year +1" or "fiscal year -1". 
    So there would be some other way to define "1-fiscalyear".  So Please help me to define "1-fiscalyear"  by giving me the steps.
    Thank you,
    with Regards,
    Jerald

  • How we can restrict record in CTL file on the basis of other table ?

    Hello all,
    How we can restrict record in CTL file on the basis of other table ?
    Eg.
    I have following control file to load the records in the table through the sql loader.
    LOAD DATA
    INTO TABLE THIST APPEND
    FIELDS TERMINATED BY "|" TRAILING NULLCOLS
    LNUM POSITION(1) Char "substr(:LOAN_NUM, 4, 13)",
    TSRNUM Char "rtrim:TRAN_SR_NUM)" ,
    TPROCDT Char "to_char(to_date rtrim:TRAN_PROC_DT), 'MMDDYYYY'), 'YYYYMMDD')"      
    I have another table c all TFILE in which I have LNUM. I want to import only those records from input text file using the control file and sql loader in which LNUM is exist in the TFILE.
    So how i can restrict it in the Control File.
    Thanks
    Kamlesh Gujarathi
    [email protected]

    Hello Satyaki De.
    Thank you very much for your suggestion but my Private information is totally apart from this question & I already I have changed each and every information from the question.
    Thanks
    Kamlesh Gujarathi
    [email protected]

  • Restrict user SELECT query time on a particular VIEW

    Hi - I am trying to restrict user SELECT statemnet time on a particular view.There is a user called ABC and he is accessing many objects in database.All SELECT statments are fine execept when he query a particular VIEW.That view SELECT causing performance problem.So I am trying to restrict the SELECT query time on a VIEW.
    Can you please help me to achive this task through some SQL command like ALTER USER etc...
    Thanks for your help.

    user2538196 wrote:
    Hi - I am trying to restrict user SELECT statemnet time on a particular view.There is a user called ABC and he is accessing many objects in database.All SELECT statments are fine execept when he query a particular VIEW.That view SELECT causing performance problem.So I am trying to restrict the SELECT query time on a VIEW.
    Can you please help me to achive this task through some SQL command like ALTER USER etc...
    Thanks for your help.It sounds like you are really trying to solve a performance problem with the view. I agree with Justin that the solution to restrict access to the view dynamically sounds unwieldy.
    Consider tuning the view, or perhaps the query using the view. Post the view and see if anyone can help you tune it.

  • Get the latest date record in Query

    Hi, Expert:
    Please help on this:
    The requirement is to get the the latest date record in Query. For example:
    Data in provider:
    Plant          date            amount
    A01         2007/04/08      30
    A01         2007/06/09      70
    A01         2007/12/08      30
    we only want the query display:
    A01         2007/12/08      30
    I have tried exception aggregation, but it does not work. Any ideas are highly appreciated.

    Or you can model the date as a key figure after 0date_kyf and set aggregation to max, you'll get something like
    select plant, amount, max(date) from ... group by plant, amount
    used it for inventory reporting (materials and their last movement date, days from the last movement etc.) and worked well.

  • Lock record on query for single user

    Is there any way to use the on-lock trigger to lock a particular record as it is simply queried, instead of after a change has been made to it. For instance, if user A is viewing a queried record, and user b attempts to query the same record, then we would display a message to user b stating that the record is unavailable, or simply just skip it. I know that if a field in the current record is altered, forms recognizes the status of the record as 'CHANGED' and will then by default proceed to lock the record until a commit or rollback is issued. However, this is not what we are looking for. I have read a little about this, and I have seen an example through a datablock based upon a stored procedure, a ref cursor select for update statement. (NOTE: we are not basing our datablock on a stored procedure though)
    We have two scenarios that require this type of locking capability. The first simply queries one distinct record, and the second queries a distinct result of records.
    A select for update statement would suffice for the first scenario, i.e. if another user tries to query the same record, their query is denied; however, for the second scenario when two users perform the same query, user a is viewing record #1, and user b's program sees that record #1 is 'locked' and thus proceeds to the next record in the result .
    Any suggestions? Thanks in advance.
    Eric M Weiss

    You don't need to override on-lock you can just call the LOCK_RECORD built-in in POST-QUERY or whatever.

  • Record group query question

    Just wondering if we need to check :system.mode = query or normal in the query for record groups or oracle forms handles it automatically
    Thanks

    No, you should not check System.Mode in a record group query. But then, Forms does not do that either.
    Your question makes me wonder what you are doing... Record groups are usually populated only when you need to see a list of values, or use an LOV to perform an edit.

  • List item - Record Group Query - Alignment improper Order

    Dear All,
    When am trying to concatenate two columns using record group query and displaying in the list item, the alignment is not in proper order.
    E.g; Below is the columns and data's used in process:
    CODE_VALUE     SHORT_DESC     DESCRIPTION
    ROLL1     Customer - Non accidental     Production, booking with other carrier, bad projection.
    ROLL2     Customer - Accidental     L/C, B/L draft, Customs, Samples, AMS, LAR.
    ROLL3     ABC - Lack of empty     Lack of empty units.
    ROLL4     ABC CDE - Roll over     AGR RRR decision.
    ROLL5     ABC XXX - Accidental     IMO or OOG refused, operational problems, Cut & Run.
    ROLL6     ABC YYY - Fictive booking     Equipment buffer, dummy booking.
    Below is the record group query used in forms:
    PROCEDURE p_when_new_form_instance
    IS
    GROUP_ID recordgroup;
    list_id item := FIND_ITEM ('BLK_CONTROL.LI_ROLL_REASON');
    rg_name VARCHAR2 (20) := 'LI_ROLL_REASONS';
    status NUMBER;
    l_query VARCHAR2 (4000);
    BEGIN
    l_query :=
    'SELECT rpad(short_desc,50,'' '')||'' | ''||description description, code_value code_value FROM codes WHERE code_value IN (''ROLL1'', ''ROLL2'', ''ROLL3'',''ROLL4'',''ROLL5'',''ROLL6'')';
    GROUP_ID := CREATE_GROUP_FROM_QUERY (rg_name, l_query);
    status := POPULATE_GROUP (GROUP_ID);
    POPULATE_LIST (list_id, GROUP_ID);
    EXCEPTION
    WHEN OTHERS
    THEN
    pl_common.when_others;
    END;
    Moreover i have my list item font property by default as ""MS SANS SERIF" and when i run in Forms Builder am getting the alignment as below.
    Result:
    ====
    DESCRIPTION     CODE_VALUE
    Customer - Non accidental | Production, booking with other carrier, bad projection.     ROLL1
    Customer - Accidental | L/C, B/L draft, Customs, Samples, AMS, LAR.     ROLL2
    ABC - Lack of empty | Lack of empty units.     ROLL3
    ABC CDE - Roll over | AGR RRR decision.     ROLL4
    ABC XXX - Accidental | IMO or OOG refused, operational problems, Cut & Run.     ROLL5
    ABC YYY - Fictive booking | Equipment buffer, dummy booking.      ROLL6
    Above order is not the expected result as all the |(pipe) symbol should display in proper order as below.
    Expected Result:
    ==========
    DESCRIPTION     CODE_VALUE
    Customer - Non accidental | Production, booking with other carrier, bad projection.     ROLL1
    Customer - Accidental | L/C, B/L draft, Customs, Samples, AMS, LAR.     ROLL2
    ABC - Lack of empty | Lack of empty units.     ROLL3
    ABC CDE - Roll over | AGR RRR decision.     ROLL4
    ABC XXX - Accidental | IMO or OOG refused, operational problems, Cut & Run.     ROLL5
    ABC YYY - Fictive booking | Equipment buffer, dummy booking.      ROLL6
    I tried with RPAD and LPAD still the alignment issue is there; i know the issue is because of invariable length of the font.
    But is there any solution to override this it will be of great help.
    So please help!!!!!!!!!!!!!!!!!
    Thanks..................
    Regards,
    Sunil.G

    Hi Francois,
    Thanks for your reply. I have tried changing the font to "Courier(Western)" it is working fine.
    But as per the standards defined, it should be "Ms Sans Serif" nothing apart from that.So that is where the problem lies. :(
    Regards,
    Sunil.G

  • ORA-00904 when use column alias in Record Group Query

    Is it possible to use column aliases in Record Group Queries?
    I have a query that runs fine in SQL*Developer, but gives me runtime errors when I use it as a Record Group Query.
    When I use it as a Record Group Query, the Form compiles, but at runtime I receive the following errors:
    FRM-40502: ORACLE error: unable to read list of values
    when I use Help - Display Error, I see:
    ORA-00904:"CHILDNAME":invalid identifier
    The query is something like this
    select decode(complex stuff here) as "childname" ....
    I've tried it with and without the double quotes surrounding the alias name, and have also tried it without using the "as" keyword.
    I would appreciate any suggestions or insights. I'm using Forms 9.0.4.
    Thanks.

    It looks like this is caused by bug 725059:
    "FILTER BEFORE DISPLAY" DOESN'T WORK IF LOV HAS COLUMN ALIASES (TRIAGE1098)
    My LOV does have the Filter Before Display turned on. Here's the text of the bug:
    IF an LOV is created with column aliases in the select statement, (eg: select ename emp_name from emp) and the LOV property "Filter Before Display" is "Yes", THEN when you attempt to filter the LOV at runtime, (eg: type '%' then press the 'Find' button) the internal WHERE clause that forms sends to the database is: WHERE column_alias LIKE '%%' This is incorrect syntax. A client-side sqlnet trace shows this. The correct syntax should be: WHERE column LIKE '%%' . The incorrect syntax results in no rows returned. However no error is displayed by forms to the user.

  • Single record in query are splitted inot two record after creating the view

    HI ,
           We have created one query and when we execute with characteristics combinations we get some record.
           we have created the view on the same query and when we execute the view ,the same record is splitted into 2 lines with some of the key figures are showing in one line and remainig are in other line.
    please suggest here.

    Look at your source data. Keep in mind that your queries are just that.. queries. The number of rows of results is not a reflection of the number of database records you have in your infoprovide. It is what your query asked the infoprovider to give you.
    For example:
    You have two records. Both records have the same 'customer'. One record has document number "A", the other has document number "B". Record "A" has key figures Sales and Profit, Record "B" has key figures Quantity and Margin.
    Query 1 asks for Customer, Sales, and Margin. It will return both records A and B as one row of data, with the Sales data from record A, and the Margin data from record B
    Query 2 asks for Customer, Document number, Sales, and Margin. It will return two rows of data... the first showing record A and Sales but no margin, the second showing record B and Margin but no sales.

  • Record Group Query - item block

    I need to calculate a Record Group Query using a block item value, but when a use the query below the query didn't return rows:
    SELECT OID_SIIB_FINALIDADE_TED
         , F.COD_FINALIDADE || ' - ' || F.DES_FINALIDADE DES_FINALIDADE
      FROM SIIB_FINALIDADE_TED F
          , ( SELECT P.TP_PARAMETRO
                FROM SIIB_PARAMETROS_GERAIS P  
              WHERE P.NM_PARAMETRO = 'TIPO_' || :BLOCK.ITEMX ) PAR -- using the :BLOCK.ITEMX the query did'nt return data
    WHERE PAR.TP_PARAMETRO = F.TPO_FINALIDADEBut if a use a static query the Record Group( changing :BLOCK.ITEMX for 'STR0005' ) return the desired values.
    This Record Group is used to pupulate a LOV.
    Edited by: user5914526 on Feb 15, 2012 9:26 AM
    Edited by: user5914526 on Feb 15, 2012 9:26 AM
    Edited by: user5914526 on Feb 15, 2012 9:29 AM

    No, it doesn't .
    And return the message: "There aren't data in the List of Values"
    And the block item is not empty or null.
    Edited by: user5914526 on Feb 15, 2012 10:13 AM

  • Changing the record group query in seeded forms

    Hi all,
    I need to change the record group query in one seeded form.
    Can it be done through custom pll or what is the correct approach to do that..
    Thanks,
    Devang

    you want to do that at runtime?

  • Using record filter query to handle behavior of facets

    Hi all,
    I know for multiselect/single dimensions we should always perform a dimension query to populate the behaviour of our faceted navigation , but i still want to understand if instead of dimension query i perform a record filter query on my facets click then what all flexibility will i loose with the multi select/single select facets.
    Regards,
    Edited by: IKumar on Apr 7, 2012 11:48 AM

    Hi.
    In general record filters and navigation provide similar functionality (faceted search). Depending on your requirements, you can use one or the other or even a combination. There are two things related to records filters that you need to be aware of when considering their use in a scenario like yours.
    1. Record filters are applied as the very first step in the query evaluation. They are used to define a sub-set of the indexed data for further query evaluation. This can have an effect on spell corrections and DYM suggestions. Since the MDEX calculates spell corrections and DYM suggestions from the actual data and not based on an external dictionary, you may find that these are more "strict" when using record filters since a smaller data set is used for their evaluation. That said, I have not yet seen this become an issue in real projects for the last 8 years.
    2. Record filters do not give you breadcrumb information. Incorporating the record filter as a breadcrumb will require some custom coding (custom = can't copy-paste from the reference app) and could become a bit complicated.
    Regards
    Pavlos

  • How to restrict records in Infoset query

    Hi Friends,
      I have created an Infoset & a query based on this infoset. I would like to restrict certain records being displayed, based on field value, say if field A = 'Blank' I do not want to see this record on the Bex report.
    Please let me know if this is possible at all.
    Thanks,
    JB

    Hi,
    if you want to restrict a report based on a characterristic value you have to:
    1)Open the query in design mode
    2)Insert the characteristic in your report (in this example field "A")
    3)Double clikc in the characteristic
    4)You will see 2 tabshett, here you have the option to restrict in a estatic (using a fix value) or dinamic value (usign variable)
    5)For example use static value, select the desire value and then OK
    6)Save
    7)Execute.
    Regards
    Asign points if useful please

  • Restricting record in the select query

    Is there any way to restrict the number of search (e.g 10) records in the SELECT query ?

    Hi,
    You can use as below:
    select <fieldname> up to 10 rows from <tablename> into itab.
    Thanks,
    Sriram Ponna.

Maybe you are looking for