Averages in a query using a variable with Replacement Path: Replacement wit

I have two queries. Query1 has a handful of characteristics, one of which is used in a formula where I used replacement path in order to be able to use it in some calculated key figures. I also have a couple of key figures that are not calculated and they are averages.
The second query has a characteristic value variable that is replaced with the first query. This replacement value variable is placed into the filter section and the characteristic itself is placed in the rows section. I am bringing in the same calculated key figures that were in my first query as well as the normal key figures that are averages.
The issue I am having is the regular key figures that I am bringing in are coming in summed up instead of as averages. Is it possible to bring the normal key figures in Query1 as averages into Query2?
There is more information in the thread below if you need more background.
[Replacement Path and Aggregation;
PS - I am using 7.0.

Hi Satyakam,
In the text variable properties make sure that in the replacment path you have chosen "Text" to appear date as per user setting . Other wise as in your case it must be set to "Key" which always shows in the format YYYYMMDD.
Hope that helps.
Regards
Mr Kapadia

Similar Messages

  • How do I...Mimic Replacement Path with Query using Customer Variable Exits?

    Hello SDN:
    We are on BW 3.5 SP16.
    We are currently using a replacement path Query(RP) with variables
    to populate a variable in another Query(T).
    The problem we are having is with performance.
    The entry of variables in replacement path Query(RP) is optional (This is necessary there cannot be required values)
    When results from Replacement Path Query are small performance is fine. (e.g. 10 seconds)
    When results from Replacement path query are large performance suffers. (e.g. 1+ minutes)
    Users are free to leave the replacement path variables empty resulting in a large set of data to be replaced. This is the worst performance case.
    We would like to discover a way to conditionally execute the replacement path query. That is if users do not enter values for the replacement Query(RP) variables do not execute the replacement path query(RP).
    Does anyone know if this is possible within reason and in customer exit space?
    We have reviewed the situation from all angles and the requirement for the replacement path FUNCTIONALITY and the freedom for the user to leave variable values blank remains.
    I've been searching and reading SDN and SAP notes for about a week and do not find threads which address this situation.
    We are also exploring Customer variable exits to mimic replacement path functionality
    (different topic subject="How do I...Mimic Replacement Path with Query using Customer Variable Exits?")
    Any help will be appreciated
    Many thanks
    David Schuh

    My appologies-I posted this message with the wrong subject. I will repost it with appropriate subject.
    dave schuh

  • Using bind variable with IN clause

    My application runs a limited number of straight up queries (no stored procs) using ODP.NET. For the most part, I'm able to use bind variables to help with query caching, etc... but I'm at a loss as to how to use bind variables with IN clauses. Basically, I'm looking for something like this:
    int objectId = 123;
    string[] listOfValues = { "a", "b", "c"};
    OracleCommand command = new OracleCommand();
    command.Connection = conn;
    command.BindByName = true;
    command.CommandText = @"select blah from mytable where objectId = :objectId and somevalue in (:listOfValues)";
    command.Parameters.Add("objectId", objectId);
    command.Parameters.Add("listOfValues", listOfValues);
    I haven't had much luck yet using an array as a bind variable. Do I need to pass it in as a PL/SQL associative array? Cast the values to a TABLE?
    Thanks,
    Nick

    Nevermind, found this
    How to use OracleParameter whith the IN Operator of select statement
    which contained this, which is a brilliant solution
    http://oradim.blogspot.com/2007/12/dynamically-creating-variable-in-list.html

  • Preselection-variable (replacment-path: replacement with query)

    Hello Expert's
    Can you explain me, how we can set up a pre-query with characteristics and key figures.
    e.g.
    Due the performace reason in the olap process, we have the calculate a range of values before
    in query 1. This query contains characteristics and key figures.
    In the query 2 we've preselection-variable (replacment-path: replacement with query) to query 1.
    My question is, how we can get also the key figures-values from query 1, to continue to use the values for query 2?
    Thanks for feedbacks,
    Regards

    Hi,
    As this is the variable restriction and variable restrictions are not put on key figure values (except RKF). As I know you will not be able to get key figure values using replacemtn path with query.
    Regards,
    Durgesh.

  • Time Format using text variable with replacement path

    Hi Friends,
                                 I've used "Text variable with replacement path" to make the column heading dynamic by replacing the values referring from "0calday"...
    everything is working fine, but here it is displaying the time format like
    YYYYMMDD (20030101), i want it to be displayed DDMMYYYY (01012003) in the column heading... how to make it possible?
    pls waiting for ur inputs, it's an urgent...
    Regards,
    Pattnaik

    Hi Satyakam,
    In the text variable properties make sure that in the replacment path you have chosen "Text" to appear date as per user setting . Other wise as in your case it must be set to "Key" which always shows in the format YYYYMMDD.
    Hope that helps.
    Regards
    Mr Kapadia

  • How to use shared variables with native c programs

    Hello
    What is the way to use shared variables with native c programs?
    I have a c/c++ program that uses the NIDAQmx C-API to perform measurements. Now I want to communicate to a LabVIEW program via shared variables.
    Is there a C-API for shared variables as there is for the NIDAQmx functionality? Where can I find further documentation? The document "Using the LabVIEW Shared Variable" mentions that one "can read and write to shared variables in ANSI C", but there are no hints about how and where to look.
    Thanks in Advance

    Hi user42,
    with CVI 8.0, you cannot create or configure shared variables. However, you can read or write to an already configured LabVIEW 8.x shared variable from CVI using the DataSocket API.
    In order to do this you need to have and DataSocket 4.3 or higher installed.
    Here's a forum post about using the DataSocket functions a LabVIEW Shared Variables:
    http://forums.ni.com/ni/board/message?board.id=180&message.id=24569&requireLogin=False
    With CVI 8.1 and Measurement Studio 8.1 it's possible to use Shared Variables via the Network Varaiable Library (check out the end of the "Network-Published Shared Variable" section within the "Using the LabVIEW Shared Variable" documentation and the following link).
    Datasocket with LabWindows/CVI and LabVIEW Real-Time:
    http://digital.ni.com/public.nsf/allkb/CC4343488413A2F586256E6200099638?OpenDocument
    Daniel
    NIG

  • Please help to re-write this query using exists or with

    Hi please help to re-write this query using exists or with, i need to write same code for 45 day , 90 days and so on but sub query condition is same for all
    SELECT SUM (DECODE (t_one_mon_c_paid_us, 0, 0, 1)) t_two_y_m_mul_ca_
    FROM (SELECT SUM (one_mon_c_paid_us) t_one_mon_c_paid_us
    FROM (
    SELECT a.individual_id individual_id,
    CASE
    WHEN NVL
    (b.ship_dt,
    TO_DATE ('05-MAY-1955')
    ) >= SYSDATE - 45
    AND a.country_cd = 'US'
    AND b.individual_id in (
    SELECT UNIQUE c.individual_id
    FROM order c
    WHERE c.prod_cd = 'A'
    AND NVL (c.last_payment_dt,
    TO_DATE ('05-MAY-1955')
    ) >= SYSDATE - 745)
    THEN 1
    ELSE 0
    END AS one_mon_c_paid_us
    FROM items b, addr a, product d
    WHERE b.prod_id = d.prod_id
    AND d.affinity_1_cd = 'ADH'
    AND b.individual_id = a.individual_id)
    GROUP BY individual_id)
    Edited by: user4522368 on Aug 23, 2010 9:11 AM

    Please try and place \ before and after you code \Could you not remove the inline column select with the following?
    SELECT a.individual_id individual_id
         ,CASE
            when b.Ship_dt is null then
              3
            WHEN b.ship_dt >= SYSDATE - 90
              3
            WHEN b.ship_dt >= SYSDATE - 45
              2
            WHEN b.ship_dt >= SYSDATE - 30
              1
          END AS one_mon_c_paid_us
    FROM  items           b
         ,addr            a
         ,product         d
         ,order           o
    WHERE b.prod_id       = d.prod_id
    AND   d.affinity_1_cd = 'ADH'
    AND   b.individual_id = a.individual_id
    AND   b.Individual_ID = o.Individual_ID
    and   o.Prod_CD       = 'A'             
    and   NVL (o.last_payment_dt,TO_DATE ('05-MAY-1955') ) >= SYSDATE - 745
    and   a.Country_CD    = 'US'

  • How to use bind variables with XMLTABLE?

    I tried to use bind variables with xmltable statment. Here, my testcase:
    create or replace function wsdltest return xmltype as
    l_dummy xmltype;
    l_stt clob;
    l_name varchar2(500);
    l_xml clob;
    BEGIN
    l_xml :=
    '<definitions name="F1" targetNamespace="http://xmlns.oracle.com/orawsv/XFILES/F1" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns.oracle.com/orawsv/XFILES/F1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    <types>
    <xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/XFILES/F1" elementFormDefault="qualified">
    <xsd:element name="SVARCHAR2-F1Input">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="A-VARCHAR2-IN" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="F1Output">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="RETURN" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    </types>
    <message name="F1InputMessage">
    <part name="parameters" element="tns:SVARCHAR2-F1Input"/>
    </message>
    <message name="F1OutputMessage">
    <part name="parameters" element="tns:F1Output"/>
    </message>
    <portType name="F1PortType">
    <operation name="F1">
    <input message="tns:F1InputMessage"/>
    <output message="tns:F1OutputMessage"/>
    </operation>
    </portType>
    <binding name="F1Binding" type="tns:F1PortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="F1">
    <soap:operation soapAction="F1"/>
    <input>
    <soap:body parts="parameters" use="literal"/>
    </input>
    <output>
    <soap:body parts="parameters" use="literal"/>
    </output>
    </operation>
    </binding>
    <service name="F1Service">
    <documentation>Oracle Web Service</documentation>
    <port name="F1Port" binding="tns:F1Binding">
    <soap:address location="http://localhost:8080/orawsv/XFILES/F1"/>
    </port>
    </service>
    </definitions>';
    -- OK
    l_stt := 'select * from xmltable(XMLNAMESPACES(''http://www.w3.org/2001/XMLSchema'' AS "XSD", default ''http://schemas.xmlsoap.org/wsdl/''),
    ''//definitions/types/XSD:schema/XSD:element[@name="SVARCHAR2-F1Input"]''
    passing xmltype(:1)
    columns
    ab xmltype path ''.'' ) t';
    EXECUTE IMMEDIATE l_stt INTO l_dummy using l_xml;
    -- ERROR ORA-01006
    l_name := '"SVARCHAR2-F1Input"';
    l_stt := 'select * from xmltable(XMLNAMESPACES(''http://www.w3.org/2001/XMLSchema'' AS "XSD", default ''http://schemas.xmlsoap.org/wsdl/''),
    ''//definitions/types/XSD:schema/XSD:element[@name=:2]''
    passing xmltype(:1)
    columns
    ab xmltype path ''.'' ) t';
    EXECUTE IMMEDIATE l_stt INTO l_dummy using l_xml, l_name;
    return l_dummy;
    END;
    Any idea ?
    Thanks in advance
    Cyryl

    Why are you using dynamic SQL statements? Why not just use something like this instead in your PL/SQL. I also replaced the leading // in your Xpath with just / since you start from the root node.
    select *
      INTO l_dummy
      from xmltable(XMLNAMESPACES('http://www.w3.org/2001/XMLSchema' AS "XSD", default 'http://schemas.xmlsoap.org/wsdl/'),
                    '/definitions/types/XSD:schema/XSD:element'
                    passing xmltype(l_xml)
                    columns
                    ab xmltype path '.' ) t;Also, the above returns two rows, which I suspect is not what you want. Here is the pure SQL version for you to debug.
    select *
      from xmltable(XMLNAMESPACES('http://www.w3.org/2001/XMLSchema' AS "XSD", default 'http://schemas.xmlsoap.org/wsdl/'),
                   '/definitions/types/XSD:schema/XSD:element'
                   passing xmltype('<definitions name="F1" targetNamespace="http://xmlns.oracle.com/orawsv/XFILES/F1" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns.oracle.com/orawsv/XFILES/F1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    <types>
    <xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/XFILES/F1" elementFormDefault="qualified">
    <xsd:element name="SVARCHAR2-F1Input">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="A-VARCHAR2-IN" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="F1Output">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="RETURN" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    </types>
    <message name="F1InputMessage">
    <part name="parameters" element="tns:SVARCHAR2-F1Input"/>
    </message>
    <message name="F1OutputMessage">
    <part name="parameters" element="tns:F1Output"/>
    </message>
    <portType name="F1PortType">
    <operation name="F1">
    <input message="tns:F1InputMessage"/>
    <output message="tns:F1OutputMessage"/>
    </operation>
    </portType>
    <binding name="F1Binding" type="tns:F1PortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="F1">
    <soap:operation soapAction="F1"/>
    <input>
    <soap:body parts="parameters" use="literal"/>
    </input>
    <output>
    <soap:body parts="parameters" use="literal"/>
    </output>
    </operation>
    </binding>
    <service name="F1Service">
    <documentation>Oracle Web Service</documentation>
    <port name="F1Port" binding="tns:F1Binding">
    <soap:address location="http://localhost:8080/orawsv/XFILES/F1"/>
    </port>
    </service>
    </definitions>'
                   columns
                   ab xmltype path '.' ) t

  • Charateristic variable with Processing type "replacement path"

    Hi all
    I am using BI 7.0;
    I have a characteristic ZPL_CNT in one dimensions of a Cube;
    now i want to use the value of  the ZPL_CNT as column in Query.
    So i created a formula and a formula variable with replacement path of processing type:
    setting:
    i created a new formula "Calculated MBZ"
    the formula variables is "ZMBZ" and inserted the variables into "Calculated MBZ"
    Reference characteristic: ZPL_CNT
    Processing type : Replacement path
    Replace variable with: Attribute value
    Attribute: characteristic Reference (constant 1)
    But i find the value in Query incorrect
    Can anyone help me solve this problem?
    Thanks!

    Hi Dragon,
    Can you not drag and drop this characteristic directly in the columns...have I misunderstood something?
    I think when you use replacement path in the formula variable , the fromula variable tries to find the reference characteristic value at each record level in the report and then replaces it with attribute value as defined and may be in your case as the characteristice is not defined in the row , it has problems to identify which value of the characteristic it has to replace.
    Regards,
    Sunmit.

  • Replacement Path: Replacement with a Variable Value

    How I can show the value of a variable entered by the user in the description of the column in the report?
    X and Y are variables entered by the user and reflect the lower limits of the range for count documents
    Example
    Table                              
    0doc_type     Material_type  Purchase_group     < X     => X And <=Y     > Y
    XXX     BBBBB        CCCCCC                         3     4                                          5

    Hi...
    Use a text variable in the column description,
    and use replacement path to show the descriptions as required.
    lets say you have variable 1 and variable 2
    create two text variables with processing type replacement path and select the above variables for each.
    Eg. the descriptions of your columns would be something like this after using text variables
    Total number of documents which are lower than &txt_var_x&.
    Total number of documents which are between &txt_var_x&. and &txt_var_y&..
    Total number of documents which are greater than &txt_var_y&..
    Hope this helps,
    Regards,
    Joe

  • Using a Variable with AJAX

    Hello,
    Below I have posted code that I have on two different PHP files, tsearch12.php and votes12.php. The code works great. The file "tsearch12.php" uses AJAX to go to votes12.php to perform some functions. However, the first page has a variable called "find." These two pages only work together when the variable "find" equals "santafe." I would like them to work together regardless of what "find" equals. In other words, I would like to replace the table name "santafe" in votes12.php with the variable "find," but I want the variable "find" to equal the same value in both tsearch12.php and votes12.php. The variable "find" is going to tsearch12.php from another file, which has a simple HTML form with "<form action="tsearch12.php" method="post">" and "<input type="text" name="find" size="55"/>". Anyway, how do I use the variable "find" in votes12.php?
    Thanks in advance,
    John
    On tsearch12.php, I have:
    # <head> 
    # <script type='text/javascript' src='jquery.pack.js'></script> 
    # <script type='text/javascript'> 
    # $(function(){ 
    #     $("a.cell1").click(function(){ 
    #     //get the id 
    #     the_id = $(this).attr('id'); 
    #     // show the spinner 
    #     $(this).parent().html("<img src='images/spinner.gif'/>"); 
    #     //fadeout the vote-count  
    #     $("span#votes_count"+the_id).fadeOut("fast"); 
    #     //the main ajax request 
    #         $.ajax({ 
    #             type: "POST", 
    #             data: "action=vote_up&id="+$(this).attr("id"), 
    #             url: "votes12.php", 
    #             success: function(msg) 
    #                 $("span#votes_count"+the_id).html(msg); 
    #                 //fadein the vote count 
    #                 $("span#votes_count"+the_id).fadeIn(); 
    #                 //remove the spinner 
    #                 $("span#button"+the_id).remove(); 
    #     $("a.vote_down").click(function(){ 
    #     //get the id 
    #     the_id = $(this).attr('id'); 
    #     // show the spinner 
    #     $(this).parent().html("<img src='images/spinner.gif'/>"); 
    #     //the main ajax request 
    #         $.ajax({ 
    #             type: "POST", 
    #             data: "action=vote_down&id="+$(this).attr("id"), 
    #             url: "votes12.php", 
    #             success: function(msg) 
    #                 $("span#votes_count"+the_id).fadeOut(); 
    #                 $("span#votes_count"+the_id).html(msg); 
    #                 $("span#votes_count"+the_id).fadeIn(); 
    #                 $("span#button"+the_id).remove(); 
    # </script> 
    # </head> 
    # <body> 
    # <? 
    # //This is only displayed if they have submitted the form 
    # if ($searching =="yes") 
    # //If they did not enter a search term we give them an error 
    # if ($find == "") 
    # echo "<p>You forgot to enter a search term"; 
    # exit; 
    # // Otherwise we connect to our Database 
    # mysql_connect("mysqlv3", "username", "password") or die(mysql_error()); 
    # mysql_select_db("sand2") or die(mysql_error()); 
    # $find = strip_tags($find); 
    # $find = trim ($find); 
    # $result=mysql_query("SHOW TABLES FROM sand2 LIKE '%$find%'") 
    # or die(mysql_error()); 
    # if(mysql_num_rows($result)>0){ 
    # while($table=mysql_fetch_row($result)){ 
    # print "<p class=\"topic\">$table[0]</p>\n"; 
    # $r=mysql_query("SELECT * FROM `$table[0]`"); 
    # print "<table class=\"navbar\">\n"; 
    # while($row=mysql_fetch_array($r)){ 
    # $effective_vote = $row['votes_up'] - $row['votes_down'];  
    # print "<tr>"; 
    # print "<td>".'<a href="http://'.$row['site'].'" class="links2">'.$row['site'].'</a>'."</td>"; 
    # print "<td class='votes'>".'<span class="votes_count" id="votes_count'.$row['id'].'">'.number_format($effective_vote).'</span>'."</td>"; 
    # print "<td class='ballot'>".'<span class="button" id="button'.$row['id'].'">'.'<a href="javascript:;" class="cell1" id="'.$row['id'].'">'.Vote.'</a>'.'</span>'."</td>"; 
    # print "</tr>\n"; 
    # print "</table>\n"; 
    # else{ 
    # print "None found"; 
    # $anymatches=mysql_num_rows($result); 
    # if ($anymatches == 0) 
    # echo "Sorry, but we can not find an entry to match your query<br><br>"; 
    # ?>    On votes12.php, I have:
    # <?php 
    # mysql_connect("mysqlv3", "username", "password") or die(mysql_error()); 
    # mysql_select_db("sand2") or die(mysql_error()); 
    # function getAllVotes($id) 
    #     Returns an array whose first element is votes_up and the second one is votes_down
    #     $votes = array(); 
    #     $q = "SELECT * FROM santafe WHERE id = $id"; 
    #     $r = mysql_query($q); 
    #     if(mysql_num_rows($r)==1)//id found in the table 
    #         $row = mysql_fetch_assoc($r); 
    #         $votes[0] = $row['votes_up']; 
    #         $votes[1] = $row['votes_down']; 
    #     return $votes; 
    # function getEffectiveVotes($id) 
    #     Returns an integer
    #     $votes = getAllVotes($id); 
    #     $effectiveVote = $votes[0] - $votes[1]; 
    #     return $effectiveVote; 
    # $id = $_POST['id']; 
    # $action = $_POST['action']; 
    # //get the current votes 
    # $cur_votes = getAllVotes($id); 
    # //ok, now update the votes 
    # if($action=='vote_up') //voting up 
    #     $votes_up = $cur_votes[0]+1; 
    #     $q = "UPDATE santafe SET votes_up = $votes_up WHERE id = $id"; 
    # elseif($action=='vote_down') //voting down 
    #     $votes_down = $cur_votes[1]+1; 
    #     $q = "UPDATE santafe SET votes_down = $votes_down WHERE id = $id"; 
    # $r = mysql_query($q); 
    # if($r) //voting done 
    #     $effectiveVote = getEffectiveVotes($id); 
    #     echo $effectiveVote; 
    # elseif(!$r) //voting failed 
    #     echo "Failed!"; 
    # ?>  

    These forums are for development with Java. Not JavaScript, which is an entirely different language. And AJAX is JavaScript. You need to use Google and find a JavaScript forum for your question (or a PHP forum if your question is really about PHP).

  • Using a Variable with BEX Java Applications

    If I put a variable into a query and try to run the query using anything Java based (e.g. Web analyzer) when I do a drop down on the variable in the query to make a selection I dont get a proper selection choice. For example if I have a variable on Cost Centre I do the drop down on cost centre and I dont get a list of cost centres to chose from I just get ?? where the cost centres should be. If I select a ?? it does select a cost centre. It's just pot luck which you selec as they are all ??!  This happens on any variable I use SAP Standard or any I have created. Any ideas - sounds like a Java patch should fix it but I cant see anything in SAP notes etc.

    I put a query in a WAD or when I Execute a Query from the Query designer.  When I run the query the variable on the filter kicks in and it requests I select something e.g. cost centre. When I do the drop down in the variable to select a cost centre I dont get a list of cost centres. Only ?? where a cost centre should be. However when I select a ?? it does know what the cost cejtre is as it populates the variable with a cost centre. All the cost centre data is loaded etc.

  • CS5 Advanced Query - using a variable for a column name

    Hi
    I have been using Dreamweaver for a few years now, mostly version 8, but have just moved to CS5 (I teach it - among lots of other thing -  at what in the US would be a community college).
    I have problem with a page in CS5 that worked fine in my old version 8 edition.
    I am using PHP and MySQL as my server technologies
    I have a CD database and have constructed a Search Page which has a Form with a Text Box (stext) for the search criteria, and 3 option buttons to select the DB column I want to search on.  The option buttons are called sfield - and have values band, title, and/or year these will be passed to my display page (display.php) via GET array URL Parameters.  They are passed fine.
    I want to be able to enter "Pink" into the search text field, click the Band option button, and then my data displayed would inlude CDs by any band with Pink in their name i.e. Pink Floyd.  If I put 1989 and click the year option button, I search for all CDs from 1989 and so on.
    On my display page I created a recordset and selected my MySQL Server, DB Table, and using the simple dialogue selected band as the Filter and "contains" and the URL Parameter stext.   This all works as expected. I put in a  dynamic table and when I run it to test it, it will search on band only and works fine.
    Its when I try to select the column to search I get a problem.  I go to the advanced recordset dialogue.  I have the SQL
    Select * from newellcds where band like %colname%
    I need to change this to add a new variable, lookfield, which will hold my column selection from the option buttons (URL parameter: sfield), so I create the TEXT variable, with band as the default and the value of $_GET['sfield'] and put it into my SQL
    Select * from newellcds where lookfield like %colname% - and it doesn't work!!!  I always get no return from the database.
    After much experimentation, I echoed the Dreamweaver generated SQL on the screen and when I entered Pink and selected band on the search page, the Display SQL was displayed as:
    Select * from newellcds where 'band' like '%Pink%'
    Dreamweaver is putting single quotes round the value returned by my lookfield variable 'band' in this case.  If I enter the SQL without the quotes round Band into MySQL it works, with the quotes I get no returns.
    After this very long description - does anyone have an idea how to get rid of the quotes round my lookfield variable???
    How do I create a search page with two values passed - the actual criteria to search for, and the field to search for it in?
    Any help would be greatly appreciated.

    I don't have anything useful to contribute because I don't use DW to create queries, and you are not looking for help writing the query. You just want to get rid of the single quotes, which I can't help with.
    But based on your description, shouldn't the query be
    SELECT * FROM newellcds WHERE $sfield LIKE '%$stext%'
    If not, then I am not following.

  • 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

  • Using cpInfoElapsedTimeMS variable with Submit All quiz

    I've created a branching scenario with the cpInfoElapsedTimeMS variable to have my quiz time out after a set time and it works great if I don't have the Quiz Preferences set to Submit All. Because I must allow my learners to go back and review their answers before submitting to the LMS, I need to use the Submit All setting, which stops the variable from working properly. Any suggestions? Thanks!

    I put a query in a WAD or when I Execute a Query from the Query designer.  When I run the query the variable on the filter kicks in and it requests I select something e.g. cost centre. When I do the drop down in the variable to select a cost centre I dont get a list of cost centres. Only ?? where a cost centre should be. However when I select a ?? it does know what the cost cejtre is as it populates the variable with a cost centre. All the cost centre data is loaded etc.

Maybe you are looking for

  • IPod touch fourth generation.

    I have an iPod Touch fourth generation, but the screen has been cracked for a whle now and the bottom half of the screen doesn't respond to my touches. So therefore, I can not unlock/use the iPod. I have rebooted it and restored it to the factory set

  • Creating objects in a loop

    Hi I have read that creating objects in a loop degrades performance. Can someone explain why this should be so?

  • Unicode :  Chinese

    Hi ALL  , Recently we moved to Unicode , and we are facing problem with an interface program for citybank citybank -cityDirect  specification is based on the field position in the flat file,it identifies  fields from the field position. File is downl

  • Find a window in XMonad and apply some actions to it

    Hi everyone, I think this should be really easy for someone who's good at Haskell but I just couldn't figure it out as I'm bad at it. Basically I want to search through the list of windows in the current workspace, find one matching some condition an

  • Adobe Reader in INR*

    Hi - my nurses use INR* & when printing of the summary forms Adobe reader box appears, prints the document but then remains in the lower toolbar of the screen.  This does not happen on all pc's.  I have checked the setting in adobe/INR* but can not d