Cumulated amounts in the Query

Hi Sap Developers,
I need some hints to create a query. I haven't found any solutions until now.
I've got an infocube with amounts grouped by day, which are gonna be displayed in the query using the cumulated format as follows:
1/jan           2/jan              3/jan              4/jan     
Cube  Cumulated      Cube  Cumulated         Cube  Cumulated         Cube  Cumulated
10      10                      11      21                         12      33         13      46
The cumulative period starts on the first day of the month. Only the cumulated values above will be displayed in the query.
When the user selects 3/Jan - 4/Jan, for example, the query should display only the two columns related to these days, regarding that the cumulated amount of 3/Jan and 4/Jan has to be 33 and 46 respectively.
Through Bex, I have to select the whole month to get the expected result. If I input 3/Jan - 4/Jan, for example, the query shows 12 and 25, that is, it starts the cumulative period on the first day displayed in the query.
I've created a customer exit variable tied to a restricted key figure in order to get the cumulated amount from the first day of the month until the day before the date entered by the user. It's worked as far the amounts is concerned, but all the columns are displayed.
I've tried others alternatives, but without success.
Before modifying the infocube structure, I would like to confirm with you if there is any solution for this scenario. Suggestions are welcome.
Regards,
Tiago

Hi SDBI,
Thanks for your reply.
The problem was finally solved.
We used a customer exit variable (CEV1) to the 0CALDAY, as you suggested, with the period from the first day of the month to the initial date defined by the user entry minus one. We created a RKF1 to cumulate the amounts of this period by linking CEV1 to it and setting 0CALDAY as "Constant Selection". Thus all the values related to this period were correctly cumulated into a single column.
After that we needed to establish a way to cumulate the amounts properly along the columns. The following procedure worked fine:
RKF2 was created to get the amounts related to the period entered by the user.
CEV2 was created to get only the initial date defined by the user.
Then we created a formula with 0CALDAY replacement path varible and establish the following logic: if 0CALDAY RPV == CEV2 then formula = RKF1 + RKF2 else formula = RKF2.
Regards,
Tiago

