BW query conditions

Hi guys,
I'm a BW consultant and I've built a universe over a BW query with TopX condition.
It should have got back only 5 records, but in QaaWS I get all records.
I have the same problem when I try to sort the data in BW using a condition.
Any suggestios?
Shlomi Weiss

Hi Shlomi,
You can use the where clause for the top X in the QAAWS directly.
In QAAWS you need to select the database ranking and then in the filter option you need to select the Top and select the field on which you want to apply the sort and then drag the feild(on which you want to apply the where clause) just below the Top filter and it automatically appends the where clause.
Please let me know if you are able to get through this.
Thanks,
Amit.

Similar Messages

  • Problem to get ResultSet when it is used a Date type in the query condition

    hello ,
    I having a bit of nightmare getting a ResultSet how result of one simple Query for a table when the condition WHERE involve a Date type.
    To change the String value in a date to use in the query condition, I tried both:
    String strDate = "dd/mm/yyyy";
    (1.) java.sql.Date sqlDate = new java.sql.Date(strDate.getTime() )
    (2.) SimpleDateFormat formatter = new SimpleDateFormat(strDate) ; sqlDate = formatter.parse(strDate);
    and finally I use this code to get the ResultSet:
    sql = "SELECT * FROM myTable Where (idCli = " + cd_Cli + " And dateReg = " + sqlDate + ")";
    statement = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    resultSet = statement.executeQuery(sql);
    boolean ok = resultSet.last();
    totNumberOfRegistration = resultSet.getRow();
    But In both the cases I get a empty resultSet.
    I shoul like if someone would look my code to say me where it is the mistake...
    thank you
    tonyMrsangelo
    P.S. I tryed using PrepareStatement too to get the ResultSet, but in that case I couldn't use the ResultSet because executing the statement resultSet.last() I get the error: "Result set type is TYPE_FORWARD_ONLY"

    In a database like Oracle, you need to use a function like TO_DATE; other databases may have something similar.
    However, the proper way to do this is to use a PreparedStatement. Then you can say
    PreparedStatement ps = conn.prepareStatement("update SOMETABLE set SOME_DATE=? where SOME_ID=?");
    ps.setDate(1, new java.sql.Date(someJavaUtilDate.getTime()));
    ps.setInt(2, theId);
    ps.executeUpdate();

  • How to define the query condition of Image Theme in MapBuilder?

    Hi,
    I'm trying to add an dynamic Image Theme in OracleMap, but there's a problem.I defined the query condition of Image Theme like this:
    select scanimage,shap from image where scanimgid=467
    The shap column is the MBR column
    And the XML CODE:
    <?xml version="1.0" standalone="yes"?>
    <styling_rules theme_type="image" image_column="SCANIMAGE" image_format="JPEG" image_unit="M" image_resolution="1.0">
    <rule>
    <features> select scanimage,shap from image where scanimgid=467 </features>
    </rule>
    </styling_rules>
    When i preview this Image Theme ,there is an ORA-00936 error means lack of expression.
    Is there any problem with my definition?Or can query an image from an Image Theme?
    Thanks a lot for your help!
    Message was edited by:
    N.Mars
    null

    Hi Mars,
    predefined image theme definition does not support a "select" statement in the <features> tag. You should just define a query condition in the <features> tag.
    It seems that you are trying to use an image theme in Oracle Maps, but it currently does not support a FOI image theme. You should add a predefined image theme as part of the basemap, and maybe add scales values to set the visibility range of this image theme.
    Joao

  • How to set a BEx Query Condition in Design Studio (e.g. Net value GT 0)

    Hi experts,
    I have set a simple condition in my BEx Query...
    e.g. key figure "Net value" GT 0 to become only positive values in the query result.
    In the Query runtime the condition works successful, but in the Design Sudio view the defined Query condition doesn´t work.
    In my Design Studio crosstab I have tried to switch between the display setting "Conditional formating Visible" true/false, but without success.
    By the way, before I have posted this thread, I had a look at this two blogs...
    Design Studio 1.0: Create a Scorecard Using SAP BW BEx Query Exceptions
    Design Studio 1.2  - a Second Look
    Any ideas or experiences?
    Thanks and regards,
    Michael

    Hi Michael,
    I think you are mixing up two different BEx terms. Conditions are filters on key figures (show me only the results with a value bigger than 50). Exceptions do not filter the result set, but provide a formatting based on the values in the result set (if value is bigger than 50, make its cell red).
    The Conditional formatting setting in Design Studio refers to the BEx exceptions. For the BEx conditions there isn't such a setting available. You just have to activate the condition in your BEx Query and use that for your data source in Design Studio.
    If you want a workaround to enable/disable conditions from Design Studio, check this blog I wrote: HackingSAP.com - SAP Design Studio and Conditions It shows how you can use variables to adjust the conditions (and also activate) from within Design Studio.
    Cheers,
    Xavier

  • Ak query condition

    Hi all,
    How we can query the following conditions using ak query.
    there is 2 variable say A and B if A&B is present then condition must be where A=value of A and B=value of B this condition works when given qo0 and qo1 value as IN but other condition when A or B is null I am not able to retrieve anything.Please help me when any of the value is null wht is the query to be and condition to be.
    Thanks
    Mark

    Your approach is valid. You can put a complete query in the query condition box. Mapviewer is smart enough to tell whether it's a complete query or a where clause condition.

  • 'Show Query Conditions' in Charts Portlet

    Is it possible to display 'Query' conditions in the 'Run as Portlet' option in a Chart?
    If not, is there a workaround to display the conditions?
    Thanks.

    Juha,
    I have a similar problem what you have. Can you share the solution with me.
    My problem
    My LOV has following select:
    Select ename, empno from emp;
    I want to Show only Ename in the LOV and display Ename on the form too. but I want to store only empno and nothing to do with ename.empno is a hidden column.
    Can anybody please help me. Can you please reply to [email protected] also.
    Thanks in advance.
    Murali

  • Query Rules - length limitation on query conditions set via powershell

    My current client has 200 custom keywords in SP 2010 which they would like to migrate to SP 2013 query results.  I have powershell scripts to perform the export from SP 2010 and import into one of three SP 2013 environments.
    One limitation I have found in powershell -- that does not happen in the search service application UI! -- is a 100 character length limit on the keywords used for matching query conditions (synonym data in SP 2010).   The keywords can be set through
    the UI without limitation but are limited to 100 characters when using powershell!  It makes no sense!
    I suppose my final update could be done by hand (ugh!) and I would much rather be able to script these updates.  
    Any pointers or help?

    Hi grobinson,
    If you used this code line in your Powershell and have the following error:
    [string[]]$QueryRuleTerms=@($QueryRuleConditionTerm)
    Exception calling "CreateKeywordCondition" with "2" argument(s): "The value must be at most 100 characters long.
    Parameter name: Term"
    At line:2 char:1
    + $QueryRuleCondition = $QueryRuleConditions.CreateKeywordCondition($QueryRuleTerm ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentOutOfRangeException
    You need to use the following code line with Split() method to add the multiple terms, it will work.
    $QueryRuleConditionTerm = "a1;a10;a100;a101;a102;a103;a104;a105;a106;a11;a12;a13;a14;a15;a16;a17;a18;a19;a2;a20;a21;a22;a23;a24;a25;a26;a27;a28;a29;a3;a30;a31;a32;a33;a34;a35;a36;a37;a38;a39;a4;a40;a41;a42;a43;a44;a45;a46;a47;a48;a49;a5;a50;a51;a52;a53;a54;a55;a56;a57;a58;a59;a6;a60;a61;a62;a63;a64;a65;a66;a67;a68;a69;a7;a70;a71;a72;a73;a74;a75;a76;a77;a78;a79;a8;a80;a81;a82;a83;a84;a85;a86;a87;a88;a89;a9;a90;a91;a92;a93;a94;a95;a96;a97;a98;a99;a991"
    #use the following codeline, it worked for me
    [string[]] $QueryRuleTerms = $QueryRuleConditionTerm.Split(";")
    $QueryRuleConditions = $QueryRule.QueryConditions
    $QueryRuleCondition = $QueryRuleConditions.CreateKeywordCondition($QueryRuleTerms,$true)
    $QuerySourceContextCondition = $QueryRule.CreateSourceContextCondition($ResultSource)
    $QueryRule.Update()
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Daniel Yang
    TechNet Community Support

  • Syntax for calling a form & passing a query condition

    I have a stored PL/SQL procedure where I am attempting to link to a master detail form from a button created in the procedure. The procedure is called from a form based on a table.
    I want to pass an id from the first form to the second when the user clicks the button and have that id bring up the master record in the calling form (query condition to be automatically executed).
    I am using the Portal technical FAQ 10.10 as a reference. However, I must be off in the syntax. Here's what I have:
    objectId - contains id from calling form
    OBJECT_ID - column name in called MD form
    elsif (button = 'Subject Matters') then
    PORTAL30.wwa_app_module.link(
    p_arg_names =>
    PORTAL30.wwv_standard_util.string_to_table2('_moduleid:_show_header:OBJECT_ID:_OBJECT_ID_cond'),
    p_arg_values =>
    PORTAL30.wwv_standard_util.string_to_table2('2215270925:YES:'&#0124; &#0124;to_char(objectID)&#0124; &#0124;':%3D'));
    The best I get is the id passed and the called form opened in INSERT mode.
    I have been playing with this for days!
    If anyone spots the error in my code and could point it out, I'd greatly appreciate it.
    Regards,
    Judy

    try this
    String b = (String)am.invokeMethod("getValue", params);
    Thanks,
    Prasanna

  • Uploading a text file from webi filter area as part of the query condition

    Post Author: balasura
    CA Forum: Publishing
    Requirement : Uploading a text file from webi filter area as part of the query condition Hi, I am in a serious requirement which I am not sure available in BO XI. Can some one help me plz. I am using BO XI R2, webi I am generating a ad-hoc report, when I want to give a filter condition for a report, the condition should be uploaded from a .txt file. In the current scenario we have LOV, but LOV could hold only a small number of value, my requirement is just like a lov but the list of values will be available in a text file ( which could number to 2000 or 2500 rows). I would like to upload this 2500 values in the form of a flat text file to make a query and genrate report. Is it possible in BO XI? For Eg:- Select * from Shipment Where u201CShipment id = u2018SC4539u2019 or Shipment id = u2018SC4598u2019u201D The u201Cwhereu201D condition (filter) which has shipment id will be available in a text file and it needs to be loaded in the form of .txt file so that it will be part of the filter condition. Content of a .txt file could be this shipment.txt =============== SC4539 sc2034 SC2343 SC3892 . . . . etc upto 2500 shipment Ids I will be very glad if some could provide me a solution. Thanks in advance. - Bala

    Hi Ron,
       This User does not have the access to Tcode ST01.
       The user executed Tcode SU53 immediately following the authorization failure to see the authorization objects. The 'Authorization obj' is blank and under the Description it has 'The last Authorization check was successful' with green tick mark.
      Any further suggestions, PLEASE.
    Thanks.

  • Query Condition of Geometry Theme Issue?

    I have created a very simple Geometry Theme within Map Builder and in the Query Condition of the Styling Rule I have placed the following query:
    SELECT person_id
             , bng_geometry
    FROM locations
    WHERE person_id = :pv_person_idThe attribute BNG_GEOMETRY corresponds to the column LOCATIONS.BNG_GEOMETRY which is of type SDO_GEOMETRY and is registered within the USER_SDO_GEOM_METADATA table.
    Whilst it seems illogical to put an entire query into the "Query Condition" box, the theme runs successfully and plots all my FOI's with the application.
    Since this box is clearly only expecting a WHERE clause (person_id = :pv_person_id in my case), I am curious how this theme is functioning correctly?
    If anyone knows how MapViewer handles any SQL supplied by the user I would be very grateful. Also, is my approach invalid or can you supply entire SQL statements rather than just the WHERE clause?
    Thanks for any help.
    Oh and we are running:
    OracleAS MapViewer Version: Ver1033p5_B080908
    Oracle Map Builder Version: 11.1.1.2.0 Build: Ver11_B091229
    Duncs

    Your approach is valid. You can put a complete query in the query condition box. Mapviewer is smart enough to tell whether it's a complete query or a where clause condition.

  • Query Conditions

    Hi
    Is there a way to show the 'real' Query conditions in a report instead of return value of LOV.
    Example of my LOV:
    'select distinct decode(np.vl,1,'400 kV ',
    2,'200 kV ',
    3,'110 kV ',
    6,' 20 kV ',
    'Muu kv ') &#0124; &#0124; np.name &#0124; &#0124;' '&#0124; &#0124; np.specifier, bsnet_id from elnet_dw.r_pylvaat2 r, elnet_dw.net_parts np
    where np.bsnet_id = r.trline_id'
    So I don't want to display bsnet_id to users.
    Now in a report's Query conditions, there are five ID-number. ID-numbers don't tell anyting to users.
    Thanks,
    Juha Leinonen

    Juha,
    I have a similar problem what you have. Can you share the solution with me.
    My problem
    My LOV has following select:
    Select ename, empno from emp;
    I want to Show only Ename in the LOV and display Ename on the form too. but I want to store only empno and nothing to do with ename.empno is a hidden column.
    Can anybody please help me. Can you please reply to [email protected] also.
    Thanks in advance.
    Murali

  • How to fire sql query conditionally?

    Hi all,
    I want a select query to fire conditionally.
    for example
    I want this:
    select case when &a>2 then
    select 2 from dual
    else when &a<2 then
    select 3 from dual
    end
    from dual;
    when variable a is greater than 2 then "select 2 from dual" query will fire
    and when variable a is less than 2 the "select 3 from dual " query will fire.
    how to do this?

    RMukherjee wrote:
    hi...my question is not about selecting 2 or 3
    its about firing query selectively
    that is
    select case when condition then
    select something from some table ---- this query will fire --query 1
    when condition
    select something from some table ---this query will fire--query 2
    end
    from dual;
    depending on the condition, query 1 or 2 will fire.No, that is one whole query, there is no query 1 or query 2.
    SQL is not a conditionally executing language. You consruct a whole query and you execute a whole query.
    Sure, you could get the query to call functions, or a pipelined function etc. which could use PL code to conditionally execute some query and return data appropriately, but that's introducing seemingly unnecessary context switching.
    So what is the actual problem that you are trying to solve? Rather than ask how to fix a clearly broken solution, it's better you explain what you are trying to achieve in the first place.

  • Custom query conditions in db adapter

    Hello,
    How to execute custom query in bpel db adapter?
    For example :
    1. select * from employee where status = 'N' and address is not null
    2. select * from empoyee where substatus = 'Y' and phone is null
    after where keyword - query part is dynamic, parameter combinations and count is unlimited ( depends on business logic ). It is not possible to implement each condition parameter as parameter in db adapter configuration.
    Db adatper query has to be something like  : select * from employee where #condition# , but #condtion# need to be interpretated as condition not string with quotes..
    best Regards,
    Uldis

    Say your complete query looks like this -
    select SUBJECT_NAME from RELATION
                where PID_GID_SSID IN (select PARTY_KEY from  xref WHERE row_id='123')
    1). In assign activity, write out the query part which comes after where clause and assign to variable query
    (select PARTY_KEY from  xref WHERE row_id='123') , replace the value of row_id from input value in assign.
    2. Now open DB adapter and pass the rest of query as input -
    select SUBJECT_NAME from RELATION
                where PID_GID_SSID IN #query

  • SAP Query condition

    Hi gurus,
    how can i specify a condition for my sap query ?
    For example i have a join between vbrk vbfa and vbak and i want only the billing type ZF02 to get selected from vbrk.
    Thank you

    hi,
    goto sq02 give ur infoset name click change then click on extras tab in tool bar there u hav a tab called code .write ur logic there.

  • EJB QL - Free Text in Query Condition

    Hi,
    Is there a way to write free sql text in the where condition of an entity bean (CMP), not using the ejb ql ?
    How can I control this part, and how can I also add compiler / optimizer directives in the statement when using entity beans (CMP).
    Thanks,

    Hello Ravi,
    The EJB 2.0 specification has made it mandatory to have <method-params> tag within the ejb-jar.xml. Due to the absence of this tag, you are getting the error...
    Please modify ejb-jar.xml and add an empty <method-params></method-params> tag for the findByAllAccounts and ejbSelectByTopAccounts methods. For example,
    <query>
    <description>This query retrieves all the accounts</description>
    <query-method>
    <method-name>findByAllAccounts</method-name>
    <method-params></method-params>
    </query-method>
    <ejb-ql>select distinct object(ua) from UserAccount ua</ejb-ql>
    </query>
    Notice the empty <method-params> tag added. Please do the same for the ejbSelectByTopAccounts method.
    Another thing to be changed is the jsp:usebean tag in index.jsp and DisplayAccounts.jsp. In the mentioned files, replace jsp:usebean with jsp:useBean. Please notice the capital 'B'. JDK 1.4 has made this mandatory.
    Futher more, as you would be aware, 10G onwards, the CMP beans accesses the database tables through the Toplink. Toplink is the default persistence manager now. To use the orion-ejb-jar.xml, please start the OC4J with the following command
    java -Ddefault.cmp.pm=native_cmp -jar oc4j.jar
    I would like to point out that the sample works fine in OC4J 904 developers preview without any of the above mentioned changes. The sample application has been certified in that version.
    Thanks for pointing this problem out. We are making the necessary changes in the sample and the updated jar will be uploaded on OTN shortly.
    Hope this helps,
    Rajat

  • BW query conditional formula

    Dear SAP Gurus ...
    I would like on a BW report create a formula as following
    If (characteristic version = B10)
    then (Formula 1)
    else (Formula 2)
    Translate in the BW language it could be something like that :
    ( 'Planning Version' == 'B10' )
    ( formula 1 )
    + ( 'Planning Version' <> 'B10' )
    ( formula 2 )
    My issue is that I don't arrive to create condition Version == 'B10' ... I have the impression that we could create condition only on keys figures value but not on characteristic value .
    The solution is it only in the user exit ? or could I resolve my issue in the query designer ????
    Thnaks a lot

    Hi,
    1)First of all define a variable(Zvar1) for 'Planning Version' characterstyic with replacement path as processing.
    2) Create a new formula in query as follows
    (zvar1 == 'B10' )* ( formula 1 )
    + (NOT (zvar1 == 'B10' )* (FORMULA2)
    1 ) FOR FURTHER INFORMATION ON CREATING A VARIABLE FOR CHARACTERSTIC WITH REPLACEMENT PATH
    refer service.sap.com/bi
    infoindex --> how to calculate with attributes of charactestics.
    2) for Conditional Calculations (IF-THEN-ELSE)
    refer
    http://help.sap.com/saphelp_bw32/helpdata/en/f1/0a5a2ee09411d2acb90000e829fbfe/frameset.htm
    with rgds,
    Anil Kumar Sharma .P

Maybe you are looking for