Using a Variable Prompt - In an analysis using Top N filter (URGENT)

Hi Experts
I have created a variable prompt that is setup in the following way :
Prompt Name : Number_of_rows
User Input : Radio Buttons
Radio Button Values : *1/ 2* (Custom Values)
Variable Data Type : Number
Default Selection : *1* (Specific Custom Value)
I have an analysis/ report that has the following columns Customer ID | Number of Orders
I have applied a top N filter to this report using the varibale prompt :
*Number of Orders  is in top  @{Number_of_rows}* (which is equivelent to Number of Orders is in top 1 or 2)
However when I view the report im getting the following error
View Display Error
Error getting drill information: SELECT "Customer"."Customer ID" saw_0, "Sales Facts"."Number of Orders" saw_1 FROM "Sales" WHERE TOPN("Sales Facts"."Number of Orders",Number_of_rows) <= Number_of_rows
Error Details
Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
Location: saw.views.evc.activate, saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool, saw.threadpool, saw.threads
Odbc driver returned an error (SQLExecDirectW).
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 27005] Unresolved column: "Number_of_rows". (HY000)
SQL Issued: {call NQSGetLevelDrillability('SELECT "Customer"."Customer ID" saw_0, "Sales Facts"."Number of Orders" saw_1 FROM "Sales" WHERE TOPN("Sales Facts"."Number of Orders",Number_of_rows) <= Number_of_rows')}
Please can you help
Kind Regards
Hiten
Edited by: #:::HITEN:::# on 29-Nov-2012 04:24

I'll put this as below
My prompt will have the TopN which can be formated by TopN Orders and setting this as Presentation variable as N
SELECT TOPN("#Sales",10) FROM "SA" order by Product
In the report I'm using same column (Orders) with expression as below.
TOPN("#Sales", cast(@{N}{2} as int))
If this is not helpful for you then try to pass some default value for the Presentation variable

