Multiplying UDF resulted in wrong amount in Total (LC)

Dear All,
I really need your help to solve my problem.
I created two UDF which are Qty (field type is Quantity) and Price (field type is Price). These UDFs appear in document with the type Service. I create a query which is :
declare @Qty numeric(11)
set @Qty = $[$39.U_Qty.0]
SELECT @Qty * $[$39.U_Price.0] As Price
And then I created formatted search in Total(LC) in document with type service using that query.
The problem is, the query sometime result in wrong amount (for example : Qty = 0.5 and the Price = 1000, the query is resulting in 1000 which is the correct amount is 500).
Please help me to solve this problem.
Thank you
Best Rgrds,
Surya A.
Edited by: Surya Anugrah on Jan 7, 2009 10:26 AM
Edited by: Surya Anugrah on Jan 7, 2009 10:27 AM
Edited by: Surya Anugrah on Jan 7, 2009 10:28 AM

Change your declaration of  "declare @Qty numeric(11)"  as
declare @Qty numeric(19,6)

Similar Messages

  • Total result  & formula result  is wrong in query out put

    Hi BW gurus
    I have issue with total result and formula result
    my requirement
    Formula for hours is ( total time / Counter / 60)
    hours  column displaying
       14.2
         2.4
         3.4
    Total -
    5.6   not  20    then I setp calculate results to SUM  now total displying 20  perfect.
    Then I am using hours colum for calculation   here is my issue
    Qty rec per hour formula is = received / Hour
    Hours   Qty rec per hour          received
    14.2              100                            14200
    2..4               100                              2400
    3.4                100                              3400
    20                 300                              20000        result column for qty rec per hour is wrong . formula is not working on result for qty rec per hour
    Actually qty rec per hour result should be 20000/20  = 1000
    How to resolve this issue
    Thanks
    Rohan

    Hi BW Gurus,
    Thanks for your help .
    Let me explain my issue with examples :
    My report is by document date level ( Not at Po or PO line Level)
    I have a 3 Key figures
    1.  Hour -  is poulation at  PO Line level
    Ex :  4500001    1             5.30
                             2            5.30
                             3            5.30
    Then I am using counter to get single for time
    Hour/ Count  now my value is 5.30 in the report . hour column is perfect
    2. Po Qty  is fine
    3.  Qty Recd per hour ( Calculation)    PO QTy / Hour
    Now the issue is  each row caluculating perfect . but result row is not correct  Qty Received per hour . We don"t wont  sum of  Qty received per hour in result . We want  Caluclation result in the result
    Here is the issue
    If I have multiple POs for same document date  , each row is fine but system using division at Hour result also by COunter . because of thati am getting wrong hours in result for hour . this wrong result is using for Poqty receved per hour result  also .
    I put total for hour coulum result is perfect but for clauclation it is talking total hours/ total conter result .How to replace result caluculating by counter .This is our major issue .
    Appriciate your response
    Thanks
    Rohan

  • Is it possible to multiply the result of a count function by another column

    Hello,
    I need to generate an invoice for the amount of nursery sessions a given child has attended. I can get the amount of sessions using this query:
    select COUNT(s.session_id), cr.child_id
    from sessions s, child_register cr
    where s.session_id = cr.session_id
    and cr.child_id = 'C110001'
    group by cr.child_id;
    Which outputs:
    2     C110001
    I can't figure out how to multiply the result of COUNT(s.session_id) by a row in the session table called srate (which is a number, 20)
    Here are my attempts:
    select COUNT(s.session_id) * s.rate, cr.child_id
    from sessions s, child_register cr
    where s.session_id = cr.session_id
    and cr.child_id = 'C110001'
    group by cr.child_id;
    I get an error 'Not a group by expression which makes sense
    Then I tried:
    select COUNT(s.session_id) * s.rate AS total, cr.child_id
    from sessions s, child_register cr
    where s.session_id = cr.session_id
    and cr.child_id = 'C110001'
    group by total;
    Error 'total' not a valid identifier, Wrapping the COUNT(s.session_id) * s.rate in parentheses gives me the same error.
    I'm sure it's something blatantly obvious :(
    Any help very much appreciated as always,
    Mike

    Why don't you head over to the SQL & PL/SQL forum here...
    PL/SQL
    Expect to be asked to provide create table and inserts with sample data though, as well as to wrap your code in {noformat}{noformat} tags to make it more readable and preserve formatting!
    Cheers
    Ben                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • NewGL: Calculation of amount of totals records

    Hallo zusammen,
    ich würde in mySAP ERP2005 gerne das Neue Hauptbuch nutzen und möchte vorher gerne die Anzahl der zu erwartenden Summensätze berechnen, um zu wissen was da auf uns zukommt. Im Moment wird nämlich noch ein "externes" GL-System genutzt.
    Dazu habe ich den OSS-Hinweis 1045430 gefunden und implementiert. Dieser stellt den Report RGUIST01 zur Verfügung, der es ermöglichen soll die Anzahl der Summensätze unter anderem anhand von Fremddaten zu bestimmen.
    Dieser generiert zur Laufzeit den Report SAPFGSIS, basierend auf den Eingaben in RGUIST01. In RGUIST01 kann ich die Tabelle wählen, auf welcher die Liste der Felder basiert - welche wiederum mit der zu lesenden Tabelle korrespondieren sollte. Entsprechende Tabellen (die mit der zu lesenden Tabelle korrespondieren) habe ich in SAP angelegt.
    "Füttere" ich aber den Report jetzt mit den Fremddaten beträgt die ermittelte Anzahl an Summensätzen immer gleich der Anzahl an Zeilen der Tabelle mit den Fremddaten, was aber nicht stimmt/stimmen kann.
    Hat schon jemand Erfahrung mit dem Report RGUIST01 gemacht? Oder weiß jemand wie man den Report "richtig" benutzt?
    Danke und Gruß
    Jochen

    Dear all,
    I would like to use the newGL in mySAP ERP2005. Before I would like to calculate the amount of totals records. Therefore I implemented OSS note 1045430, which provides the RGUIST01 report that may calculate the amount of totals records based on the input of external systems also.
    Background: At the moment an external GL system is in use and is planned to displace by SAP.
    I have created an Z_structure within SAP that corresponds the external file and tried to run the report. But the results I got are always amount of totals records = amount of lines of excel file from external system.
    Does anyone already have experience running this report for calculating the amount of totals records?
    Thanks and regards
    Jochen

  • TS1702 i if use "search" in music on my ipod touch 5th gen the result just show only album and playlist but nothing song result.whats wrong with it?please help

    i if use "search" in music on my ipod touch 5th gen the result just show only album and playlist but nothing song result.whats wrong with it?please help

    The users guide says:
    Spotlight searches the following:
    Contacts—All content
    Apps—Titles
    Music—Names of songs, artists, and albums, and the titles of podcasts and videos
    Podcasts—Titles
    Videos—Titles
    Audiobooks—Titles
    Notes—Text of notes
    Calendar (Events)—Event titles, invitees, locations, and notes
    Mail—To, From, and Subject fields of all accounts (the text of messages isn’t searched)
    Reminders—Titles
    Messages—Names and text of messages
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsynce all music and resync
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup
    - Restore to factory settings/new iOS device.
    - Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • Finder reports wrong amount of free space

    Finder is reporting the wrong amount of free space on all my drives.  It's not from time machine local backups, because I've disabled those.  In fact, it's reporting MORE free space than there should be!  In all cases, Disk Utility shows the correct amount.  (So does the Terminal command df.)
    eg:
    external 120GB hard drive (USB) - finder says 137.83GB free (more than the drive can hold, nice) - disk util says 70 used 49.9 free... better
    external 1TB (firewire) - finder says 276.66GB free - disk util says 783.72 used 216.15 free
    internal 120GB SSD - finder says 108.32GB - disk util says 78.6GB used, 40.5 free
    Anyway to fix Finder?

    I noticed the same problem. I assumed it was from Time Machine's local backups (which exactly account for the space discrepancy between Finder and Disk Utility on my machine). But, as you say, you've disabled Time Machine local "snapshots." I can only assume you deleted the local backups (to free up the space they were using), emptied your Trash and are still showing the discrepancy.

  • Wrong SSAS Grand Total Value Monthly Value base on Weekly Value

    Dear All, 
    I Have calculated measures in my cube base on Weekly and Base on Monthly and different
    Template Base .
    For grand Total Weekly is fine but for Monthly is bad one.
    Say calculated Measure Name "Weekly" with Syntax
    CREATE MEMBER CURRENTCUBE.[Measures].[Weekly]
     AS IIF(isempty([Measures].[Actual Quantity MTD]) or [Measures].[Actual Quantity MTD]=0 or isempty([Measures].[Original Plan Quantity  MTD])   , null ,
    IIF([Measures].[Original Plan Quantity MTD] =0 or isempty([Measures].[Original Plan Quantity MTD]),null,   
    IIF( 
     ([Measures].[Actual Quantity MTD]-[Measures].[Original Plan Quantity MTD]) > 0 , 1 ,[Measures].[Actual Quantity MTD]/ [Measures].[Original Plan Quantity MTD] ))) 
    The Result is good
    here the picture
    http://hpics.li/9fd22f2
    https://drive.google.com/open?id=0ByY5H-XcydgiWGp0RzdWYWp0M2c&authuser=0
    and for Monthly Calculation  it was AVG of Weekly base on Time, Plant, and PSL Dimension 
    My calculated Monthly Measure Name "Monthly" with Syntax
    CREATE MEMBER CURRENTCUBE.[Measures].[Monthly]
     AS AVG ( 
    DESCENDANTS([PSL].[PSL Description])*
    DESCENDANTS([Plant].[Plant])*
    DESCENDANTS([Finish Date].[Calendar],[Finish Date].[Calendar].[Month Year]) 
    , AVG(([Finish Date].[Calendar].CURRENTMEMBER.CHILDREN), [Measures].[Weekly]))
    The Result is Bad on Grand total 
    here the Picture link 
    http://hpics.li/5233b50
    https://drive.google.com/open?id=0ByY5H-XcydgicEhtT1FpekRsbW8&authuser=0
    Please help me why for the Result doesn't same. What do i Miss
    Thank You 
    Yan

    Hi Yan,
    According to your description, you create a calculated measure in your cube, the problem is that grand Total for Monthly is incorrect, right?
    In your scenario, the issue can be caused by that you used "*" and "/" in your calculated measure. In SSAS, one of the most common issues faced in mdx is grand total or sub total not coming properly when some arithmetic operations like
    measure1 [* or + or - or /] measure2 is used, please refer to the link below to see the details.
    http://vnu10.blogspot.jp/2011/01/mdx-grand-total-sub-total.html
    Regards,

  • System automatically clears the service of half amount of total amt in po.

    I whenever comes in ml81n to create the entry sheet against purchase order,and after selecting all the services to be entered there,the system automatically clear the service of half amount of total amount in po.
    can some one tell me to get rid of this problem.
    Regards:Vijay Kumar

    In the net value field the system is bringing the half of the amount of total value in ml81n.And that is not changeable.However the value at the purchase order in net and total is the same.
    Regards:VIJAY

  • F-48 -  Withholding tax amount exceeds total bank line item amounts.

    Dear all
    In F-48 i am getting following error msg,
    Withholding tax amount exceeds total bank line item amounts.
    Message no. 7Q320
    All Config settings or ok.
    Kindly suggest with suitable solution.
    With thanks
    Jai

    Dear,
    Select Relevant to cash flow field for Bank GL you are using for making down payment.
    Regards,
    Chintan Joshi
    Edited by: Chintan  Joshi on Jan 21, 2010 10:21 AM

  • Withholding tax amount exceeds total bank line item amounts

    Dear Sir,
    While I am trying to make down payment to the WHT vendor I have found the above error.  Can anybody help.  I am not giving any base amount in WHT information while down payment.   It is picking automatically tax code P9.  I am trying to post the down payment 10000/- and P9 tax code amount is 2.266%.
    BSR

    HI,
    If the Error is 7Q 320 'Withholding tax amount exceeds total bank line item amounts'
    then   follow
    Kindly check in the relevant bank GL account master whether you have
    activated the field "relevant to cash flow" in the create/bank/interest
    tab in the GL account master FS02. Also refer the SAP Note 198368.
    Reg
    Madhu M

  • Uploading photos from PC to Photo library results in wrong date/time

    Uploading photos to iCloud photo library using icloud.com will result in wrong date/time of the photos, which is, to be precise, 15 hours later than the actual time in EXIF. Thanks in advance.

    iTunes is not a photo management program, never has been.
    Delete the pictures (or remove them from the folder that syncs).  This has absolutely nothing to do with iTunes.
    If the Photo tab is not displaying in iTunes, resize the window.

  • 1.     Retainage of certain amount of Total payment to be made to vendor

    Hi gurus
    can someone help me to configure the below scenario please
    1.     Retainage of certain amount of Total payment to be made to vendor
    Thanks

    Dear Lakshmi,
    Retention money is that part of the invoice of a vendor, which is not paid to the vendor until some pre agreed conditions are satisfied.
    For example, a vendor may suppy a machinery and as per the terms, 90% of the amount would be paid and the remaining 10% would be paid say after 6 months after satisfactory commissioning of the machinery.
    The retention money concept is used in Accounts Payable and can be configured with the help of "terms of payment"
    You can use the Terms of payment to acheive this requirement.
    Go to Transaction code OBB8. Create a new terms of payment say Z001, which has the "Installment Payment" ticked.
    Now create two more terms of payment Z002 and Z003. Here mark the "Payment Block" (A or B) for the terms of payment Z003.
    Now go to OBB9, fill as below
    Z001----- 170-----Z002
    Z001--230-----Z003.
    Now at the PO stage, make sure that the terms of payment is Z001.
    At the stage of the invoice verification, the entry would be
    Expense A/c Dr 1000
    To Vendor A/c 700
    To Vendor A/c 300 ( This would be with a payment block)
    At the time of automatic payment, this Rs.300/- will not be selected unless we remove the payment block.
    Regards
    Venkatesh
    PS: Assign points if useful

  • Retainage of certain amount of Total payment to be made to vendor

    Hi MM gurus
    I need to configure with the below requirement, can someone through light on it please
    1.     Retainage of certain amount of Total payment to be made to vendor
    2.      Separate Tax ID for Vendor

    Dear Lakshmi,
    Retention money is that part of the invoice of a vendor, which is not paid to the vendor until some pre agreed conditions are satisfied.
    For example, a vendor may suppy a machinery and as per the terms, 90% of the amount would be paid and the remaining 10% would be paid say after 6 months after satisfactory commissioning of the machinery.
    The retention money concept is used in Accounts Payable and can be configured with the help of "terms of payment"
    You can use the Terms of payment to acheive this requirement.
    Go to Transaction code OBB8. Create a new terms of payment say Z001, which has the "Installment Payment" ticked.
    Now create two more terms of payment Z002 and Z003. Here mark the "Payment Block" (A or B) for the terms of payment Z003.
    Now go to OBB9, fill as below
    Z001----- 170-----Z002
    Z001--230-----Z003.
    Now at the PO stage, make sure that the terms of payment is Z001.
    At the stage of the invoice verification, the entry would be
    Expense A/c Dr 1000
    To Vendor A/c 700
    To Vendor A/c 300 ( This would be with a payment block)
    At the time of automatic payment, this Rs.300/- will not be selected unless we remove the payment block.
    Regards
    Venkatesh
    PS: Assign points if useful

  • Charged wrong amount for app want refund

    Charged wrong amount for app want refund

    Contact the AppStore Support, http://www.apple.com/support/mac/app-store/contact/
    See the section "Account and Billing Support" : https://expresslane.apple.com/Issues.action

  • [svn:fx-trunk] 10877: Fix a small syntax error in Path bounds calculations that could result in wrong bounds for edge cases involving MoveSegments .

    Revision: 10877
    Author:   [email protected]
    Date:     2009-10-05 15:23:37 -0700 (Mon, 05 Oct 2009)
    Log Message:
    Fix a small syntax error in Path bounds calculations that could result in wrong bounds for edge cases involving MoveSegments.
    Thanks go to Min for noticing the bug!
    QE notes: None
    Doc notes: None
    Bugs: None
    Reviewer: Deepa
    Tests run: checkintests
    Is noteworthy for integration: No
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Path.as

    orangekay wrote:
    That is absolutely unreadable.
    I agree completely. How about also providing a link to a set of input files so that we could actually run the code ourselves? Otherwise, there is no chance to debug the source code, it is just a mess.
    You might have better luck with an older version of the file. To quote the comments:
    // Modified on March 31, 2005. Initialized maxchange in nonlinvoltra() as
    // INFTY. Replaced crnmbr() by a similar, but faster routine interior().
    // Many thanks to Stuart Anderson for pointing out this shortcut.
    I suspect that the "interior" function is just plain incorrect. It doesn't matter if it runs on some other OS. Something about it is wrong and the code is so cryptic that it can't be deciphered.

Maybe you are looking for