Returning the Prompt Value for a Variable

Hi Experts,
What I am currently trying to do is to return the values from a prompt so that I can use them in a variable. I have two Queries that are built off of two different Universes out of BEx. I do not have the same dimensions in both queries. I am merging the Universes based on the 'Employee ID' field, but I need to display Amount measures from both queries. Currently, this is functioning if I do not run any filters.
However, as soon as I put a query filter on a dimension that does not exist within both Universes, I have a problem where Query1 is returning a dataset of maybe 10 records, while Query2 still returns a dataset of 100 records. Obviously this presents a problem when aggregating the Amount measures.
I have tried a number of different ways to create a relationship between the measures and Employee, but I can't get things specific enough if I don't have the filtered dimension in the report. Suppose that I have Company Code filtered to 1200, I would like to show on the report only the employees from Company Code 1200. This is fine if I drag in the Employee dimension from Query1. However, once I drag in the Amount measure from Query2, the numbers are totalled for the entire 100 Employees, rather than the 10.
I figure that I should be able to specify my results by leveraging some sort of formula. I'm currently experimenting with:
=sum([Query2].[Amount] ForEach ([Company Code];[Query1].[Employee]) Where ([Company Code] = [Prompt1]))
Prompt1:
=UserResponse([Query1];"Prompt1")
The problem with this is that the UserResponse does not return an array of values that were selected (otherwise it would say #MULTIVALUE). Instead, it seems to concatenate the selections by the user into one field. Unfortunately I can't use that for anything. Is there a way to capture the actual value from the prompt in an array?
Alternatively, is there a better way to accomplish what I'm doing?
Thanks,
Brian Comeau

Hi Brian
I'm not familiar with Bex queries but have you tried adding using the query with the filter to be the driver for the values of the second query, so in effect you have 3 queriues:
Query 1 with filter
Query 2 with sub-query based on filtered query 1
Regards
Charles

Similar Messages

  • How can i implement the default value for this variable?

    In one of our Stored procs,we have a variable RECS_TO_DELETE, which determines the number of records to delete from various DELETEs that happen within this proc.
    The value for RECS_TO_DELETE variable should be obtained from a configuration table sys_config
    select
    rec_num into RECS_TO_DELETE
    from sys_config
    where
    sys_code=55;
    But if something goes wrong with sys_config table or the above SELECT INTO, our client wants to makes sure that RECS_TO_DELETE should have a default value of 1000.
    In the code, how will i implement having this default value of 1000 for RECS_TO_DELETE variable  in case the above SELECT INTO fails for some reason.

    Hi,
    You have to assign a value before the execution...
    DECLARE
        RECS_TO_DELETE NUMBER(9) := 1000;
    BEGIN
        SELECT rec_num
        INTO   RECS_TO_DELETE
        FROM   sys_config
        WHERE  sys_code = 55;
        DBMS_OUTPUT.put_line(RECS_TO_DELETE);
    EXCEPTION
        WHEN NO_DATA_FOUND THEN
           DBMS_OUTPUT.put_line(RECS_TO_DELETE);
    END;
    /Regards,

  • How to pass the prompt value to repository variable in obiee 11.1.1.7

    Hi All,
    I am given a tabular report to build in OBIEE 11.1.1.7 version using insurance data.
    I have to show different types of claim names and their corresponding count in the table. One of the calculations require me to use the total no of claims(i.e sum of all the claims).
    Example:
    Total No of claims: 600
    Total No of Auto Claim: 60
    I have to create a table on Auto Claim like:
                   claim types       count
                        X                    10
                        Y                    20
                        Z                    30
    I was calculating total no of claims by using dynamic repository variable as it was a constant value. Example: repository_variable1: select count(claim ID) from Insurance; In report I was just using value of (repository_variable1)
    Now client has asked us to give date prompt so the total no of claims (assumed as 600) will change with respect to period. I can calculate total no of claims with respect to different claim type (as shown in the table above) with respect to period filter in the report.
    The problem I am facing now is, I need the count of all the claims on a partucular period too. Repository variable is giving always calculating the count as 600. But the count should change with respect to period selected. How to get this value?
    Can I create a presentation variable in the prompt and pass this value as an argument for repository variable?
    Please help. I am in urgent need of the solution.
    Thank you.

    Hi Srini,
    I tried creating it as metric. But the problem is my pivot table is on Auto Claims.
    Let me try to make myself a bit more clear.
    Total No of claims in fact table: 600
    Total No of Auto Claims in fact table: 60
                    claim types(auto claims)       count        Calculation
                        X                                        10             10/600
                        Y                                        20             20/600
                        Z                                        30             30/600
    So I need to access total no of claims to calculate. I cant use a metric as the count will take group by with respect to auto claim type and give value only for X claim.

  • FM returns wrong total value for Limit type PO's

    Hi all,
    I am working on SRM 5.0 (SP13) ECS.
    I have implemented the BADI "BBP_WFL_APPROVAL_BADI" for determining the Approvers for PO whenevr a PO is changed.If the diference between the Old PO value and new PO value is > 1000 and the approval text field(custom text under "Documents" link) is set to "YES",then the WF approval is required and the approvers are determined.
    The above logic works fine for the Standard type PO's where the difference between the old value and new value is determined using FM "BBP_PD_PO_GETDETAIL"  by passing the GUID (for the change version and the active vesion) obtained at runtime in the BADI.
    However for the limit type PO's,whenevr I change the total value for the Limit item,I see that the FM "BBP_PD_PO_GETDETAIL" doesnt return the changed value but  always returns blank!
    Bcause I need to check bth the values i.e. Custom text set to "YES" as well as Total value diff ,I cant use the start conditions in tcode SWB_COND.ALso I need to fetch the approvers based on the price diff so I need this value at runtime in the BADI using the FM "BBP_PD_PO_GETDETAIL".
    Please advise why the FM is not returning the changed values for the Limit type PO and is there any other way(other table/FM) to get the changed value at runtime for the LIMIT type PO.
    Thanks for your time.
    Edited by: Rads1234 on Nov 18, 2010 4:39 AM

    Thanks for the rpely.
    Yes.I am using the GUID available at runtime in the  BADI "BBP_WFL_APPROV_BADI" which is the current change version GUID.I tried using that GUID to get the data from both FM as well as CDHDR and CDPOS tables.
    I think this is something related to LImit type PO because for Standard type PO's the FM returns the corretc changed value (as in the screen) for the change version GUID.I fail to understand why the changed values are shwon on the screen but are not stored anywhere in the system before actually ordering the PO!

  • Function to return the Entry Value based on Assignment, Element and Date

    Hi Guys,
    Is there a function that returns the Entry Value for the Assignment Element, based on the Assignment Number, Element Name, Entry Segment and the End of Period date?
    Example:
    ==============
    Input Parameters:
    Employee: Iana
    Assignment Num: 123
    Element: D480
    Element Entry: Fund Name
    Output Parameter:
    Element Entry Value: MLC Super Fund
    Thanks,
    Iana

    For element entry values you can use:
    select petf.element_name, nvl(peevf.screen_entry_value,0) screen_entry_value
    from
    pay_element_entries_f peef, pay_element_types_f petf,
    pay_element_entry_values_f peevf, pay_input_values_f pivf,
    per_all_assignments_f paaf
    where petf.element_type_id = peef.element_type_id
    and :p_date_earned between pivf.effective_start_date and pivf.effective_end_date
    and :p_date_earned between petf.effective_start_date and petf.effective_end_date
    and peevf.input_value_id = pivf.input_value_id
    and paaf.assignment_id = peef.assignment_id
    and petf.business_group_id = :p_business_group_id
    and peevf.element_entry_id = peef.element_entry_id
    and :p_date_earned between peef.effective_start_date and peef.effective_end_date
    and :p_date_earned between peevf.effective_start_date and peevf.effective_end_date
    and :p_date_earned between paaf.effective_start_date and paaf.effective_end_date
    and pivf.name = :p_input_value_name
    and petf.element_name = :p_element_name
    and peef.entry_type = 'E'
    and peevf.effective_start_date = peef.effective_start_date
    and peevf.effective_end_date = peef.effective_end_date
    --and peef.assignment_id = :p_assignment_id
    and paaf.assignment_number = :p_assignment_number;
    For payroll results you can use:
    select sum(prrv.result_value)
    from pay_run_results prr, pay_run_result_values prrv,
    pay_assignment_actions paa, pay_payroll_actions ppa,
    pay_element_types_f petf, pay_input_values_f pivf,
    per_all_assignments_f paaf, per_all_people_f papf
    where
    petf.element_type_id = pivf.element_type_id
    and :p_pay_date between petf.effective_start_date and petf.effective_end_date
    and :p_pay_date between pivf.effective_start_date and pivf.effective_end_date
    and paa.assignment_action_id = prr.assignment_action_id
    and petf.element_type_id = prr.element_type_id
    and ppa.payroll_action_id = paa.payroll_action_id
    and prrv.input_value_id = pivf.input_value_id
    and prr.run_result_id = prrv.run_result_id
    and petf.element_name = :p_element_name
    and pivf.name = :p_input_value_name
    and ppa.date_earned = :p_pay_date
    and papf.person_id = paaf.person_id
    and nvl(prr.start_date,ppa.effective_date) between paaf.effective_start_date and paaf.effective_end_date
    and nvl(prr.start_date,ppa.effective_date) between papf.effective_start_date and papf.effective_end_date
    and paaf.assignment_id = paa.assignment_id
    and papf.employee_number = :p_employee_number;

  • Multiple values for one variable?

    I've created my first set of variables (using Form Properties>Variables), tweeked some XML sourcecode  and they're working .
    What I'm now trying to figure out is how to have one variable that has 2 values that pop up in 2 different text fields.
    Simple form at this point:
    Item, Model and Service Tag.
    The user selects the item from the drop down list and the Service Tag field is autopopulated from the variables I set.
    How do I get the Model to appear based on the Item selection?
    I tried putting the two values for one variable together but both values appear in the same field.
    Variable info that works: Scan (variable) = MC3090BT (value)
    I also need this particular variable to = Handheld scanner (try to ignore the redundancy).
    I attempted to make MC3090BT as it's own variable with Handheld scanner as it's value, and add to the code below but it didn't work.
    Here's some of the code if it helps:
    <event activity="change" name="event__change">
                   <script contentType="application/x-javascript">if(xfa.event.newText == "Handheld scanner"){
        servicetag.rawValue = scan.value;
    }else if(xfa.event.newText == "Latitude X1"){
        servicetag.rawValue = X1.value;

    Hi, I am trying to do the same thing..passing multiple values to receiving query variable through RRI.  Right now if I assign a query variable of type multiple single values it does not take any value.  It works only if I assign variable of type Single Value.
    In my assignment details the sender query has Generic for type and * for selection type. 
    If any one knows how to pass multiple values to receiving RRI query,  please give the details.
    Thanks

  • How to use the prompt value in the report column

    Hi
    I have a report prompt column which is 'Adj Type' which holds values 10,20,30 and when user selects Adj Type = 10 then this value should be passed to report column.
    For Eg. Column 1 value is 10 and this should multiple with prompt value and the output should be 10* 10.
    Any thoughts how to capture the prompt values in report column for calculation.

    hi hsekar,
    1) Declare a presentation variable in prompt under the Set Variable section -->Presentation Variable -->P_var
    2) In Fx Table_name.Your_column * @{P_Var}
    @{P_var}{20} ( 20 is default value it will override when a user selects value in prompt
    Thanks,
    Saichand.v

  • Setting a Prompt value for KeyDate in WebI on SAP OLAP universe

    I have a webi report which has as its dataprovider a query against an SAP olap universe against a BEx query which has the KeyDate parameter exposed.
    Iu2019d like to get at this prompt from the SDK.
    In infoview if I run the report it pulls up the keydate prompt (a special dialogue which seems to be implemented as part of the connection definition) - this prior to pulling up the full prompts dialogue and showing all universe based @prompt filters.  In WebI I can see the prompt value entered using =UserResponse("dp.kd.value") .   So it does seem to see the keydate as a prompt of some sorts.
    I've got a little jsp that allows me to set prompts very nicely (and packeaged as a jar in the CMC that schedules ok as well) but when I put it against a report with a key date u201Cpromptu201D it just wonu2019t see it.  When I call a getCount() as below it returns 0.
    oDocumentInstance.getDataProviders().generateQueries();     
    Prompts oPrompts = oDocumentInstance.getPrompts();
    out.print(oPrompts.getCount());
    This is all in an attempt to get around the scheduler limitations of key date which would give me two queries, two universes and two reportsu2026 one report for scheduling (using a customer exit to set key date) and a second for user refresh  (with a prompted key date)  which would all be rather messey to say the least!
    So any cunning ideas on how I can get hold of this key date thingymebob in the SDK?
    (ps. "Fixed in V4" would be nice to hear as an aside to thisu2026 In playing with the ramp up Iu2019ve got the same issues however so Iu2019m not to hopefull )
    Thanks!
    Jeremy.

    Hi,
    First I think you have to create a support ticket because normally the object in the universe must be generated with data data type nad it is not the case.
    We are awere of some limitations with data types.
    Secondly, if you want to have users entering date you have to specify date in the prompt data type like this:
    <OPTIONAL><FILTER KEY="[PERIOD SD].[DB Full Date].[DB Full Date]"><CONDITION OPERATORCONDITION="Equal"><CONSTANT CAPTION="@Prompt('Enter Date ','D',,mono,free)"></CONSTANT></CONDITION></FILTER></OPTIONAL>
    Regards
    Didier

  • Recursion:returning the largest value in a linked list

    import java.io.*;
    import java.util.*;
    class Node{
         int num;
         Node next;
         Node(int n){
              num = n;
              next = null;
    class RecursivePrint{
         public static void main(String[] args){
              Node np, last;
              Node top = null;
              last = null;
              for(int i = 1; i <11; i++){
                   np = new Node(i);
                   if(top==null)top = np;
                        else
                   last.next = np;
                   last = np;
              int x =Largest(top);
             System.out.println("large is "+ x);
         }//end main
         public static int Largest(Node top){
              int large = 0;
              if(top==null){
                   return 0;
                   while(top!=null){
               if(top.num > large){
                   large = top.num;
                   //top = top.next;
              Largest(top.next);     
         }//while
         return large;
    }//end class
    I am trying to return the largest value in a linked list (10) in this case.  when I do it withour recurrsion it works ok, but when I try it with recurrsion it dies.  The logic seems ok to me, cannot figure why it dies.

    chetah wrote:
    public static int Largest(Node top){
              int large = 0;
              if(top==null){
                   return 0;
              if(top.num > large){
                   large = top.num;
                   //top = top.next;
                   Largest(top.next);
         return large;
    Initially I had the above, it return only 1 that was the reason for puting the loop.You don't seem to understand recursion or variable scope.
    int large = 0;large is a different variable inside each instance of the method.
    So when you get back up to the value 1 from the recursive calls its just comparing 1 to 0
    Here's a solution...
         public static int Largest(Node top){
              if(top.next != null){
                   if(Largest(top.next) > top.num)
                        return Largest(top.next);}
              return top.num;
         }

  • Return Into.  Can I return the old value in an update statement?

    Hello - I have an update statement and I need the value of a field, prior to the update. Is it possible to use the Return Into to do this? Or do I have to have a separate select statement prior to the update statement in order to store that value in a variable?
    Thanks!

    RETURNING INTO is valid for an UPDATE, but it returns the new value, not the old value.
    SCOTT @ nx102 Local> select * from a;
          COL1
             4
    Elapsed: 00:00:00.00
    SCOTT @ nx102 Local> ed
    Wrote file afiedt.buf
      1  declare
      2    l_old_col1 number;
      3  begin
      4    update a
      5       set col1=col1+1
      6     returning col1 into l_old_col1;
      7    dbms_output.put_line( l_old_col1 );
      8* end;
    SCOTT @ nx102 Local> /
    5
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00If you are trying to track historical changes, have you looked at Workspace Manager? That can be far easier than writing your own change tracking code...
    Justin

  • What is the initial value for a numeric field ??

    Can someone tell me what the INITIAL VALUE FOR A NUMERIC FIELD is ?? Thank you
    Rod.

    Using the following...
       class MyClass
         int myvar1;  // Default initial value
         int myvar2 = 3;  // Default initial value and default value
         MyOtherClass myclass1; // Default initial value
         void doit()
           int mylocal1;  // No value
           MyOtherClass myclass2; // No value
    All number member variables, like myvar1 start off with andefault initial value which is zero. For booleans this is false. Object reference variables, like myclass1, have a null value.
    All local numeric variables are considered undefined. So mylocal1 and myclass2 are undefined. Before you can use them you must explicitly provide a value.
    Finally note that myvar2 will have two values during class instantiation. Initially it will have a value of zero. Sometime later it will have the value of 3. (When that happens is very definitely outside the scope of what this forum covers. If you want to know then ask in the advanced forum.)

  • How to use one variable as a default value for another variable?

    Hi Experts,
    Is it possible to use one variable as a default value for another variable?
    For example:
    Variable 1 = current calendar year month
    Variable 2 = mandatory input ready variable for calendar year month
    I want to use variable 1 as default value for variable 2, but also have the ability to change the month if required.
    Thanks!
    Kathryn

    u can use replacement path variable
    in that case u can replace the values of 1 variable with the another variable...
    but  u cannot do this setting
    u cannot make variable 2 as mandatory
    u cannot enter value for variable 2
    because by default it will take the value of variable 1
    u have to make follow settings
    variable 2
    name , technical name
    processing by = replacement path
    infoobject = ocalmonth
    next tab
    replaced by another variable
    variable name
    offset start , offset lenght
    save and hit okey

  • How to use the prompted value in the filter expression

    Hi
    Is it possible to use the prompted value in the filter expression?
    My requirement is that user will be prompted for a date field and I need to filter the records such that the records are displayed for the last 5 weeks from the date entered by the user.
    If somehow I know how to use the prompted value in the filter expression then this requirement is easy to be done. If this is possible, please guide me?
    If there are other ways to acheive the desired results then please suggest.
    Thanks
    -Jaz

    Edit: example added
    SQL> create table tb_test
      2  ( id number(5)
      3  , tot number(5)
      4  , mon_tot number generated always as (tot*15) virtual
      5  );
    Table created.
    SQL> insert into tb_test (id, tot) values (1, 5);
    1 row created.
    SQL> select * from tb_test;
            ID        TOT    MON_TOT
             1          5         75
    1 row selected.
    SQL> update tb_test
      2  set    tot = 15
      3  where  id = 1;
    1 row updated.
    SQL> select * from tb_test;
            ID        TOT    MON_TOT
             1         15        225
    1 row selected.

  • How to get the current month for a variable based on info object 0FISCPER3

    Hie Gurus
    I am working on the financial reports i am failing to derive the Current month from the variable based on infobject 0FISCPER3 PERIOD .
    I would also like to get the same month from the prevoius year. Any ideas?

    If I understood correctly, you need in your repot
    Current Month Plan This year || YTD Plan This Year || Current Month Plan Last Year || YTD Plan Last Year
    Your variable 0I_FISCPER3 must be on the object 0FISCPER3 which is nothing but just the Fiscal Period. This variable is a user entry mandatory Interval variable.
    if you are entering a range in the input screen for this variable, you will get cumulative values. If you just need to get the value for a month in first column your report, you will have to create another variable of type Customer Exit which will read the "To value" entered for the variable 0I_FISCPER3 and columns for Current Month should be restricted on this variable.
    if you are entering a single value in the selection screen of this variable, current month column should be restricted on this variable with "Equal To" operation and YTD colmns should be restricted to "Less Than Equal to" operator with this variable.
    0FISCPER3 just have posting period and not year, so you will have to use varialbes for 0FISCYEAR separately.
    Please let us know if it helps or if you are using some other variable based on 0FISCPER3 or 0FISCPER.
    Regards,
    Gaurav

  • Set a value for a variable of type exit

    Hello,
    I am filling some variables with multiple values in user exit.
    Now, i would like to place some of these characteritics in Header area. It's of course impossible because there is multiple values but ...
    I will put dropdown box in the web application for these chars. The problem is that by default, any value is assigned to the dropdwom ( any variable value is set).
    Do you know how i can set a value for theses variable after filling all values by the user exit. SO that only one value is selected for the header and all others values available in the dropdown ?
    Regards,
    Jarod

    Hi,
    Off late, this seems to be a usual requirement.
    Just create a Z program to call the FM API_SEMBPS_VARIABLE_SET and then call the FM API_SEMBPS_POST.
    you should be preparing the content/set value to pass to the FMs. check the whereused list to see how this FMs can be used/called.
    finally, run this program for your variable, after the loading/filling the exit variable. Please note that to set 'exit' variables, the sourcing variable's content need to be read/set first before setting the exit varible.
    HTH,
    Regards,
    Nataraj.

Maybe you are looking for