Similar Messages

  • How can we use Session Variable in Answers or Analysis?

    How can we use Session Variable in Answers or Analysis?

    Again, duplicate cross-posting!
    See rukbat 's post here: Re: BI Apps 7.9.6.3(Agent Issue)

  • Using a variable in "arrayTerminatedBy" clause while using a file adapter

    Hi All,
    How can read a file of sample shown below using a file adapter.
    ABC|20081010|
    2008|xxxxxxx|
    2007|yyyy|
    2009|zzzzzzz|
    3|20081010|
    first line is the header
    last line is footer
    middle portion is the body
    '3' in the footer is the total no of record count in the body
    I am able to read the header and body.
    The problem i am facing is; when it is reading the footer it is treating the footer as a record in the body and is throwing an error stating - expected the format as "yyyy"
    I have to use "arrayTerminatedBy" to indicate the end of the body. But that terminating field is a varying field. How can i use this variable field in the "arrayTerminatedBy" clause.
    Can any one help in reading this file
    Thanks in advance
    Edited by: user10308218 on 11-Oct-2008 02:23
    Edited by: user10308218 on 11-Oct-2008 02:24

    See if this helps, I haven't tested it but it will give you a hint in how to achieve it. As you can see I use the startsWith command. I'm not sure how to handle your detail as it seems to start with different elements every time.
    cheers
    James
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    targetNamespace="http://TargetNamespace.com/Write_File"
    xmlns:tns="http://TargetNamespace.com/Read_File"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified" nxsd:encoding="ASCII" nxsd:stream="chars" nxsd:version="NXSD">
    <xsd:element name="FileRecord">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Header" nxsd:startsWith="ABC|" maxOccurs="1">
    <xsd:complexType>
    <xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
    <xsd:element name="FileDate" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;"/>
    <xsd:element name="Record" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
    <xsd:element name="DetailData1" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;"/>
    <xsd:element name="DetailData2" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;"/>
    <xsd:element name="Footer" nxsd:startsWith="3|" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
    <xsd:element name="FooterData" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

  • Performance when using bind variables

    I'm trying to show myself that bind variables improve performance (I believe it, I just want to see it).
    I've created a simple table of 100,000 records each row a single column of type integer. I populate it with a number between 1 and 100,000
    Now, with a JAVA program I delete 2,000 of the records by performing a loop and using the loop counter in my where predicate.
    My first JAVA program runs without using bind variables as follows:
    loop
    stmt.executeUpdate("delete from nobind_test where id = " + i);
    end loop
    My second JAVA program uses bind variables as follows:
    pstmt = conn.prepareStatement("delete from bind_test where id = ?");
    loop
    pstmt.setString(1, String.valueof(i));
    rs = pstmt.executeQuery();
    end loop;
    Monitoring of v$SQL shows that program one doesn't use bind variables, and program two does use bind variables.
    The trouble is that the program that does not use bind variables runs faster than the bind variable program.
    Can anyone tell me why this would be? Is my test too simple?
    Thanks.

    [email protected] wrote:
    I'm trying to show myself that bind variables improve performance (I believe it, I just want to see it).
    I've created a simple table of 100,000 records each row a single column of type integer. I populate it with a number between 1 and 100,000
    Now, with a JAVA program I delete 2,000 of the records by performing a loop and using the loop counter in my where predicate.
    Monitoring of v$SQL shows that program one doesn't use bind variables, and program two does use bind variables.
    The trouble is that the program that does not use bind variables runs faster than the bind variable program.
    Can anyone tell me why this would be? Is my test too simple?
    The point is that you have to find out where your test is spending most of the time.
    If you've just populated a table with 100,000 records and then start to delete randomly 2,000 of them, the database has to perform a full table scan for each of the records to be deleted.
    So probably most of the time is spent scanning the table over and over again, although most of blocks might already be in your database buffer cache.
    The difference between the hard parse and the soft parse of such a simple statement might be negligible compared to effort it takes to fulfill each delete execution.
    You might want to change the setup of your test: Add a primary key constraint to your test table and delete the rows using this primary key as predicate. Then the time it takes to locate the row to delete should be negligible compared to the hard parse / soft parse difference.
    You probably need to increase your iteration count because deleting 2,000 records this way probably takes too short and introduces measuring issues. Try to delete more rows, then you should be able to spot a significant and constant difference between the two approaches.
    In order to prevent any performance issues from a potentially degenerated index due to numerous DML activities, you could also just change your test case to query for a particular column of the row corresponding to your predicate rather than deleting it.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • How to use sql variables in jdbc send adapter??

    Hi,
    i wanna use a variable in the sql statement in the jdbc send adapter.
    i know i can key sql statement in the "Query SQL Statement" in the jdbc send adapter.but i dont know how to use variables in the sql statement.
    i mean, for example, the sql statement is "SELECT * FROM t_student WHERE READFLAG = 0", but now i wanna instead of "0"(the value of the READFLAG) using a variable.
    and if i can use a variable to replace the "0"(the value of the READFLAG above sql statement), then how can i send a value to the variable??
    request help in the regard.
    thx in advance.
    Brian

    Hi,
    Use the place holders to pass the data at runtime. Check the below structure for more details.
    Hope this helps.
    Thanks and Regards,
    Kalpesh
    <root>
      <stmt>
        <Student action="SQL_QUERY">
          <access> SELECT * FROM t_student WHERE READFLAG = '$FLAG$ </access>
          <key>
            <FLAG>0</FLAG>
          </key>
        </Student>
      </stmt>
    </root>

  • Using JSTL variables in JSP or Javascript. Possible ?

    Hi All,
    Is it possible to share or use the variables which are declared are used by JSTL in JSP expression or scriplet code and in Java Script.
    Example:
    This Works:
    <fmt:set var="test" value="JSTL" />
    <fmt:out value="${test}" />
    But, this gives error:
    <% out.println(test) %>
    And passing the value of variable 'test' to Java Script code also gives error.
    How to use JSTL variables in JSP and in Javascript ?
    Yours,
    Sankar.B

    By default, JSTL variables are kept in servlet
    attributes. Default is to store it in the page
    context. You can make it request/session/application
    scope as required by an attribute of the set tag.Hi there,
    Can anyone advise how to access JSP variables in JSTL?
    Can it be done as the same method through request/session/application scope?
    Thnks...

  • How to use "global variable" in Xcelsius ?

    HI experts,
    In our projects, many Xcelsius web pages on BusinessObjects enterprise may have the same year/month variable related to present, for example, 2009/02.  We want use this varible when the user open any Xcelsius web page. Can this be implemented by session value?
    Thanks!

    Hello,
    Could you explain what did you mean ?
    Did you manage to use a variable when running Xcelsius by using XML data ?
    Thanks,
    Daphna

  • Using global variable read status

    Hi Experts,
    I need to change the Note based o the Service Ticket status. I declared global variable as a string in ZL_ICCMP_BT_BTSHEADER_IMPL (Component: ICCMP_BTSHEAD; View: BTSHeader)
    And I am passing the Status to this global variable using the GET and SET methods of the STRUCT.ACT_STATUS attribute in BTSTATUSH node in same component and view.
    I referred this global variable in DO_PREPARE_OUTPUT of the component ICCMP_BTTEXT/TextView to set the Note as shown below.
    if ZL_ICCMP_BT_BTSHEADER_IMPL=>GC_STATUS = 'E0001'.
    I would like to know whether this approach is the best way to read status or any other optimistic  approach is there to follow for my this scenario. Please advise me.
    Thanks
    Chand

    Hi Basha,
    If you are using static variables, i wouldn't recommend using this approach.. there are better approach to get/set values in web client session which avoids setting/clearing static variables etc..
    you can follow below approach..
    1. To Get/set the variable in ic session to avoid the static variable.. for eg global cuco is available which you can use for this purpose.
    lr_bdc type ref to if_crm_ui_data_context.
    lr_bdc = cl_crm_ui_data_context_srv=>get_instance( me ).
    check lr_bdc is bound.
    Using SET_DATA_ATTRIBUTE set the attribute value and using GET_DATA_ATTRIBUTE get the attribute valueu2026get_attribute, set_attribute
    read current BuAg if exist
    lr_buag ?= lr_bdc->GET_DATA_ATTRIBUTE( 'CURRENTBUAG' ).
    Here "CURRENTBUAG" is the attribute name, you can give any attribute name while setting and get the same attribute value via get_data_attribute.
    Cheers,
    Sumit Mittal

  • What is the basic use of variables?

    Hi,
    what is the basic use of variables?
    why they are used?
    I read it in sap.help site but i m not getting why they are used?
    Can u plz explain it with example..
    Thank you,
    Swati

    Hi,
       A variable is used to store value depending on the definition type like,
    Single Value,
    Interval,
    Selection Option.
    When we execute a Query, the variable defined for the particular field will be displayed.
    Depending on the input conditions for the variable, the data corresponding to that field will be displayed.
    Types :
    1) User Entry
    2) SAP Exit
    3) Customer Exit
    Search for these variable types in SDN.
    You will get more than enough explanations.:-)
    Regards,
    Balaji V

  • Correct Way to use Bind variables when using an MS SQL server backend

    Hey,
    I'm having some trouble figuring out how to use bind variables in a view when using an MS SQL server backend. For some reason when I'm using an ApplicationModule that has a MS SQL Server JDBC library loaded and I attempt to click OK when editing the following query:
    SELECT kit_status, component_id
    FROM numbered_inv
    WHERE trialname = :1
    I get an error stating that "SQL Query Error Message Incorrect Syntax near ':'". Is JDeveloper compatible with SQL server for bind variables because this query runs just fine if I replace the :1 with a say "Testing testing".
    Thanks in advance
    Edited by: NullCheck on Dec 15, 2010 2:06 PM

    Gotcha. I had tried %1% %0% ?0 and ?1 and various other permutations none of which worked. Got it working by setting the query to:
    SELECT kit_status, component_id
    FROM numbered_inv
    WHERE trialname = ?
    ORDER BY kit_status
    And then adding a bind variable with "Bind position" set to 0.
    Thanks again Shay!

  • Using variables as filters in analyses launched by Guided Navigation links

    I'm trying to build a navigation link that will launch an analysis and have the filters in that analysis respect the values of either Presentation Variables or Session Variables. I'm having success with an ordinary column. I'm not having success with a number that I need to type into a prompt.
    Here's what I've done so far:
    1. Created a dashboard prompt based on the Month column. When a Month is selected, that selection populates the Request (Session) variable called Selected_Mo
    2. Created an analysis with:
    - a filter on the Month column: = Selected_Mo
    - the Month column
    - a column showing the value of Selected_Mo
    3. Placed both of those onto a dashboard page. When I select a value of Month, the month in the analyis changes, and the column showing the value of Selected_Mo changes. So far, all is good.
    4. Placed an Action Link on the dashboard. That action link launches the same analysis that I can see on the dashboard.
    5. Clicked the action link. The value of Month that I selected on the dashboard is shown in the analysis.
    Now, I'm trying to do the exact same thing with a numeric entry field in a dashboard prompt, and I'm running into a stumbling block. I want to type a number into a field in a dashboard prompt, and populate a session variable called Change_Pctg. Selecting "Variable Prompt" in the dashboard prompt only lets me populate a Presentation Variable. But no matter. I've created a "dummy" field like we used to do in 10g, just creating a Column Prompt against a column formula of 1.
    When I put the analysis onto the dashboard, it's correct. I can enter a number into the dashboard prompt field, click Apply, and that value is shown in the analysis on the screen. I'm filtering against that value as well, and the number of rows is right. So I know that I'm setting the value of that Change_Pctg session variable.
    But when I click the action link, only Selected_Mo is respected by the target analysis. The Change_Pctg session variable is ignored.
    Any thoughts?

    I'd like to abort this post. I've been able to replicate the error using a much simpler method. Refer to the post entitled 'Passing Presentation Variables to Guided Navigation'.

  • Using presentation variable in a dashboard prompt

    Hi All,
    Can we use a presentation variable set in 1 dashboard prompt in another dashboard prompt to filter the values shown in the prompt based on the value selected in the first prompt?
    I am using SQL results in the second prompt.So, Iam not able to constrain the results. Any ideas?
    Thanks.

    Steps:
    1. 1st Dashboard prompt set Presentation Variable name say pdashboardprompt1
    2. In 2nd Dashboard prompt set Presentation Variable name say pdashboardprompt2
    In SHOW SQL results for 2nd Dashboard prompt. Select constraint
    SELECT Table1.Column1 FROM "SA" WHERE Table1.Column2 = '@{pdashboardprompt1}'

  • Problems using substitution variable in Web Analysis

    Dear all,
    I have a Web Analysis report that I need to show a raking table with the current month.
    For that I create a variable in Essbase that is updated with that date (E.g.: varCurrentMonth).
    After that I use it as my substitution variable to filter my date dimension in a report data source (E.g.: Scr5, row: product, column: date dimension & measure):
    2008 (current month)
    Product $ qty.
    AAA 100 10
    BBB 90 7
    CCC 80 5
    The problem is that in our cube we need to use an alias in every dimension not to have duplicate members (E.g.: DT.Date, MS.Measure, PD.Product, etc). And when we use it we need to set up the variable in Essbase using that alias (E.g.: DT.Feb/05/08). And if we use that variable as a substitution variable in the report data source the label displayed is the DT.2008 and not 2008 as expected.
    Does anybody have an idea how to solve that?
    Many thanks,
    Thiago Gabriel

    You usually get this error message if you are trying to assign a value from a sub var to a member that does not exist.
    e.g. trying to put FY08 which is a year member against a period dimension
    or trying to use a sub var of FY09 which does not yet exist in the essbase, so say you added a new year in planning FY09 and used the sub var in the form but have not refreshed the database then it would fail because the year would not have been pushed down to essbase yet.
    or the value of the subvar does not match a member name exactly
    or using a sub var name that does not exist in essbase, e.g. using &nextYear but the sub var has not been created in essbase.
    You can definitely use subsitution variables in columns in the version you are using and prior version.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • BEx Variable Key/Name swap when used as Prompt in WebI report

    Hi,
    We are using Bex Variables in a Query used as a base for a BOBJ Universe and Query.
    When refreshing the report the Prompt box displays the Name and Key of the infoobject (Dimension), but when selecting one of those values - moving it to the right, it brings across the Name not Key.
    Our requirement is that the Key is selected value rather than the name - is this possible? And if so how?
    Netweaver 2004S & Business Objects XI 3.0.
    Regards,
    Laurence

    Ingo,
    Thanks, I understand this in the background the Key is used, but is there any way to "swap" the Key and Name in the Prompt box, specifically my users want the Key to display in the right hand side of the Prompt bax when selecting, (or in the dropdown box, in the Prompt tab in WebI)
    Best Regards,
    Laurence

  • Dashboard filtering using Variable prompts

    Hi,
    I am having a dashboard with 2 pages(Monthly and Quarterly). My requirement is:
    Create a variable prompts(Monthly,Weekly) in separate page.
    When i select radio button 'Monthly' only the sections related to monthly should be displayed and "Quarterly" sections to be hidden also vice versa.
    I need both of them in a single page and allow me to display based on selection.
    I am new to OBIEE 11g and this is my first enhancement. Plz help me.
    Thanks in Advance
    Regards,
    Avinash

    Hi,
    you can create a section filter which will display the value based on selection.
    for section filter, create two seperate reports which will have only one column and give the filter as 'Month', 'Week' in each report.
    when you are creating the section filter then use these two reports as condition ie. rowcount>0. so whenever month and week gets selected it will display the result.

Maybe you are looking for