How to feed a query using a variable defined as Replacement Path-Query

Scenario description : BI NetW 2004S - InfoCube with the following characteristics Customer, OrderDate, OrderYear and the following KeyFigure Number of Pieces.
Objective: I need a query "QB" that shows how many pieces a set of customers has ordered in the year 2008. The set of customers is defined as all customers that in the previous years (the user can select one or more years) have ordered more than 500 pieces within the same year.
Implementation: In general terms the idea is to build a query "QB" with the characteristic "Customer"  that is restricted (filtered) using a variable that is fed by another query "QA" (Replacement Path-Query).
In order to have the selection of customers that for each of previous years (2007, 2006, 2005,...) have ordered more than 500 pieces, in the query "QA":
- I put OrderYear as filter and defined a variable in order to ask the user which year/s he wants to analyse to define the selection
- I put Customer and OrderYear in row
- I put the KeyFigure Number of Pieces in column
- I've defined the following condition: Number of Pieces > 500 with the option Caracteristic Assignment = All Characteristics in the Drilldown Indipendently
Now if I run the query "QA" it works correctly showing me all customers that in the selected years have ordered more than 500 pieces within of the same year.
If I run the query "QB" it shows a correct result only if I enter only one year (for example 2006) in the OrderYear field (coming from the query "QA"); if I enter more than one year (for example 2006 and 2007) the selection of customers showed is not the same defined by the first query "QB": I was expecting to see all customers defined from the first query less all customers that have no ordered any piece in 2008.
Questions
1) Why is query "QA" working on a different selection of customers when the user selects more than one year?
2) Cosidering the scenario and the objective described above do you have any other idea?
Thanks
Ciao
Roberto

Hi Christophe,
     it's ok for me if I consider the customer only once in the final selection of customers that feeds the final query, this is my objective.
However as test I've created 2 "input" queries, one related to 2006 and one related to 2007, and then in my destination query I've tried to restrict the customer using 2 variables of type replacement path-query (one attached to the 2006 query and one attached to the 2007 query). Unfortunately when I try to check and save the destination query, Query Designer tells me it is not possible to restrict the characteristic in this way.
Could you please describe me steps you run in to order to restrict a characteristic using more than one variable of type replacement path-query?
Thank you in advance for your answer.
Ciao,
Roberto

