Addition of Key Figures in Query Produces incorrect Results

Hi,
I have a query with a globally defined structure of Restricted Key Figures. These are mainly G/L Account Balances from R/3.
When I create a global Calculated Key Figure the sum is incorrect (ie does not match R/3) despite the fact that the individual restricted key figures match perfectly.
The only inconsistency is one or 2 of the RKF's are + ve in R/3 but - ve in BW.
Would really appreciate some help on this.
Thanks a lot.

Hi All,
Thanks for your replies.
Paul B - I tried your recommendation and it did not work. I only set the result to summation nothing else.
Bjorn - I tried what you said but that didnt work either.
Venkat - I thought about this but I have about 30 + Calculated Key Figs and over 100 Restricted Kfs and a fair amount have -ve signs. Do I have to do this for all ?
Regards

Similar Messages

  • Query Producing Incorrect Results

    Hello:
    I am trying to perform a number of queries on a database and
    although I am not receiving an error message; I know that the
    returned results are incorrect.
    For example, in my test data; I have only 1 record that
    matches the SchoolBoardID (Therefore the record could only have one
    grade, one gender, etc. yet my queries are returning results for
    both genders (Male and Female) and multiple grades (11 and 12) when
    the record in question actually has a grade 9 assignment.
    I have looked at my code over and over and I cannot find
    where the problem is; does anyone see anything that jumps out at
    them?
    I am using an MS-Access database and I have the following
    data types for the relevant fields in question.
    Field Name = SchoolBoardID - Numeric - Sample Data - 74
    Field Name = StudentTraineeGender - Data Type = Text - Sample
    Data - Either Male or Female
    Field Name = StudentTraineeGrade - Data Type = Text - Data
    Contains the following (9, 10, 11, 12, 12+ Hence the reason for
    having to use a Text data type)
    Field Name = SchoolYear - Data Type = Text - Sample Data -
    2006-2007
    Field Name = TradeCode - Data Type = Text - Sample Data -
    444A
    Field Name = TeacherWEAApproval - Data Type = Yes/No - Sample
    Data - 1 or 0
    <!--- Query The Database to find all Grade 11 Males Who
    Are Taking an Apprenticeable Trade --->
    <cfquery name="GetGrade11Males"
    datasource="MyDataSource">
    Select SchoolBoardID, StudentTraineeGender,
    StudentTraineeGrade, SchoolYear, TradeCode, TeacherWEAApproval From
    WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And StudentTraineeGender = 'Male'
    And StudentTraineeGrade = '11'
    And TradeCode <> '0000'
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfGrade11Males =
    #GetGrade11Males.RecordCount#>
    <!--- End Of The Query to find all Grade 11 Males Who Are
    Taking an Apprenticeable Trade --->
    <!--- Query The Database to find all Grade 12 Males Who
    Are Taking an Apprenticeable Trade --->
    <cfquery name="GetGrade12Males"
    datasource="MyDataSource">
    Select SchoolBoardID, StudentTraineeGender,
    StudentTraineeGrade, SchoolYear, TradeCode, TeacherWEAApproval From
    WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And StudentTraineeGender = 'Male'
    And StudentTraineeGrade = '12' Or StudentTraineeGrade =
    '12+'
    And TradeCode <> '0000'
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfGrade12Males =
    #GetGrade12Males.RecordCount#>
    <!--- End Of The Query to find all Grade 12 Males Who Are
    Taking an Apprenticeable Trade --->
    <!--- Query The Database to find all Grade 11 Females Who
    Are Taking an Apprenticeable Trade --->
    <cfquery name="GetGrade11Females"
    datasource="MyDataSource">
    Select SchoolBoardID, StudentTraineeGender,
    StudentTraineeGrade, SchoolYear, TradeCode, TeacherWEAApproval From
    WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And StudentTraineeGender = 'Female'
    And StudentTraineeGrade = '11'
    And TradeCode <> '0000'
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfGrade11Females =
    #GetGrade11Females.RecordCount#>
    <!--- End Of The Query to find all Grade 11 Females Who
    Are Taking an Apprenticeable Trade --->
    <!--- Query The Database to find all Grade 12 Females Who
    Are Taking an Apprenticeable Trade --->
    <cfquery name="GetGrade12Females"
    datasource="MyDataSource">
    Select SchoolBoardID, StudentTraineeGender,
    StudentTraineeGrade, SchoolYear, TradeCode, TeacherWEAApproval From
    WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And StudentTraineeGender = 'Female'
    And StudentTraineeGrade = '12' Or StudentTraineeGrade =
    '12+'
    And TradeCode <> '0000'
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfGrade12Females =
    #GetGrade12Females.RecordCount#>
    <!--- End Of The Query to find all Grade 12 Females Who
    Are Taking an Apprenticeable Trade --->
    <!--- Query To Find The Total Number Of Male Students
    Registered As Apprentices --->
    <cfquery name="GetMaleRegisteredApprentices"
    datasource="MyDataSource">
    <!--- End Of Query To Find The Total Number Of Male
    Students Registered As Apprentices --->
    Select SchoolBoardID, SchoolYear, StudentTraineeGender,
    TradeCode, RequestForMTCUByTeacher, ApprovedForMTCUByOYAP,
    TeacherWEAApproval From WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And TradeCode <> '0000'
    And StudentTraineeGender = 'Male'
    And RequestForMTCUByTeacher = 1
    And ApprovedForMTCUByOYAP = 1
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfMaleRegisteredApprentices =
    #GetMaleRegisteredApprentices.RecordCount#>
    <!--- Query To Find The Total Number Of Female Students
    Registered As Apprentices --->
    <cfquery name="GetFemaleRegisteredApprentices"
    datasource="MyDataSource">
    <!--- End Of Query To Find The Total Number Of Female
    Students Registered As Apprentices --->
    Select SchoolBoardID, SchoolYear, StudentTraineeGender,
    TradeCode, RequestForMTCUByTeacher, ApprovedForMTCUByOYAP,
    TeacherWEAApproval From WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And TradeCode <> '0000'
    And StudentTraineeGender = 'Female'
    And RequestForMTCUByTeacher = 1
    And ApprovedForMTCUByOYAP = 1
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfFemaleRegisteredApprentices =
    #GetFemaleRegisteredApprentices.RecordCount#>
    <!--- Query To Find The Total Number Of Male Students
    Registered As Apprentices Graduated--->
    <cfquery name="GetMaleRegisteredApprenticesGraduated"
    datasource="MyDataSource">
    <!--- End Of Query To Find The Total Number Of Male
    Students Registered As Apprentices --->
    Select SchoolBoardID, SchoolYear, StudentTraineeGender,
    TradeCode, RequestForMTCUByTeacher, ApprovedForMTCUByOYAP,
    Graduated, TeacherWEAApproval From WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And TradeCode <> '0000'
    And StudentTraineeGender = 'Male'
    And RequestForMTCUByTeacher = 1
    And ApprovedForMTCUByOYAP = 1
    And Graduated = 1
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfMaleRegisteredApprenticesGraduated =
    #GetMaleRegisteredApprenticesGraduated.RecordCount#>
    <!--- Query To Find The Total Number Of Female Students
    Registered As Apprentices Graduated--->
    <cfquery name="GetFemaleRegisteredApprenticesGraduated"
    datasource="MyDataSource">
    <!--- End Of Query To Find The Total Number Of Male
    Students Registered As Apprentices --->
    Select SchoolBoardID, SchoolYear, StudentTraineeGender,
    TradeCode, RequestForMTCUByTeacher, ApprovedForMTCUByOYAP,
    Graduated, TeacherWEAApproval From WEA_Registrants
    Where SchoolBoardID = #Session.Auth.SchoolBoardID# And
    SchoolYear = '#Form.SchoolYear#'
    And TradeCode <> '0000'
    And StudentTraineeGender = 'Female'
    And RequestForMTCUByTeacher = 1
    And ApprovedForMTCUByOYAP = 1
    And Graduated = 1
    And TeacherWEAApproval = 1
    </cfquery>
    <cfset NumberOfFemaleRegisteredApprenticesGraduated =
    #GetFemaleRegisteredApprenticesGraduated.RecordCount#>
    Thank you for any assistance that you can lend me with
    resolving my query issues:
    Regards,
    Chizzy
    Cornwall, Ontario, Canada

    Hello:
    SchoolBoardID is unique in that there is only 1 record in the
    WEA_Registrants table containing it; however, it was my intention
    with my queries to have the potential for more that one query to
    have a positive recordcount. (i.e. It would be possible for
    #GetGrade11Males.RecordCount# and
    #NumberOfMaleRegisteredApprentices# and
    #NumberOfMaleRegisteredApprenticesGraduated# to all return positve
    record counts.
    quote:
    Sounds like there may be more to this issue than you are
    leading us to believe.
    To the best of my knowledge, I have presented
    all of the relevant information.
    I will look into the documentation on cfqueryparam.
    Thanks for your assistance.
    Regards,
    Chizzy

  • Building a new Cube Vs Restricted Key figure in Query - Performance issue

    Hi,
    I have a requirement to create  a OPEX restricted key figure in Query. The problem is that the key figure should be restricted to about 30 GL Accounts and almost 300 Cost centers.
    I do not know if this might cause performance issue in the query. At the moment, I am thinking of creating a new OPEX cube and load only those 30 GL Accounts, 300 cost  centers and Amount. and  include OPEX  in multiprovider in order to get OPEX
    amount in the report.
    whats the best solution - creating OPEX restricted key figure or OPEX cube ?
    thanks,
    Bhat

    I think you should go for cube as all the restrcited key figure are calculated at OLAP runtime so it will definitely affect the query performance.There are a lot of costcenter for which you have to restrict it so definitely during the runtime of query it will take a lot of time to fetch tha data from infoprovider.Its better that you create a cube with the restrictions and include it in MP.It will definitely save a lot of time during query execution
    Edited by: shyam agarwal on Feb 29, 2012 10:26 AM

  • Sort data by key figure in Query Designer

    Hi Gurus,
    Is it possible to sort a query according to a key figure from Query designer?
    Thanks

    Using condition TOP N is the solution

  • How to fill a Key figure at Query run time

    Hi All,
    I have a requirement where I have to fill a key figure while the query is running. This value is obtained by multiplying 2 attributes of a Material Master Data object.I  could have used Formula Variable but there are two problems -
    1. I have material in my info provider but not this Material Master Data object.
    2. For a particular material, there are multiple rows in the Master Data object. And I have to pick only one row by applying some condition on a field of the MD object.
    Please let me know if there is some way to implement this.

    Hello,
    You can obtain this using virtual KF. Create a KF and include in the cube on which report is built. Dont have any mapping/rule for the same.
    Now write ur code using SMOD and populate this KF during runtime.
    Regds,
    Shashank

  • How to copy restricted key figures in query designer ?

    hi,
    i have created a query in query designer (BI 7.0).
    How can i copy existing restricted key figures ? i can't find anything. i always have to create a new one, and then i have to do all the things like 'details of selection' etc.... manually. that CANNOT be, there MUST be a way to copy those key figures.
    any ideas ?
    best regards, Martin

    Hi Martin,
    Restricted key figures can be stored on the infoprovider basis . For which right click on the key figure (left hand side pane ), Select the necessary key figure and assign the restriction through characteristics combination, and give it a restriction and save it . Next tiem when you create query on the same info provider it should appear in the left hand side as readymade reusable piece .
    Hope that helps.
    Regards
    Mr Kapadia

  • How to search for Key Figures in Query Designer 7.0?

    Hi,
    in BEx Query Designer 3.5 there was a search function to look after key figures or characteristics. Is there a search function in Query Designer 7.0?
    Thanks.

    Hi,
    QD 3.x version has "Find" option to identify the KF and Characteristics,but the same is not available with QD 7.x.
    Reason could be:
    With QD 7.x,just by typing the starting letters of KF or Characteristics by Keyboard itself,it will highlight you the entries.Hence there is no explicit Find option provided.But in case of QD 3.x,they gave it explicitely.
    Rgds,
    Murali

  • Calculated Key Figures in Query Designer - translation

    Hello Experts,
    I created  a few Caclulated Key Figure in the Query Designer. They have a GUID and a text description.
    I would like to know:
    1) How these CKF are represented in ABAP on the system and where I can find them - some database table  ?
    2) If I want the description to be available in many languages how can I handle this ?
    Thanks a lot
    Rado

    Check this
    Tables analysed by analyze_rsz_tables
    Khaja

  • InfoSet - Calculated Key figures in query

    Hi
    I created an InfoSet  from two cubes, and a query to report from the InfoSet , I noticed that the query displays the keyfigures twice, e.g., I have gross sales in both cubes so it appears on the left side of query designer twice. When I created the InfoSet  I turned off these key figures but they still appear on the left side of the query and doubled.
    Any suggestion?

    This might be b'coz you didn't select which infoprovider the Key figures should be picked from.
    Hence it's select both the infoprovider and displaying the values twice.
    Regards,
    Hima

  • Restricted/Calculated Key Figures in Query vs MDX?

    Hello All,
    We are embarking on our first project utilizing SAP BW as the Data Warehouse and Web Intelligence as the presentation tool.
    We plan on creating the universes on BW Queries.
    What are the pros and cons of using Restricted and Calculated Key Figures in the query versus creating them in the Universe?  Also from a performance impact point of view if there is any?
    Best Regards,
    Dan Krieg

    Hi Dan,
    I would suppose that there is no big influence on performance. If the calculation for the calculated key figures are very complex I would propose to calculate them on query level. So its easier to use them also in other environments.
    Please take into consideration that OLAP universes are not supported in Crystal Reports. More information you find in the thread [OLAP universes and Crystal Reports|OLAP universes and Crystal Reports;.
    Regards,
    Sebastian

  • Currency translation for a restricted key figure in Query designer

    Dear Experts,
    In my query i am using a restricted Keyfigure (ZRKF1 which is reusable). I have to change the currency translation key of the restricted Key Figure  from zcur1 to zcur2. I am not able to edit zrkf1 Currency translation in the properties( It is in gray colour) ,while i can do it for a normal keyfigure.  if i edit zrkf1 then other queries will be affected. How should i solve this? Can i copy and paste the zrkf1 to zrkf2 in order to use zrkf2 with currency translation zcur2 in my query ? How can i coy and paste restricted key figure?
    Thanks,
    Riya

    Hello Riya
    I think you can't change the currency transaltion type for RKF... to change it in RKF just make the changes in the KF which you have used in RKF....
    If you don't want to change the CURR translation type in KF1 than copy it paste it (KF2)and change in that KF2...now u can use KF2 in restricted KF...
    Thanks
    Tripple k

  • Restricted Key Figure in Query Designer

    Hi,
    I have defined a Input-Variable on the Characteristic 0PURCH_ORG (Purchasing Org.) in the Query Designer.
    This Variable is Mandator and represents "Selection Option". Means, the user has to give the Input-Varaible for ex. 0010...0011.
    Now my requirement is to define a restriced key figure where these Purchasing Org. from Input-Variable must exclude
    in the restriced key figure. I cannot exclude the Input-Varaible in restriced Key Figure as it represents "Selection Option".
    I tried to define a Customer-Exit Variable (Selection Option) on the Characteristic 0PURCH_ORG which should exclude the Input-Variable.
    But the ABAP-Code for Customer-Exit Variable doesn't work.
    Any clue, how I can solve this problem?
    Thanks

    Hi Moha Nan,
    A variable of the type selection option can not be excluded therefore a variable exit is your only option. What is the current ABAP you have written and why doesn't it work? Maybe we can find the issue with the coding.
    You need one variable of the type selection option and another one to read the first variable and reverse the option sign (from include to exclude).
    Regards,
    Alex.

  • Creating a resticted Key Figure in Query Designer (3.5)

    Hello, hope your all well!
    I'm trying to create a restricted key figure that's related to the publication date of one of our titles.
    I've tried to create a Structure that shows one text result if the publication date is the same or greater than 01.01.2008 and another if it's less. However, in my results it seems to be bringing two results for each line, one with each text result.
    Could anyone point my in the right direction?
    Have a fantastic weekend,
    Rhys

    Sorry, I'm new at this; what do you mean by inputs?
    I'm trying to create something in the query designer that displays one text result if the result is lower than a certain number and another if higher,
    Hope that makes sense.
    Take care!
    Rhys

  • Number of key figures per query

    Hi guys
    I have a cube with over 150 key figures.
    In query designer I can see only the first 150.
    Does anyone know where to change this limitation?
    Regards
    Shlomi

    Hi Thejo,
    There is no direct way to do this using another BW query simply because the data is not stored in either Masterdata Info Objects/CUBE ODS. They are stored in BW system tables which are not directly accesible by any queries to build using the Query Builder.
    Try to locate the system table that holds these Info (Keyfigures + Query Name) and do ABAP Query instead.
    Regards,
    Jkyle

  • Aggregation ---Settings of KF(Key Figure) in Query Designer

    Hi,
       What is the impact of the following setting in the query result
    Query Designer>KF Definition>Edit-->Aggregation (TAB)
    Exception Aggregation-->MAximum and
    Ref Characterstic
    Thanks

    Hi,
    To enable the calculation of key figures, the data from the InfoProvider has to be aggregated to the detail level of the query and formulas may also need to be calculated. The system has to aggregate using multiple characteristics. In regard to a selected characteristic, the system can aggregate with another rule for each key figure (exception aggregation).
    http://help.sap.com/saphelp_nw04s/helpdata/en/75/21054da1392649948e5b94e4fc4bce/frameset.htm
    Exception aggregation ?
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/53717c223a1bcde10000000a1553f7/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/47/4d6d902dbb22c5e10000000a42189d/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/47/5dfdca3ea9427fe10000000a42189d/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/d2/e0173f5ff48443e10000000a114084/frameset.htm
    Rgs,
    I.R.K

Maybe you are looking for

  • Why don't I have my App Store apps after upgrading to iOS5?

    I just upgraded my iphone to iOS5. Before upgrading I created a backup in iTunes. After upgrading I restored from backup. All of the apps I downloaded/purchased from the App store are now missing on my iPhone Only the core apps that come preinstalled

  • Is there a limitation on the no. of digits for constant function

    hi I want to compare a value of a certain field with a Constant with 89999999999 and pass the value only if it is  less than this . I am using the less standard function and comparing the value .If it less than that only then I can pass the value how

  • Android email app formatting errors

    Some emails viewed by the standard Android email app don't format corrrectly.  However the formatting is correct if I use the Gmail app instead. Below are two screenshots of the same email. The first using the standard email app has errors - some HTM

  • Canvas/Undecorated JFrame Trouble

    TIA for any light on the following thing. I'm trying to add a java.awt.Canvas to the Center of a JPanel which is in turn in the Center of the JFrame. When the JGrame uses the default decorations (setUndecorated(false)), everything works OK, including

  • FaceTime Activation Could not sign in

    Hi, i bought ipod touch 4g for facetime. and i can't activate it! it stops on ipod>settings>Facetime='FaceTime Activation, Could not sign in. Please Check your network connection and try again.' i have used all the solutions for facetime but all in v