Similar Messages

  • Cumulative amount in the same line item for the same account

    Hi
    I have an account which appears more than once in the same accounting document.Can I cumulate the amount in the same line item.
    IF it's possible, please how can i do it.
    Thanks in advance

    Hi Maher,
    Assumption:
    You have an accounting document in which more than one line item is there with the different amount. All the other details of the line items are same.
    Solution:
    If you want to make it one line item, key the amounts as zero in other line items and add the value to a single line item.
    Warm regards,
    Murukan Arunachalam

  • Query to get the po amount from the pr

    Hi
    how to get the POnumber and PO amount from the Pr number. there are hundred's of PO's raise against the PR's
    and want to know the amount from their PO's to know the avaible fund left with the department.
    Regards
    Arifuddin

    Hi Madhan,
    If you talking abt query to find the total sal of each employee i.e., SAL + CUMSAL then you can use the below query:
    select a.empno,a.ename,a.sal + b.cumsal totalsal from
    emp a, emp b
    where a.empno = b.empno;
    Regards,
    Murali Mohan

  • Retreiving the last amount billed to a customer (dynamically in the Query)

    Hi,
    I want to retrieve the last amount billed to a customer.
    For example :
    r/3 data :
    Customer____Billing date__Amount
    1___________04/04/2006____5000
    1___________05/05/2006____1200
    2___________03/04/2006____400
    The result i would like to get in the report :
    Customer___Amount
    1__________1200
    2___________400
    I tried many ways including Key figures agreg. Exception.
    Do you have any suggestion ?
    best regards,
    ludo
    Message was edited by: Ludovic Julen
    Message was edited by: Ludovic Julen

    Hi,
    The date of the data loading has no impact on the selection of the last value. In december, you can load the historical data of 2005, 2004 and 2003. The data will be stamped on 2005, 2004 or 2003 (dates of reference from the documents).
    So, in your case, the query would give you the first load as a result of the last value. But you are using 0CALDAY in your example. Of course, you would not be able to use 0CALMONTH in such scenario, because you do not bill only once a month.
    Now, please notice that the last value is based as well on the execution of the query. Is your query analyzing all december? Imagine that your query is filtered from 01.12.2006 to 14.12.2006, then you get only the second load.
    This is a double setting.
    Regards
    Laurent

  • Sum of amount field in the Query

    Hello folks,
    I have a amount field in the query, along with the amount field I also need to show sum of all the rows for this amount fields, can some one guide which is best way of doing it?
    Thanks,
    KK

    Thanks for the response's...Rama, Prasad and Sandesh!
    I have changed the Property of the Amount field (SAP Standard Infoobject) to Calculated Result as 'Summation' but when I tried to save the changes in Query designer I am getting following error
    runtime error '91'
    Object variable or with block variable not set
    runtime error '4XX'
    ActiveX component can't create object
    And its disconnecting from BEX Server...how can I resolve this error?
    Thanks,
    KK
    Edited by: kumar K on Aug 21, 2008 10:46 AM

  • How to compare two amount colomns in the query ?

    Hi,
    I need to compare two amount colomns in the query and based on that i need to change the color of the colomn
    Is it possible by using exceptions.if yes please tell me how to do it.
    Regards
    Ansari

    Hi,
    you can give this a try:
    1) Create a formula keyfigure (Keyfigure A> Keyfigure B)* 1+(Keyfigure A< Keyfigure B)* 0, so here you get value as either 0 or 1,
    2) Hide this Formula Keygiure for display in the report, and create a exception on this Formula keyfigure for its value 0 or 1 with the desired colors.
    3) While defining the exception on the 3rd tab we get the option to specify the Columns for implication of this exception, their you can specify the desired 2 Keyfigures to be highlighted with the colors.
    Hope this helps ..
    Regards,
    Umesh.

  • What is the query for Accounts Payable Trial Balance (APXTRBAL) in 11.5.10?

    Hi Guys,
    What is the query for Accounts Payable Trial Balance (APXTRBAL) in 11.5.10?
    I have to write an AP Invoice Aging Report in Discoverer to show all unpaid invoices that have been transferred into GL... Business wants it to match one-to-one with the AP Trial Balance standard report...
    Business wants to run the report for any date in a past...
    The report has two parameters:
    As Of Date - the same as As of Date for the AP Trial Report
    Trial Balance Run Date - the date when Trial Balance was run...
    Conditions are:
    TRUNC(Invoice Date) <=TRUNC(NVL(TO_DATE(:As Of Date),SYSDATE))
    TRUNC(NVL(Payment Date,'01-JAN-5000')) > TRUNC(NVL(TO_DATE(:As Of Date),SYSDATE))
    TRUNC(Invoice Creation Date) <= TRUNC(NVL(TO_DATE(:Trial Balance Run Date),SYSDATE))
    Distr Accounting Date <= TRUNC(NVL(TO_DATE(:As Of Date),SYSDATE))
    NVL(Distr Creation Date,Invoice Creation Date) <= TRUNC(NVL(TO_DATE(:Trial Balance Run Date),SYSDATE))
    Show_Flag = 'YES', where:
    Show_Flag = CASE WHEN ( NVL(Cancelled Date,'01-JAN-1901') > NVL(:As Of Date,SYSDATE) AND NVL(Inv Amount Aud,0) = 0 ) THEN 'YES' ELSE ( CASE WHEN NVL(Inv Amount Aud,0) = 0 THEN 'NO' ELSE 'YES' END ) END
    There is a difference between the logic of my report, and the logic of AP Trial Balance...
    Could you please advise what I'm missing?
    Thanks,
    Iana

    What is the query for Accounts Payable Trial Balance (APXTRBAL) in 11.5.10? You can get the code by opening the report in Reports Builder and get the query.
    Or, enable trace/debug as per (FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12 [ID 296559.1]).
    Thanks,
    Hussein

  • SQL 2012 SP1 - How to determine a query that causes Error 8623 in SQL Log: The query processor ran out of internal resources and could not produce a query plan. This is a rare event...

    We are getting multiple 8623 Errors in SQL Log while running Vendor's software.
    How can you catch which Query causes the error?
    I tried to catch it using SQL Profiler Trace but it doesn't show which Query/Sp is the one causing an error. 
    I also tried to use Extended Event session to catch it, but it doesn't create any output either.
    Error:
    The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that
    reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.
    Extended Event Session that I used;
    CREATE EVENT SESSION
        overly_complex_queries
    ON SERVER
    ADD EVENT sqlserver.error_reported
        ACTION (sqlserver.sql_text, sqlserver.tsql_stack, sqlserver.database_id, sqlserver.username)
        WHERE ([severity] = 16
    AND [error_number] = 8623)
    ADD TARGET package0.asynchronous_file_target
    (SET filename = 'E:\SQLServer2012\MSSQL11.MSSQLSERVER\MSSQL\Log\XE\overly_complex_queries.xel' ,
        metadatafile = 'E:\SQLServer2012\MSSQL11.MSSQLSERVER\MSSQL\Log\XE\overly_complex_queries.xem',
        max_file_size = 10,
        max_rollover_files = 5)
    WITH (MAX_DISPATCH_LATENCY = 5SECONDS)
    GO
    -- Start the session
    ALTER EVENT SESSION overly_complex_queries
        ON SERVER STATE = START
    GO
    It creates only .xel file, but not .xem
    Any help/advice is greatly appreciated

    Hi VK_DBA,
    According to your error message, about which query statement may fail with error message 8623, as other post, you can use trace flag 4102 & 4118 for overcoming this error. Another way is looking for queries with very long IN lists, a large number of
    UNIONs, or a large number of nested sub-queries. These are the most common causes of this particular error message.
    The error 8623 occurs when attempting to select records through a query with a large number of entries in the "IN" clause (> 10,000). For avoiding this error, I suggest that you could apply the latest Cumulative Updates media for SQL Server 2012 Service
    Pack 1, then simplify the query. You may try divide and conquer approach to get part of the query working (as temp table) and then add extra joins / conditions. Or You could try to run the query using the hint option (force order), option (hash join), option
    (merge join) with a plan guide.
    For more information about error 8623, you can review the following article.
    http://blogs.technet.com/b/mdegre/archive/2012/03/13/8623-the-query-processor-ran-out-of-internal-resources-and-could-not-produce-a-query-plan.aspx
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • SSRS 2008 R2 is extremely slow. The query runs in less than a second in the dataset designer but if you try to view the report it takes over 10 minutes. I have read this is a bug in SSRS 2008 R2. We installed the most recent patches and service packs.

    SSRS 2008 R2 is extremely slow.  The query runs in less than a second in the dataset designer but if you try to view the report it takes over 10 minutes.  I have read this is a bug in SSRS 2008 R2.  We installed the most recent patches and
    service packs.  Nothing we've done so far has fixed it and I see that I'm not the only person with this problem.  However I don't see any answers either.

    Hi Kim Sharp,
    According to your description that when you view the report it is extremely slow in SSRS 2008 R2 but it is very fast when execute the query in dataset designer, right?
    I have tested on my local environment and can‘t reproduce the issue. Obviously, it is the performance issue, rendering performance can be affected by a combination of factors that include hardware, number of concurrent users accessing reports, the amount
    of data in a report, design of the report, and output format. If you have parameters in your report which contains many values in the list, the bad performance as you mentioned is an known issue on 2008 R2 and already have the hotfix:
    http://support.microsoft.com/kb/2276203
    Any issue after applying the update, I recommend you that submit a feedback at https://connect.microsoft.com/SQLServer/ 
    If you don’t have, you can do some action to improve the performance when designing the report. Because how you create and update reports affects how fast the report renders.
    Actually, the Report Server ExecutionLog2  view contains reports performance data. You could make use of below query to see where the report processing time is being spent:
    After you determine whether the delay time is in data retrieval, report processing, or report rendering:
    use ReportServer
    SELECT TOP 10 ReportPath,parameters,
    TimeDataRetrieval + TimeProcessing + TimeRendering as [total time],
    TimeDataRetrieval, TimeProcessing, TimeRendering,
    ByteCount, [RowCount],Source, AdditionalInfo
    FROM ExecutionLog2
    ORDER BY Timestart DESC
    Use below methods to help troubleshoot issues according to the above query result :
    Troubleshooting Reports: Report Performance
    Besides this, you could also follow these articles for more information about this issue:
    Report Server Catalog Best Practices
    Performance, Snapshots, Caching (Reporting Services)
    Similar thread for your reference:
    SSRS slow
    Any problem, please feel free to ask
    Regards
    Vicky Liu

  • Error while executing the query

    Hi all,
    I am facing two errors while executing my query namely
    1)The validity interval has initial value as lower limit.
    2)Diagnosis
    Query  uses non-cumulative key figures. It requires calculation for non-cumulative values for more than 2000 periods in time. The most common reason for this is that the non-cumulative InfoCube has a very large validity interval and the query has no time restrictions. With exception aggregation AVERAGE (AV1 or AV2) in particular, this lack of time restriction would result in considerable memory and performance problems.
    System Response
    Query  cannot be executed in this way.
    Please suggest a possible reason for these errors.
    Thanks and Regards.
    Mudit Khanna

    Hi,
    See
    Refer Notes 496638,571364
    210432
    528202
    1318741
    208546
    and also see simila thread
    Problem getting data from BF cube in report (Non cummulative keyfigures)
    Thanks
    Reddy

  • Need to display a percentage sign '%' in the query field

    hi all
    I know that this might be very simple..
    but it has bugged me for a while now..
    i need to display ''%" in a particular field alongwith the number in the query for
    1. when field is having a percentage calc of two KF.
    2. when field is a mixed containing amount type KF & i need to display it only for certain records not all .
    Please help me.
    best regards,
    ramesh

    1 - if you are using a percentage function in a CKF/Formula, it should by default come with a % sign in your report.
    2 - You can't mix and match (have '%' only for some rows) unless you want to use some vb macro or table interface class to do it.
    For any number that is a percentage but doesn't appear with %, you can always create another CKF ( = 100 % ckf_minus_perc ), or a variant of it and that should get you the same value with a % sign.

  • ERROR displaying in the query output... urgetn

    hi experts,
    For the amount keyfigures in the query output it displaying ERROR after the amount like ex- 2000 ERROR.
    plz let me know how to rectify this..
    regards
    vadlamudi

    hi,
    i have created only two keyfigures EMP_BASIC and EMP_HRA. and in the transformations i have mapped with 0DOC_CURRCY.
    but in the report its showing ERROR only after the amount. plz tell me exactly with what field i need to map???
    regards
    vadlamudi

  • "None of the fact tables are compatible with the query request"

    Hi guys,
    I have a weird issue. Previously fine working Subject area started to give this error after migration. The issue is happening when I select a column from dimension and try to display it. Also, I can't get to the list of values in filter I get "Error retrieving choices" error. One dimension is working fine though, and when a column from it is selected, it displays other column just fine. I checked physical layer, primary keys, mappings in the BMM, LTS sources, Connection Pool settings. Everything looks legit. For few hours it was working fine, and now it's giving this issue. Anyone knows what the cause could be. The search I've conducted revealed that this is a data mapping issue - however, all my layers seem to be in check. Thanks

    hi user582149,
    It is difficult to answer you question with such a little amount of details. Could you specify:
    - how many facts/dimensions are you using in the query?
    - what is the structure of your Business Model?
    - which version of OBI are you using?
    - what does your log say?
    I hope to tell you more having the information above
    Cheers

  • None of the dimension tables are compatible with the query request

    Hi,
    i am experiencing the below error while querying columns alone from employee dimension (w_employee_d) in workforce profile SA. There is only one column in my report which is employee number coming from employee dimension. when i query other information like job, region, location etc i am not getting any error. the below error appears only when querying columns from employee dimension. the content tab level for the LTS of employee dimension is set to employee detail.
         View Display Error
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 14077] None of the dimension tables are compatible with the query request Dim - Employee.Employee Number. (HY000)
    SQL Issued: SELECT 0 s_0, "Human Resources - Workforce Profile"."Employee Attributes"."Employee Number" s_1 FROM "Human Resources - Workforce Profile" FETCH FIRST 65001 ROWS ONLY.
    couldn't able to know the exact reason. Any suggestions would be highly appreciated.
    Regards.

    hi user582149,
    It is difficult to answer you question with such a little amount of details. Could you specify:
    - how many facts/dimensions are you using in the query?
    - what is the structure of your Business Model?
    - which version of OBI are you using?
    - what does your log say?
    I hope to tell you more having the information above
    Cheers

  • To download the query output to falt file

    Hi all,
    i have a query which i know will give more than 65k records as the output for a selection.
    i cannot run this query in excel due to its limitation.
    if i run on web i cannot download this as downloading is happening to excel file only.
    The customer ideally wants to download the query result to a text file(csv,tab-delimited etc) which inturn it will upload to MS-Access.
    How do i achieve this?
    SAP has given response use try using these options:
    1.open interfaces to receive the output of a query via the MDX language.
    2.open hub tool as it is designed for big amounts of data.(i suppose this is not possible as i want to download query output not the data target contents)
    how do i achieve my scenario with option 1?
    Are there any alternatives??
    Any useful help will be rewarded.
    Regards,
    Dhanya.

    hi vivek,
    thnks for the useful reply.
    i have some problem with my ID,hence loggin in through my coleague's ID.
    i will assign u points as i get logged in.
    I did as u said by downloading it to unconverted format.
    the file got download to a text file.where the output has
    1.header rows(10 lines almost)
    2.the values r coming in single quotes e,g:
    '144000023073      'TAAS SETTLEMENT CONV 738 '19333000   '30.09.2006          '0.000
    how can i remove all this?
    Regards,
    Dhanya
    I

Maybe you are looking for