Similar Messages

  • How to get the value of a variable defined in javascript in JSP

    how to get the value of a variable defined in javascript in/through JSP????

    In Javascript you can use the DOM to access the input element and set it's value before submitting the form. Then it's value will just be passed.

  • Use of variables in "FOR XML PATH"

    Other than using dynamic sql (which we don't want to use) is there a way to use a variable in For XML Path, e.g.
    select
    FOR XML PATH (@BookName), ROOT('Book'), TYPE
    TIA,
    edm2

    In terms of general XML design this is poor.  An element is normally a 'thing', and the attributes are normally the properties of that thing.  Therefore in your case you would have a Book property with a 'name' attribute.  It would be impossible
    to create an XSD for your xml, and makes it awkward for readers of your xml - how do they know the book name beforehand?  Creating this xml in the normal fashion would also make it easy to create without any messing around ( string manipulation,
    other hacks ), eg
    DECLARE @BookName NVARCHAR(20) = 'SomeBook'
    SELECT
    @BookName "@name"
    -- Other book attributes
    FOR XML PATH ('Book'), ROOT('Books'), TYPE
    So now you have a Book item(s) within a Books collection.  Easy!  : )

  • How can i develop charts using only xml defination

    how can i develop charts using only xml defination.can any one please let me know
    manks

    hello,
    in reports 6i the charts are created using oracle graphics which stores the chart definitions in a separate file (.OGD). there is not XML interface for graphics.
    with reports 9i and the introduction of the BIgraphBean the definition of the chart-properties is also done in XML.
    reports 9i will be available with iAS Release 2.
    regards,
    the oracle reports team

  • Formula variable of type replacement path not working

    Hi Folks,
    I have created formula variable of type replacement path and replaces with characteristic key.I wanted to use charecteristic infoobjects in coluns so that i have created formula variable for that.But when excecuting the query in web it is not displaying values for that formula.
    Can anyone plz solve this,if u come accross this situation before.
    Thanks and Regards,
    Ravikiran
    Edited by: MRK@SAPBI on Jun 11, 2011 1:13 PM

    Thanks vineet, for your quick reply.
    yes,i have used the characteristic in a row and it is a number.
    Still it is not displyaing values.But i need to calculate the couter for the same formula created on that charateristic and need to put condition in the query.
    thanks,
    Ravikiran

  • A formula with a formula variable with a replacement path delivers X

    A formula with a formula variable with a replacement path delivers X as a result if the characteristic of the replacement is not in the drilldown
    I have Created on ( date ) on which I have a Formula variable . I have used that Formula Variable in my calculated Key figure .
    Now the Problem is If I use Created on in ROW , The calculated key figure works . But if I don't use in Row , The calculated Key figure shows X . Situation is Users don't want to see Created on in ROW .
    If I use in row and hide also , then number of Records  will be same .
    Pls guide me what shoud I do .
    Is this problem related to support pack .

    hi
    i would like to know how to create the replacement path and authorisation variables.
    what are the steps we need to follow in rsa1.
    Edited by: vasu reddy on Apr 9, 2008 11:28 AM

  • How do I  generate XML using internal variables in a procedure

    I know there is a way to generate XML inside a procedure by querying the database such as
    SELECT XMLELEMENT("Emp",
    XMLFOREST(e.employee_id, e.last_name, e.salary))
    "Emp Element"
    FROM employees e WHERE employee_id = 204;
    Emp Element
    <Emp>
    <EMPLOYEE_ID>204</EMPLOYEE_ID>
    <LAST_NAME>Baer</LAST_NAME>
    <SALARY>10000</SALARY>
    </Emp>
    What I have unsuccessfully been trying to do is to basically do the same thing except using internal variables like
    DECLARE
    l_keytype CONTACTINFO.KEYTYPE%TYPE;
    l_keyvalue CONTACTINFO.KEYVALUE%TYPE;
    l_pricetag CONTACTINFO.PRICATEG%TYPE;
    l_xmlout CLOB;
    BEGIN
    l_keytype := '1';
    l_keyvalue := '3333';
    l_pricetag := '10';
    SELECT XMLELEMENT("ParamSet", .........................this is line 13
    XMLFOREST(l_keytype as "keytype", l_keyvalue as "keyvalue", l_pricetag as "pricetag"))
    "ParamSet Element"
    INTO l_xmlout FROM DUAL;
    DBMS_OUTPUT.PUT_LINE('l_xmlout = ' || l_xmlout);
    end;
    What I'd like it to generate is
    <ParamSet>
    <KEYTYPE>1 </KEYTYPE>
    <KEYVALUE>3333</KEYVALUE>
    <PRICETAG>100</PRICETAG>
    </ParamSet>
    But what I get is a compile error
    Error report:
    ORA-06550: line 13, column 19: (line 13 is SELECT XMLELEMENT("ParamSet", )
    PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got -
    ORA-06550: line 13, column 1:
    PL/SQL: SQL Statement ignored
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    Also, I've been told that one issue with XMLFOREST is that if the value is null it won't generate the XML for it. Not good. I will still need the XML even if it is empty. Please help.

    Darn, Marc beat me. Here was my answer showing an alternative for returning an XMLType, since that is what the query returns as he said.
    DECLARE
       l_keytype    VARCHAR2(5);
       l_keyvalue   VARCHAR2(5);
       l_pricetag   VARCHAR2(5);
       l_xmlout     CLOB;
       l_xmltype    XMLTYPE;
    BEGIN
       l_keytype := '1';
       l_keyvalue := '3333';
       l_pricetag := '10';
       SELECT XMLELEMENT("ParamSet",
                 XMLFOREST(l_keytype as "keytype",
                           l_keyvalue as "keyvalue",
                           l_pricetag as "pricetag")).getClobVal()
         INTO l_xmlout
         FROM DUAL;
       DBMS_OUTPUT.PUT_LINE('l_xmlout = ' || l_xmlout);
       SELECT XMLELEMENT("ParamSet",
                 XMLFOREST(l_keytype as "keytype",
                           l_keyvalue as "keyvalue",
                           l_pricetag as "pricetag"))
         INTO l_xmltype
         FROM DUAL;
       DBMS_OUTPUT.PUT_LINE('l_xmlout = ' || l_xmltype.getClobVal());
    end;Here is a link to Oracle's on-line documentation
    http://www.oracle.com/technetwork/indexes/documentation/index.html
    so that you can pick your version and search for XMLElement and XMLForest to see their difference as well as listening to us.

  • How can I have a use a variable view for a Popover in Xcode Applescript-ObjC?

    I'm adding Popovers to my application, but I have it coming from buttons in different views. One button might be in a Tab-View, and one in the main window. If I specify the wrong view, the Popover is off to the left and down, like the image below:
    Here's my code:
    on OpenPopover_(sender)
            Popover's showRelativeToRect_ofView_preferredEdge_(sender's frame(), MainWindow's contentView(), current application's NSMaxYEdge)
            end OpenPopover_
    How can I use a variable view or not specify the view at all so that the buttons can be in different views without having to use multiple pieces of code, using Applescript-ObjC, Xcode?

    You are using the content view of the entire window instead of whatever view the button is in - the frame rectangles are relative to the view it is in.
    The method parameters are a rectangle that is relative to the view (to position the popover), the view containing the rectangle, and the edge of the rectangle to use.  To position relative to a button, you can get the button's superview (the containing view), for example:
    popover's showRelativeToRect_ofView_preferredEdge_(sender's frame(), sender's superview(), current application's NSMaxYEdge)

  • How to use global variable defined in planning area in FOX

    Hi guys
    I meet a situation that needs to use variables defined in planning area in FOX.How to code?
    My situation as follows:
    Two variables are defined in planning area,one is zcomp_code,the other is zfiscyear.
    There are two key figures in the planning area,one is sales volume,the other is delta(%).
    I want to use sales volume multiplied by delta(%) in selected zcomp_code and zfiscyear by users.
    Anyone can help?
    Thanks in advance.

    Hi Eric
    check this example
    in fox you shoud declare your data and after call your variable
    after this you could easily operate on data using the f4 for definig the right fox operators
    DATA FYEAR TYPE 0FISCYEAR.
    FYEAR = VARV(PLANYEAR).
    {0COPANETRV, FYEAR,CRA,020} =
    {0COPANETRV,FYEAR,CRA,020} *
    ({ 0CP_DELTAB,FYEAR,CRA,020} + 100 ) /100.
    {0CP_DELTAB,FYEAR,CRA,020} = 0.

  • Using a Variable to Substitute the path\filename of a Batch file in the Start_Process Command

    I am trying to write a script that will execute a batch file on a remote Windows server.
    This line below is basically what I'm trying to do and it works without error, however I would like to use a variable for the path\filename of the batch file.
    invoke-command -computername QSC-A-ICE01 -scriptblock {Start-Process "\\qsc-a-ice01\D$\Test\RunThis.bat" }
    If I try to use a variable as in this example below I receive the error below. The error seems to indicate it's it expecting a "FilePath" parameter. Is this true? How would I change this script to make it work when substituting a variable.
    $MyProcess =  "\\qsc-a-ice01\D$\Test\RunThis.bat"
    Write-Host $MyProcess
    invoke-command -computername QSC-A-ICE01 -scriptblock {Start-Process "$MyProcess"}
    This is the error text I receive when using a variable:
     PS C:\Windows\system32> D:\Test\ThisWorks.ps1
    \\qsc-a-ice01\D$\Test\RunThis.bat
    Cannot validate argument on parameter 'FilePath'. The argument is null or empty. Supply an argument that is not null or
    empty and then try the command again.
        + CategoryInfo          : InvalidData: (:) [Start-Process], ParameterBindingValidationException
        + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.StartProcessCommand
        + PSComputerName        : QSC-A-ICE01
    PS C:\Windows\system32>

    Mike,
    Thanks for providing the link, it was very informative. The link described how to use the args in a ScriptBlock and provided me with an explaination as to why it works the way it does on a remote server. This is my 1st post to the forum and I don't know
    how the points system works yet.
    I would like to split the points , but I don't see that this is possible.
    You're very welcome, I'm glad that the information was helpful.
    You can mark as many posts as answers as you'd like, there's not a restriction on only having a single answer per thread. You certainly don't have to though, David's answer is more than sufficient to help any future people who find this thread.
    Also, on a side note, you may want to post in the thread below. Posting there will get your account verified so you'll be able to post links and images.
    http://social.technet.microsoft.com/Forums/en-US/200c33c9-abe9-494a-953a-bf53fccb3c76/verify-your-account-11?forum=reportabug
    (Future people - don't use that link.
    Click here and look for the current thread as a sticky.)
    Don't retire TechNet! -
    (Don't give up yet - 12,575+ strong and growing)

  • Variable entry for replacement path

    Hi Guys,
    This is my scenario. I have query A which uses a set of results from query B via replacement path. I have a mandatory variable entry for Query A which I have used also for query B. I was under the impression that when I made a user entry for the variable for query A, that value would be copied over to query B and perform the filtering in Query B too. Is this not the case.
    If I need to perform this operation, i.e use the value that I enter for variable entry in Query A in Query B, how can I do that?
    Thanks,
    Doniv

    Hello Doniv,
    we are using this scenario in our queries too, if we define the same variable in the query A and B,
    this value is used for the selection in the query B.
    Did you tried to search in OSS? (this could be the SAP error)
    Regards,
    Kirill

  • Formula variable problem on replacement path

    Hi all,
    I created a characteristic value variable for the 0CALDAY (ZVAR1) with the following details.
    - Characteristic Value
    - Customer exit
    - Calendar day
    - Mandatory
    - Variable is ready for input  unchecked
    Now i need to give the calculated value in customer exit by I_STEP 2 in a new formula variable (ZVAR2).
    So:
    1) I create in columns a new Formula (zFormula)
    2) In edit mode I create a formula variable (ZVAR2)
    3) in edit mode of the formula I set the following details:
      - Replacement path
      - Replace variable with: Variable
    Here the problem: when I open the popup on selected box to choose the vcharacteristic value variable I don't see the ZVAR1.
    I don't understand where is the problem.
    May you help me ... regards, Roberto

    Ok solved.
    Roberto

  • How to create a table using a variable or flat file ?

    Hello All,
    I want to create a table in which column names and data type will be read from a flat file or a variable.
    How can i do this ? Any suggestations are appricaible.....
    Regards,
    Ashish

    How about using this code.
    Used Directory object EXT_DIR where the input file abc.txt is located with the below mentioned data
    TABLE SANJ_TEST
    SANJ_AB NUMBER(6)
    SANJ_BC VARCHAR2(100)
    Declare
    v_file utl_file.file_type;
    z varchar2(100);
    v_cnt number :=0;
    v_str Varchar2(1000) :='';
    v_tab varchar2(40);
    v_col varchar2(30);
    v_data_type varchar2(30);
    Begin
    v_file := utl_file.fopen('EXT_DIR','abc.txt','r');
    loop
    utl_file.get_line(v_file,z);
    if substr(z,1,5) = 'TABLE' then
    if v_cnt <> 0 Then
    v_str := v_str||')';
    execute immediate v_str;
    end if;
    v_cnt := 0;
    v_str := 'Create Table ';
    v_tab :=Ltrim(Rtrim(substr(z,7)));
    v_str := v_str||v_tab||'(';
    Else
    dbms_output.put_line('count in else start '||v_cnt);
    v_col := ltrim(rtrim(substr(z,1,30)));
    v_data_type := ltrim(rtrim(substr(z,31)));
    if v_cnt=0 then
    v_str := v_str||v_col||' '||v_data_type;
    else
    v_str := v_str||','||v_col||' '||v_data_type;
    end if;
    v_cnt := v_cnt+1;
    End if;
    End loop;
    utl_file.fclose(v_file);
    Exception
    When NO_DATA_FOUND then
    v_str := v_str||')';
    execute immediate v_str;
    dbms_output.put_line('In excep '||sqlerrm);
    utl_file.fclose(v_file);
    End;
    /

  • How to access data without using authorization variable in report?

    Hello All,
    I am using two varibles in report, without using exit varible in report how to get the data based values enter in the ohter variable.
    How to find the roles and display the data " with out using the concept called varible used in report"

    Sorry..for late response.
    Answers to your questions:-
    Previous day to current date.
    I tried to follow steps given in the following link but failed as we have Teradata as data source and I dont know how to write a syntax for teradata similar to what is explained by Dave.
    http://www.dagira.com/2007/08/22/dynamic-dates-part-i-yesterday-and-today/
    Regards

  • How do i filter recordsets using session variable???  Please help this is driving me mad...!!

    I am having the same problem as user "Gabe the animator" in a post sent in 2007.
    "my recordset that drives a dynamic table won't filter results based on a session variable. I know session variables are working because I have the session variable echo on the page (dragged-n-dropped my session variable from the Bindings panel to my page), and that works fine. So why can't I filter my recordset with the same session variable???"
    here is the code:
    <?php require_once('Connections/mockconn.php'); ?>
    <?php
    session_start();
    ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    if(!session_id()){
    session_start();
    $colname_info = "-1";
    if (isset($_SESSION['email'])) {
      $colname_info = $_SESSION['email'];
    mysql_select_db($database_mockconn, $mockconn);
    $query_info = sprintf("SELECT name, last_name, email, password FROM registration WHERE email = %s", GetSQLValueString($colname_info, "text"));
    $info = mysql_query($query_info, $mockconn) or die(mysql_error());
    $row_info = mysql_fetch_assoc($info);
    $totalRows_info = mysql_num_rows($info);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>home</title>
    </head>
    <body>
    <div id="info">hello <?php echo $row_info['']; ?></div>
    <?php
    if (isset($_SESSION['email'])) {
              echo 'your email: '.' '. $_SESSION['email'] .' '.'good job';}
                        ?>
    </body>
    </html>
    PLEASE PLEASE HELP.... I have been at this for day's...
    how do I get the record set to filter based on the value of the session variable

    Sorry I forgot to mension the error I am getting?
    ( ! ) Notice: Undefined index: in C:\wamp\www\mock\home.php on line 59
    Call Stack
    Time
    Memory
    Function
    Location
    1
    0.0093
    389024
    {main}( )
    ..\home.php:0
    Why is this error coming up?

Maybe you are looking for

  • I deleted all my contacts!! iCloud?

    So I accidentally (intentionally but didn't realize it would delete them permanently) deleted all of my contacts on Address Book on my macbookpro, and iCloud automatically deleted them off my iPhone 4S..! It happened last week, and I've tried everyth

  • Acrobat 7 prof and windows 8.1

    Hi to all, I have used this programe for years now, and do not require an updated version - as for me it does a great job....that is until Windows 8 updated to 8.1 and now I cannot open the programe. It reads... Unable to open application. Error (0xc

  • Executing a java class in Integrator

    I have to execute a java class in Endeca Integrator. How must I go about doing this? Can i use the JavaExecute component? If yes, are there any examples of the syntax of this java class. The document states that the transformation attributes must imp

  • Music track details listed in non-Latin characters (might be Kanji)

    I copied over 44 music tracks which were all ripped at the same time from a CD; numbers 10 to 44 are fine; numbers 1 to 9 are not listed correctly in the Touchpad music player, it looks to me like the details have been tranlated to Kanji font. They a

  • Created routine cannot be found NACE

    Hi Gurus, I created a custom program that will be called by the nace transaction. However, I am having a problem "Processing routine ENTRY in program ZPROGRAM does not exist." when I save my SO. But I have the ENTRY form in the program. The output ty