Totals are giving wrong on Query

Hi All,
I need help on this query.  When I run this query , my totals for 2 highlighted columns are
196,239,847.80(Correct), 72,422,114.24(This total is Wrong).
If I run the scripts separately my numbers are
196,239,847.80(Correct), 55,009,193.94 (Correct)
Something I am missing in the query. Any Help Appreciated.
SELECT A.ServiceName,A.ServiceGroup,A.VoucherAmt,A.VoucherIssued,A.Voucher_Issue_Date,
 A.VoucherCancelled,isnull(B.RedeemedCount,0) as RedeemedCount,isnull(Sum(B.Amountredeem),0)
as AmountRedeem,
 A.Voucher_ID,A.Grant_ID,A.Client_ID,A.AssessmentId FROM
 (SELECT Voucher_ID,Client_ID,Grant_ID,Sum(VoucherAmount) as VoucherAmt,Sum(VoucherCount)VoucherIssued,Voucher_Issue_Date,Sum(CancelledVoucher)VoucherCancelled
 ,ServiceName,ServiceGroup,AssessmentId from rpt.vwATRVoucherCount01
Group BY ServiceGroup,ServiceName,Voucher_ID,Voucher_Issue_Date,Client_ID, Grant_ID,AssessmentId
) A
LEFT JOIN
(SELECT Voucher_ID,Client_ID,Grant_ID,sum(AmountRedeem) Amountredeem,sum(RedeemCount)RedeemedCount,ServiceName,ServiceGroup from rpt.[vwATRVoucherCount02]
Group by Servicename,Voucher_ID,ServiceGroup,client_ID,Grant_ID
)B
ON A.Voucher_ID=B.Voucher_ID
Group by A.ServiceName,A.ServiceGroup,A.Voucher_Issue_Date,A.Voucher_ID,A.Grant_ID,A.Client_ID,
   A.AssessmentId,A.VoucherAmt,A.VoucherIssued,A.VoucherCancelled,B.RedeemedCount

Its is very difficult for us to suggest with your problem statement. If you can show us simplified form of your table and data, we would be able to help you further.
Please mark this reply as answer if it solved your issue or vote as helpful if it helped.
 [Blog]

