Query should fetch single value

Hi,
I have created a Key figure with exception aggregate as Last value with reference char as order.
I have data like
Ord date KY KY2
01   ...    22   221
01  ...     22   223
02  ...     23   234
I want to get in the query KY= 22 for Ord=01 but i am getting KY= 44.
The exception aggregate is not working. IS there any other option.
Thanks,
Joseph M

Hi,
If you keep the Order no in the rows, then take Line item no as exception char.
Regards,
Anil Kumar

Similar Messages

  • Query should fetch all the query details in the system.

    Hi All
    We  are looking for a query which will fetch all the query details in the system along with the user names either who has created the query or who has run it atleast once.
    If any of the queries are not used for a long time then we  can delete it with the user's/owner's approval.
    Is there anyway we can desing such query .
    Thanks
    Asim

    Hi,
    Thanks for the reply.
    My requirement is that we want to create a new query which should fetch the details information of already existing queries.
    Like who has created that query, how frequently the use it etc...
    Whenever we run the new query it should give information of all other existing queries.
    Thanks and Regards
    Asim

  • Subject: BW Query Variable – Multiple Single Values

    I have set a characteristic variable on process chain id. In General tab, Variable is u201Cprocess by manual inputu201D.
    In Details tab, I set:
    Variable represents Multiple Single Values, Variable is ready for Input
    When I run my query, I can select multiple process chain ids. Problem is query returns process chain information for only one value (first value entered for process chain id in multiple selections. I have verified process chain information exists for all the multiple values.
    Appreciate any feedback.

    Thanks, I do not find any other restrictions. If I simply remove the variable which lets me spacify multiple single values, I see
    all the process chains. When I  add this variable to query under retsriction and run the query, I see pop-up and I can enter multiple values, but only first one is being searched. There is probably some setting in variable definition somewhere that it only processes first value.
    Is there a way in RSRT to show me entire ABAP code of the query. 
    I ran RSRT set some break points but it is kind hard to troubleshoot. If I had the entire code, I can try to understand what is being done.

  • Need query to fetch single record

    I am having table t1 with below data
    c1 c2
    1   10
    2   10
    when I am using below query 
    select max(c2) from t1 group by c1
    I am geeting both the records.
    How can i fetch only record (any one) ?

    Hi,
    Here's one way
    WITH   got_r_num AS
        SELECT  c1, c2
        ,       ROW_NUMBER () OVER (ORDER BY  c2  DESC) AS r_num
        FROM    t1
    SELECT  c1, c2
    FROM    got_r_num
    WHERE   r_num  = 1
    The row displayed will be the one with the highest c2 value (or one of those rows, if there happens to be a tie.)
    This is called a Top-N Query, because it picks N items (N=1 in this case) from the top of an ordered list.
    Starting in Oracle 12.1, you can also use
    SELECT    c1, c2
    FROM      t1
    ORDER BY  c2  DESC
    FETCH     FIRST 1 ROW ONLY

  • RRI - Target query should get input values to variables from first Query

    Hi,
    I have 2 queries in RRI, when i execute it , i am going to target query, but poping the variable screen, but i should get the input values from the first query automatically.
    ex: in my first query, If i select CUSTOMER - A, then second query directly should take the input as Customer as A ans display the Customer A values.
    Thnaks,
    Amar.

    Hi,
           In the Assignment details, I have given the Document date variable of the second query  for the 0calday of the first query.I hope this sentence is clear
    Then the 0calday value directly passes to 0doc_date variable of the second query. And this 0doc_date variable is not seen in the second query.But rest of the variables of the second query like doc num ,category etc. are still visible in the pop up screen. the requirement is Pop Up Screen should be avoided completely
    How can be this achieved.
    Regards,
    Amar

  • Selection values in query should have help values based on another field

    Hi all,
    I have the following requirement:
    I have a query in which there are the following two filters in the
    selection criteria:
    1. COuntry
    2. State
    Based on the Country selected, the values for the State should come up
    in the Help values in the slection criteria. The user then shall select from these values.
    I plan to use a variable for Country with Replacemetn path as the second query whcih shall have Coutnry and States.
    Is this right or can I do this in a better way? Please suggest.
    Thanks and Regards,
    Srilakshmi B

    Hi,
    See you can achieve this through exit variable.
    Try to create one custom table or try to refer to master data tables may be?
    Custom table need to maintain your master data and need to be referred in below code.
    INCLUDE ZXRSRU01 *
    Enhancement: MultiProvider using InfoProvider Variable
    include YBW_INFOPROVIDER_VARIABLE.
    *& Include YBW_INFOPROVIDER_VARIABLE *
    DATA:
    ls_var TYPE rrs0_s_var_range,
    ls_range TYPE rsr_s_rangesid,
    l_contained TYPE c,
    ls_mapping TYPE ybw_mapping,
    lt_mapping TYPE TABLE OF ybw_mapping.
    Called after variable popup
    IF i_step = 2 AND i_vnam = 'INFOPROV'.
    - 13 -
    Read mapping table
    REFRESH lt_mapping.
    SELECT * FROM ybw_mapping INTO TABLE lt_mapping.
    Process all selection for country variable
    REFRESH e_t_range.
    LOOP AT i_t_var_range INTO ls_var WHERE vnam = 'S_COUNT'.
    Process all mapping rules
    LOOP AT lt_mapping INTO ls_mapping.
    Always fill LOW and HIGH, Otherwise logic below will not work
    IF ls_mapping-high IS INITIAL.
    ls_mapping-high = ls_mapping-low.
    ENDIF.
    Check if selection is contained in the defined InfoProvider
    CLEAR l_contained.
    CASE ls_var-opt.
    WHEN 'EQ'.
    IF ls_var-low BETWEEN ls_mapping-low AND ls_mapping-high.
    l_contained = 'X'.
    ENDIF.
    WHEN 'BT'.
    IF ls_var-low <= ls_mapping-high AND
    ls_var-high => ls_mapping-low.
    l_contained = 'X'.
    ENDIF.
    ENDCASE.
    Add InfoProvider to return table
    Note: Use COLLECT to avoid duplicates
    IF l_contained = 'X'.
    CLEAR ls_range.
    ls_range-sign = 'I'.
    ls_range-opt = 'EQ'.
    ls_range-low = ls_mapping-infoprov.
    COLLECT ls_range INTO e_t_range.
    ENDIF.
    ENDLOOP. " lt_mapping
    ENDLOOP. " i_t_var_range
    EXIT.
    ENDIF.
    Thanks and regards

  • APD: Query keyfigure fetches no values

    Hello experts,
    I am using a query as inforprovider in an APD. The query has 2 keyfigures and several other characteristics. All data is properly populated when the query is executed independently. But when i see intermediate result of query result in APD, one out of the 2 kefigures shows blank values. All other fields are working fine. As such, this value is not being passes to the target in APD.
    Please guide.
    Thanks,
    Abhishek.

    Hi Rick,
    As mentioned in the post above - 'I randomly created a formula in the query over the volume key figure which was not showing value in APD earlier. But I did not use this formula in the APD, I am still using the old key figure. Surprisingly, this resolved the issue.' Not sure of the reason though.
    Regards,
    Abhishek.

  • Bex query. Select single values in variable time out.

    I have created a variable on characteristic 0profit_ctr which works fine for all queries on all Infoproviders except for one.  With this particular Infoprovider, which is a DSO when the option to show u201CSingle Valuesu201D is selected in the variable screen the query just hangs and eventually time-outs. I have tried including the DSO in a mult-provider but still have the same issue. The variable works on other DSOu2019s with exactly the same settings. This DSO has less data than the other DSOu2019s which work fine.
    I know that 0profit_ctr is compounded with 0co_area which I have tried restricting with no change in the result.
    I would be grateful of any ideas.
    Thanks
    Jenny

    Hi Durgesh.
    I checked the settings and although they were the same as other infoproviders I changed the query filter value to use the values in the master data table and this has solved my problem.
    Thanks for your tip.
    Regards
    Jenny

  • Dynamic SQL query to get single value from list in a column

    I have two tables: tblWorkers and tblSkills. tblWorkers has a
    column, Skills, which is populated from a multiple-checkbox form
    field with one or more skill_IDs from tblSkills, so each
    tblWorkers.Skills consists of a list of one or more comma-delimited
    values. For any Skill_ID, I need to generate a listing of all
    Workers with the corresponding skill, so I have tried to do
    something along the lines of SELECT WorkerName FROM tblWorkers
    WHERE Skills IN (Skills, #FORM.Skill_ID#) ... or WHERE Skills IN
    (ListFind(Skills, #FORM.Skill_ID#)) ... etc. ??? My results (once I
    got data type mismatches out of the way) return all Workers, not
    just those with the desired Skill. There must be an easy way to do
    this ... How do people with a bit more CF/SQL experience than I
    have do this???

    quote:
    Originally posted by:
    lucapac
    I have two tables: tblWorkers and tblSkills. tblWorkers has a
    column, Skills, which is populated from a multiple-checkbox form
    field with one or more skill_IDs from tblSkills, so each
    tblWorkers.Skills consists of a list of one or more comma-delimited
    values. For any Skill_ID, I need to generate a listing of all
    Workers with the corresponding skill, so I have tried to do
    something along the lines of SELECT WorkerName FROM tblWorkers
    WHERE Skills IN (Skills, #FORM.Skill_ID#) ... or WHERE Skills IN
    (ListFind(Skills, #FORM.Skill_ID#)) ... etc. ??? My results (once I
    got data type mismatches out of the way) return all Workers, not
    just those with the desired Skill. There must be an easy way to do
    this ... How do people with a bit more CF/SQL experience than I
    have do this???
    As Kronin implied, we normalize our databases. If you don't
    understand that answer, the book "Database Design for Mere Mortals"
    is often mentioned on this forum.

  • Fetching multiple values from XML node

    Hi,
    I have the below XML string / Data stored in one of a table column. I am trying to extract the values of ITEM_NAME node. using the query :
    select extractvalue(xml_data, '/BILL/BILL_DTL/RECORD/ITEM_NAME') from XMLTable;
    If i use this query i am getting the error as : ORA-19025 EXTRACTVALUE returns value of only one node
    XML String / XML data
    &lt;BILL&gt;
    .....&lt;BILL_NO&gt;1000&lt;/BILL_NO&gt;
    .....&lt;SRNO&gt;3456&lt;/SRNO&gt;
    .....&lt;BILL_DTL&gt;
    ........&lt;RECORD&gt;
    ...........&lt;LINE_NO&gt;1&lt;/LINE_NO&gt;
    ...........&lt;ITEM_NAME&gt;TOYOTA COROLLA&lt;/ITEM_NAME&gt;
    ........&lt;/RECORD&gt;
    ........&lt;RECORD&gt;
    ..........&lt;LINE_NO&gt;2&lt;/LINE_NO&gt;
    ..........&lt;ITEM_NAME&gt;NISSAN CEDRIC&lt;/ITEM_NAME&gt;
    .......&lt;/RECORD&gt;
    .....&lt;/BILL_DTL&gt;
    &lt;/BILL&gt;
    The structure of the table is given below.
    SQL&gt; DESC XMLTABLE;
    Column_Name ---------------Type
    DOC_ID -------------------------NUMBER
    XML_DATA --------------------XMLTYPE
    What will be the query to fetch the values from the ITEM_NAME node.
    Thanks & Regards

    A late answer but just to show that it can be done with XMLTable (the built-in Oracle function) when you expect to return multiple rows from one input.
    WITH XMLTable AS
    (SELECT XMLTYPE('<BILL>
       <BILL_NO>1000</BILL_NO>
       <SRNO>3456</SRNO>
       <BILL_DTL>
          <RECORD>
             <LINE_NO>1</LINE_NO>
             <ITEM_NAME>TOYOTA COROLLA</ITEM_NAME>
          </RECORD>
          <RECORD>
             <LINE_NO>2</LINE_NO>
             <ITEM_NAME>NISSAN CEDRIC</ITEM_NAME>
              </RECORD>
         </BILL_DTL>
    </BILL>') xml_data
       FROM dual
    SELECT item_name
      FROM XMLTable,
           XMLTable('/BILL/BILL_DTL/RECORD'
                    PASSING xml_data
                    COLUMNS
                       item_name  VARCHAR2(25) PATH 'ITEM_NAME'
    Returns
    ITEM_NAME
    TOYOTA COROLLA
    NISSAN CEDRIC

  • Single-valued or multi-valued?

    Please knidly help to explain, in which case the filed should be single-valued, or multi-valued?

    Hi Alfred
    Say you're storing employee information in MDM, and the employee data structure includes a "Country of Birth" field, and a "Nationality" field.
    You can only be born in 1 country, so this field would be single-valued.
    However, you can have multiple nationalities, so this field would be multi-valued.
    Similarly, an employee could have "Preferred language" and "Spoken languages" fields. The "Preferred language" field would be single valued, while the "Spoken languages" field would be multi-valued. Both fields will lookup to the same table (Languages).
    HTH
    Mark

  • Query Customer Exit - Multi Single Values

    Hi SDN,
    Is it possible to return multi-single values in a customer exit for a query variable or only a range?
    I have 2 characteristics (NUMC), an item ZITEM and a group ZGROUP.  An item can belong to many groups.
    ZITEM           ZGROUP
    1                     1
    1                     2
    2                     3
    4                     1
    I would like to create a variable in Query Designer for ZITEM that returns a list of single values for ZITEM (not a range).  For example, Group 1 should return items 1, 4.
    The relationship between ZITEM and ZGROUP is not defined in master data (compounding).  Currently, I have a DSO which has ZITEM and ZGROUP defined as a key.  I would like my query variable-customer exit to read the DSO and return a list of single values of ZITEM.
    I'm assuming making ZGROUP a compounding infoobject of ZITEM would solve the issue in query designer because I could restrict on ZGROUP.  I have not used this approach because it would require modifying standard extractors.
    Another option I explored was to create an Infoset between my InfoCube and the DSO which has ZITEM & ZGROUP.  Unfortunately my InfoCube has NonCulm. Key Figures and therefore cannot be used in an infoset.
    Does anyone know how to create a multi-single value customer exit or have any ideas on how to solve this problem?
    Thanks!

    I was able to create a customer exit which performed multi-single values.
    Psuedocode:
    1) Create Internal Table and populate it with DSO data for Group and Item
    2) In Customer Exit, loop through internal table for the group you want
    3) In loop, append l_s_range to e_t_range (this will add multi-single values)
    WHEN 'ZCX_FLWGRP60'.
        IF I_STEP = 2.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          "get multi single values for flow types
          LOOP AT l_t_flwgrp INTO l_s_flwgrp
            WHERE /BIC/ZFLW_TP_G = '60'.
            l_s_range-low = l_s_flwgrp-FS_FLW_TP.
            append l_s_range TO e_t_range.
          ENDLOOP.
        ENDIF.

  • How to hide a single value node hierarchy in the query designer

    Hi,
    I would like to perform a calculation  in the infocube. It concern  a count "Nb of different customers" with the following hierarchy : Country / region / City.
    This KF would be read at the same time by city, region and country, and  certain customers exist in 2 different region, and I have to count them only once by country.
    To do this, I added a new record (at the country level when loading infocube) to deduct a number of customers in doubloons.
    This line added contain only a country code and the number of cutomers in doubloons (- 23 when I have 23 cutomers in doublons) with revrese sign.
    Now, I would like to use this value (-23) to have a right Nb of different customers by country, without showing the not assigned line in the report hierarchy.
    How can I hide, in the query designer or the WAD, a single value node from hierarchy (NOT assigned) but take in account the value (-23) at the country level ?
    Is there another solution (more simple) to perform this in the infocube ?
    For information,
    1) The infocube is loaded once per month, and the KF (Nb of different customers" is also performed by month.
    2) I can't perform this in the report (performance problem with calculated KF).
    thx.

    Hi,
    the short answer is "you can't", the longer is: The ADF Faces tree component is stamped for better performance. This stamping means that nodes are not rendered as JSF objects but copies of an existing component (just with a changed value). For this reason the nodes don't issue their own query for data and thus cannot be refreshed individually
    Frank

  • Passing multiple single values from R/3 BAPI to BW Query in VC

    Hi Experts
    I have a VC model where I am calling an R/3 BAPI which is returning a table of customer accounts.  I'm trying to go directly from that BAPI to a BW Query and pass the table of accounts into the BW Query.
    The BW Query has been set up with a variable to accept multiple single values for accounts, and I have mapped the correct output field from the BAPI to the correct input field on the Query.
    The BAPI does not seem to be passing the table of accounts into the Query.   If I hard code a single account in the mapping of the BAPI to Query call, the Query successfully returns the data I expect.
    Can I pass a table of accounts to a BW Query in this way?
    Many Thanks
    Tom

    Hi
    Have you tried with 'Group & Combine' operator. Just add this operator & join your BAPI & BI Query to this. Then in ths configure of this oparator select the 'Accoount' field & gourp the data accordingly. Also specify the aggregation if required. & in the table/chart after the operator select the fields which you want to show.
    I hope this is what you are looking for.
    Regards
    Sandeep

  • Weird ORA-01406: fetched column value was truncated error for SELECT query

    DB version:10gR2
    When one of our application fires the below query, we get
    ORA-01406: fetched column value was truncatederror.
    select     trk_dtl,
         trk_type,
         trk_id,
         trk_desc,
    from     shp_dtl
    where     shp_type = 'HN'
    and     shp_type = 828;The documentation says
    Cause:In a host language program, a FETCH operation was forced to truncate a character string. The program buffer area for this column was not large enough to contain the entire string. The cursor return code from the fetch was +3.But when the application is pointed to an identical schema in the same instance, we don't get this error. So, this has got nothing to do client application as the documentation says.
    Any idea what other possibilities are there?

    Post description of shp_dtl.

Maybe you are looking for

  • Performance Issues with Photoshop CS6 64-Bit

    Hello - Issue at hand: over the course of the last few weeks, I have noticed significant issues with performance since the last update to PS CS6 via the Adobe Application Manager, ranging from unexpected shut downs to bringing my workstation to a cra

  • Can I authorize Logic Pro on both my Laptop and Desktop Mac

    I use my Macbook Pro for mobile recording using Logic Pro and I was wondering if I can authorize my Mac Pro desktop to use Logic Pro too? I purchased Logic Pro from the iTune store, so I don't have disks to install from.  Using the Desktop at my home

  • Command + 1-4 not working for photo rating in iPhoto

    I am trying to rate photos in iPhoto with the Command + 0, 1, 2, 3, 4 and 5 keyboard shortcuts. Command+0 and +5 (for no stars and five stars) work fine. Command+1-4 does not do anything, however. I am wondering whether it is some overlap with OS X L

  • SSL over plain TCP/IP

    I am trying to write a client server app and i want my calls to be encrypted via SSL. I am using IBM JDK as my runtime is WebSphere.      //For JSSEPrvider2 use:com.ibm.net.ssl.www2.protocol      //For JSSE Provider use: com.ibm.net.ssl.internal.www.

  • Sales deal condition records creation

    I want create condition records in existing Sales deal.  I am getting data in the file format from other system. BAPI_PRICES_CONDITIONS is giving some problems and also it is not released, so we have thought not to use it. Can you please suggest any