Similar Messages

  • Query giving wrong values in portal but correct through RSRT

    Hi,
    Users are running a query through portal which is giving wrong figures. But when we are running the query through RSRT it is showing correct values. The quesry is built on top of an InfoCube which is regularly updated and data in it is matching with R/3.
    This is an Inventory Valuation Query.
    Please suggest what could be the possible issue.
    BR,
    Sayan

    Hi,
    Make sure cache is deleted for the particular query. While the report is executed through portal it refers the cache and if the data in the backend is not changed then the cache for a particular query selection is active and referred each time the query is run.
    on other hand while running RSRT we have an option of not using cache and thus it refers the infoprovider and fetches the correct result. In this case cache could be invalid.
    Try deleting the cache.
    Regards,
    Amit

  • Variable input values in the query are displayed wrong

    Hi experts,
    I executed a report and in the variable input screen it asks for a key date and company code.
    We entered key date and company code and executed the report.
    We want to take a print out of the output. But the variables which we entered in the variable screens are
    dispalying wrong. i.e if we have entered company code as gsml and key date as 01.01.2008.
    In the report output I am getting as:
    Company code: gsml
    Keydate: #..27-11-4745
    But keydate should be displayed as 01.01.2008
    How to solve this ?
    Regards,
    Nishuv.

    Nishuv,
    Please follow below steps:
    1. Open query through Bex - Query Designer
    2. Beneath the Rows Area( where you actually  drag in charactertistics), you'll be finding two tabs Filter and Rows/Columns
    3. Click on Filter Tab
    4.You'll be navigated to a window, there you can trace two Workareas
            a. Characteristic Restrictions: Where drag in the relevant Prompts/Input Variables
            b. Default Vaules
    5.First, Drag the required promts/Input Variables in Characteristics Restrictions.
    6.Click on the varible which was dragged in Characteristic Restriction area and drop it into default values area.
    7.Now you'll have visibility of variable in two regions, Characteristics and Default Values.
    8. Save and Execute the Query
    Regards,
    Yaseen

  • Content Tab: None of the fact tables are compatible with the query request

    Hi All,
    **One thing I am not clear yet of all my years with OBIEE is working with the content tab in BMM.**
    I have made a rpd the joins in physical layer as shown below:
    https://picasaweb.google.com/114804305606242416264/OBIEEError#5663056545119428530
    And the BMM layer as:
    https://picasaweb.google.com/114804305606242416264/OBIEEError#5663056519553812930
    Error I am getting when i run a request from the 3 columns from the selected 3 tables is:
    Dim - Comment Code Details
    Fact - Complaint
    Dim - Service Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14020] None of the fact tables are compatible with the query request Sr Num:[DAggr(Fact - Complaint.Sr Num by [ Dim - Service Details.Sr Cat Type Cd, Dim - Comment Code Details.Cmtcode name] )]. (HY000).
    I get no error for consistency.. I read everywhere and I know i need to set the appropriate aggregation levels in the various dims and facts LTS properties to help OBIEE understanding our model, but how to do that.. how do i decide... how should I approach, what should be the aggregation level, what details.
    When i click More button i see different options: Copy, Copy From, Get Levels, Check Level, what do these mean.
    Aggregation Content, group by - Logical Level or Column which one should i choose and how should I decide.
    Can anyone explain the Content Tab in details and from scratch with some example and why we get these errors.... I know many people who are well versed with many other things related to RPD but this. A little efforts of explaining from you guys will really be appreciated.
    Thanks in advance,
    Dev

    Hi Deepak,
    Option 1:
    My tables in physical layer are joined as below:
    D1--> F1 <--D2--> F2 <--D3
    Same way i model it in BMM
    D1--> F1 <-- D2--> F2 <--D3
    Here D1 is non Conformed Dimension for F2 and D3 is non Conformed dim for F1. Later create Dimensional hierarchies, I tried setting up the content levels
    I go Sources>content tab of Fact F1 I set
    Dimensions----------- Logical level
    D1---------------------- D1 Detail
    D2---------------------- D2 Detail
    D3---------------------- D3 Total
    then, I go Sources>content tab of Fact F2 I set
    Dimensions----------- Logical level
    D1---------------------- D1 Total
    D2---------------------- D2 Detail
    D3---------------------- D3 Detail
    Then, I also go in all the dimensions and set their content levels to Details, but it still gives me errors not sure where I am going wrong in setting the content levels.
    I need to know whether the way I have modeled it in BMM is right,
    Option 2:
    I can combine the two facts in a single Logical Fact or the above design should also work.
    (F1&F2)<--D1, D2 , D3 joined separately using complex logical joins.
    what will be the content tab details?
    Thanks,
    Dev

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

    I've got a situation where I have two facts(Fact_1, Fact_2) and three dimensions(dim_1,dim_2,dim_3) in 1 subject area. I've got dimension hierarchies setup for all the dimension tables.
    Dim_1 is one to many to Fact_1
    Dim_2 is one to many to Fact_2
    Dim_3 is one to many to both Fact_1 and Fact_2
    I've set up the content levels for the LTS for the Facts so that they are the lowest grain for dimensions they join to and the grand total grain for dimensions they do not join to.
    My rpd is consistent. When I run a report using an attribute from Dim_3 and Dim_1 or Dim_3 and Dim_2, the report comes back fine.
    But if I try to run a report using all three Dim tables, I get an error and the message "None of the fact tables are compatible with the query request ".
    First of all, is it possible to make a report using all three dimensions?
    Second, what's the best way to trouble shoot this error? Why are none of the fact tables compatible? I thought as long as the aggregation levels were set to grand total for non-shared dimensions, Answers would be able to create the report properly.
    Any advise would be greatly appreciated.
    Thanks!
    -Joe

    OBIEE is looking for a fact that can link ALL the dimensions together. This is also known as the implicit fact ... you don't have a fact that can relate all the dimensions - you have 2 facts that together they can. Perhaps you need to great a single logical fact that has both LTS for your physical facts and try it that way.
    Then you'd have Dim1, Dim 2, Dim3 all being able to join to Fact1 (which is made of physical facts 1 & 2).

  • Could you help me with an app situation? We purchased several codes for Splashtop to install on our iPad 2's. It was working great but now that we upgraded the OS they have disappeared. The codes that we purchased are giving us an error that they have alr

    Could you help me with an app situation? We purchased several codes for Splashtop to install on our iPad 2's. It was working great but now that we upgraded the OS they have disappeared. The codes that we purchased are giving us an error that they have already been used. So far it has only been 2 iPads. 
    Any solutions?

    The compiler is highlighting the areas you got wrong, although the error messages are somewhat confusing.
    Error 1: NSLog is a function and needs to be called as such, see e.g. the circleArea call on the line above. Functions are called using the function-name with its arguments in paratheses e.g. foo(12, 13).
    Error 2: looks like a typo, defining a function is done as function-name(... <arguments> ...) { ... <body> ...}. In your code there is a ";" between the arguments and the body that should not be there, you probably copy pasted it from the forward declaration at the top of the source codde file.

  • I've just installed Mountain Lion 10.8.5, but now the CS programs are giving me a licensing error.

    I've just installed Mountain Lion 10.8.5, but now the CS4 and CS5 programs are giving me a licensing error. I've restarted. Uninstalled, reinstalled. And still, they don't work. I need to stay at 10.8.5 and not go to Maverick, per a client's needs at this time. Help!

    I've also tried this...that I found in another discussion...also did not work.
    Solution 1: Delete the FlexNet Publisher preferences folder
    -  Quit all Adobe applications.
    -  On your startup disk, locate and delete the following folder:
    [hard drive]/Library/Preferences/FlexNet Publisher/ 

  • Subreport totals are not displayed correctly in Preview

    I'm using Crystal Reports 2008.  I have a subreport that sorts hiearchically.  It is placed in the Report Header of the main report.  Within the subreport, it has calculated totals for each hiearchy grouping.  When ran, those totals are incorrectly displayed in the Preview;  however, when I click on the subreport, those totals are displayed correctly in the preview of the subreport.  Also,  if I go to the subreport design, pretending I'm editing the subreport, then go back to the main report preview, those totals are correct.
    Has anyone experienced this issue?  Please provide help/advise.  Thanks.

    Shwu, The subreport does not process any value based on the main report. I also observed that if the group extends to next page, the totals are incorrectly displayed.  I have both 'Keep Group Together' and section 'Keep Together' selected, but still the data extends to next page.  The subreport is sorted with 'Hierarchical Grouping'.  For example, below 2 lines are printed at bottom of a page:
    North America
        Sales department
    then Crystal prints the rest of departments belong to North America onto next page as:
         Marketing
         Consumer
             Government
             etc.
    I was hoping if I could get Crystal to not print the group if there's not enough space on the page, but rather print on next new page, the incorrect totals would go away.  Any idea how I would do page break for hierarchical groupings?

  • Essbase answers - None of the fact tables are compatible with the query request "member"

    Hi,
    I have modelled an Essbase database into the repository.
    If I pull the measure, period and year dimension in and filter on the year (member) and display the year (member) along with the period (alias) and measure it errors with =>
    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: 14020] None of the fact tables are compatible with the query request Fiscal Year.Fiscal Year Code. (HY000)
    However, all other things being equal if I change the year displayed to the alias then it works.
    Anyone tell me why??
    Is there a limitation that Essbase brings through that you cannot view what you filter on?
    thanks,
    Robert.

    Hi
    i have done the content level setting in each of the table, D1,F1 and F2(LTS), now i am getting the following error..
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 15018] Incorrectly defined logical table source (for fact table Gl Sets Of Books) does not contain mapping for [Code Combinations.Code Combinations.Affiliate, GL Balances.GL Balances.Currency Code, GL Balances.GL Balances.PTD_Balance, Gl Sets Of Books.Gl Sets Of Books .SoB Name]. (HY000)
    Gl Balances : D1
    Code Commbination: F1
    Gl Sets Of Books : F2
    I have checked the joins in physical and BMM layer..all are fine..

  • Fact tables are compatible with the query request

    Hi,
    i am using 11g.In 10g working fine without any error.After migrate 10g into 11g below error will returning. What is the problem and How we will fix.Could you pls let me know.Thanks
    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: 14020] None of the fact tables are compatible with the query request FACT_AGENT_TIME_STATISTICS.FKEY. (HY000)
    SQL Issued: SELECT s_0, s_1, s_2, s_3, s_4, s_5, s_6, s_7, s_8, s_9, s_10 FROM ( SELECT 0 s_0, "Team Performance"."DIMENSION - LOCATION"."COUNTRY CODE" s_1, "Team Performance"."DIMENSION - TIME"."BUSINESS DATE" s_2, CASE WHEN "Team Performance"."DIMENSION - TEAM"."ROLE" ='TEAM LEADER' THEN 'Team Leader' ELSE "Team Performance"."DIMENSION - TEAM"."TEAM" END s_3, CASE WHEN '30 Mins Interval' ='15 Mins Interval' THEN "Team Performance"."DIMENSION - TIME"."15 Mins Interval" ELSE "Team Performance"."DIMENSION - TIME"."30 Mins Interval" END s_4, ((SUM("Team Performance"."FACT - AGENT CALL STATISTICS"."TIME - ACD CALL HANDLING"+"Team Performance"."FACT - AGENT CALL STATISTICS"."TIME - AFTER CALL WORK (ACW)")+SUM("Team Performance"."FACT - AGENT TIME STATISTICS"."AVAILABLE TIME"))/60)/(COUNT(DISTINCT "Team Performance"."FACT - AGENT TIME STATISTICS"."DATE ID")*"Team Performance"."FACT - AGENT TIME STATISTICS"."INTERVAL TYPE") s_5, (SUM("Team Performance"."FACT - AGENT TIME STATISTICS"."AUX3 - TRAINING"+"Team Performance"."FACT - AGENT TIME STATISTICS"."AUX4 - MEETING"+"Team Performance"."FACT - AGENT TIME STATISTICS"."AUX5 - PROJECT"+"Team Performance"."FACT - AGENT TIME STATISTICS"."AUX6 - COACHING")/60)/(COUNT(DISTINCT "Team Performance"."FACT - AGENT TIME STATISTICS"."DATE ID")*"Team Performance"."FACT - AGENT TIME STATISTICS"."INTERVAL TYPE") s_6, (SUM("Team Performance"."FACT - AGENT TIME STATISTICS"."STAFFED TIME")/60)/(COUNT(DISTINCT "Team Performance"."FACT - AGENT TIME STATISTICS"."DATE ID")*"Team Performance"."FACT - AGENT TIME STATISTICS"."INTERVAL TYPE") s_7, COUNT(DISTINCT "Team Performance"."FACT - AGENT TIME STATISTICS"."DATE ID")*"Team Performance"."FACT - AGENT TIME STATISTICS"."INTERVAL TYPE" s_8, MIN("Team Performance"."DIMENSION - TIME"."FULL DATE TIME") s_9, REPORT_AGGREGATE(((SUM("Team Performance"."FACT - AGENT CALL STATISTICS"."TIME - ACD CALL HANDLING"+"Team Performance"."FACT - AGENT CALL STATISTICS"."TIME - AFTER CALL WORK (ACW)")+SUM("Team Performance"."FACT - AGENT TIME STATISTICS"."AVAILABLE TIME"))/60)/(COUNT(DISTINCT "Team Performance"."FACT - AGENT TIME STATISTICS"."DATE ID")*"Team Performance"."FACT - AGENT TIME STATISTICS"."INTERVAL TYPE") BY CASE WHEN '30 Mins Interval' ='15 Mins Interval' THEN "Team Performance"."DIMENSION - TIME"."15 Mins Interval" ELSE "Team Performance"."DIMENSION - TIME"."30 Mins Interval" END, CASE WHEN "Team Performance"."DIMENSION - TEAM"."ROLE" ='TEAM LEADER' THEN 'Team Leader' ELSE "Team Performance"."DIMENSION - TEAM"."TEAM" END) s_10 FROM "Team Performance" WHERE (("DIMENSION - TIME"."BUSINESS DATE" BETWEEN timestamp '2012-11-23 00:00:00' AND timestamp '2012-11-23 00:00:00') AND ("DIMENSION - LOCATION"."COUNTRY CODE" = 'US') AND ("DIMENSION - LOCATION".DEPARTMENT = 'CSG')) ) djm FETCH FIRST 65001 ROWS ONLY

    Back up your repository before following these steps:
    1 Reduce the problem report to minimum number of columns required to generate the error. This will usually identify which dimension and which fact are incompatible.
    2 Open the repository in the Administration tool and verify that the dimension and fact table join at the physical layer of the repository
    3 Verify that there is a complex join between the dimension and the fact in the business layer.
    4 Check the logical table sources for the fact table. At least one of them must have the Content tab set to a level in the hierarchy that represents the problem dimension. This is usually the detailed level.
    5 Check the logical table source Content tab for the dimension table. Unless there is a valid reason, this should be set to blank.
    6. Save any changes to the repository.

  • Error: None of the fact tables are compatible with the query request

    Hi experts,
    I have one confirm dimension D1 and other two fact table F1 and F2 (F1 and F2 are connected to D1)
    when i create a report from D1 and F1 the report is running fine. But pull the column from F2 also in this report i am getting the following error
    None of the fact tables are compatible with the query request Code Combinations
    please suggest on the same.
    Regards,
    S

    Hi
    i have done the content level setting in each of the table, D1,F1 and F2(LTS), now i am getting the following error..
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 15018] Incorrectly defined logical table source (for fact table Gl Sets Of Books) does not contain mapping for [Code Combinations.Code Combinations.Affiliate, GL Balances.GL Balances.Currency Code, GL Balances.GL Balances.PTD_Balance, Gl Sets Of Books.Gl Sets Of Books .SoB Name]. (HY000)
    Gl Balances : D1
    Code Commbination: F1
    Gl Sets Of Books : F2
    I have checked the joins in physical and BMM layer..all are fine..

  • 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

  • Some of my apps are with wrong language.

    Some of my apps are with wrong language. Spotify is on holland and sleep cycle are on Chinese? Is there a way to change this ?
    My region is set right (Norwegian)

    Henrik,
    You should try setting your general system language to English, followed by setting it to Dutch again. Fixed it for me. Apps that don't have a translation to Dutch (at least that's what i'm guessing) now appear in English (which I think is fine). So before this 'fix' the phone must have somehow thought Chinese was my second language...
    https://discussions.apple.com/message/23148896#23148896
    Regards,
    Johan

  • Microsoft Word docs are formatted wrong when opened in pages

    Hi,
    I‘ve been using pages from the very beginning and I am very happy with it (still waiting for "auto-save", though), but I do have one problem:
    often when I open word .docs in pages they are formatted wrongly.
    This happens especially with tables and pictures in tables.
    If the pictures are in one line in MS Word, they often jump to the next line in pages.
    Or the margins are wrong or both.
    If I open it in Open Office, for example, they are fine.
    Is there anything I can do about it?
    Will it be better in pages 09?
    Frank

    Hi, I have a similar problem with Word (.doc) files containing a Table converted to Pages. Having read that Pages can convert from Word, I bought iWork instead of Office for Mac. I need to work on Word documents sent to me as attachments and find that Tables do not survive the conversion to Pages properly. Often the text within a Table is shown but, if a lengthy text (i.e. more than a page), the Table does not continue to the next page and the text becomes hidden below the visible Table. If I cut out some text from the middle of the Table, the missing text is revealed, progressively from the bottom of the Table. In other words, the text is there in the document but cannot be seen if it is more than can be fitted on one page. Any ideas on how to sort this? I am not encouraged that iWork 09 does not appear to help in a similar problem to mine.

  • Setting Total Area Coverage (TAC or Density) in InDesign

    Is there a way to set the Total Area Coverage (TAC or Density) in the Export options from InDesign?
    I feel that the color management tools relate to elements created within InDesign and not placed images.
    My printer requires a PDF/X-1a:2001 compliant PDF with a TAC of 240% maximum.
    Is this possible using from within InDesign, or do I have to address 'Placed' images within Photoshop or Illustrator?
    Thank you for your response, in advance.

    InDesign's colour management can be set to affect placed content as well as native content.
    Do you have (or can your printer provide, or suggest) a CMYK profile that has 240% TAC?

Maybe you are looking for