Percentage calculation and zero amount entries get dvision by zero error

Hello, i am calculating the total of a field and then reporting the contributions of that line entry in percentage form but when a line has a zero amount i get an error of 'division by zero'.  I'll give some explamples below incase i'm not explaining very well.  If you replace the 225 under amount with 0 that is when i get the error.
code sample..
WhilePrintingRecords;
numbervar n := {@Total Weight}% Sum ({@Total Weight}, {JSALES_REPORT.SOPNUMBE});
data sample...
Amount      % of total
150             40%
225             60%
(375)

Hi Rod.
I'd recommend using and IF statement to deal with division by zero.  I'm not sure what you exactly want to do with records that have division 0 but I usually do the following to see which records are creating the div by zero errors and then decide how I want the values to be displayed after evaluating it.
WhilePrintingRecords;
if {whichever.field} = 0 then 9999999999  // this would be an indicator to me to take a look at this record
else
numbervar n := {@Total Weight}% Sum ({@Total Weight}, {JSALES_REPORT.SOPNUMBE}); // your original formula
You can then change the 99999999 number to whichever number you think should be viable to answer your business question on items that are divided by 0.
Hope this helps.

Similar Messages

  • I'm trying to convert a pdf file to word and I continue to get the message "An error occurred while signing in".  I believe I'm properly signed in, I can see my account, etc.  Any suggestions?

    I'm trying to convert a pdf file to word and I continue to get the message "An error occurred while signing in".  I believe I'm properly signed in, I can see my account, etc.  Any suggestions?

    Hi tkam,
    It sounds as though you just need to install the latest Reader update. Please choose Help > Check for Updates in Reader and install the latest update. An update to Reader 11.0.07 resolves this sign-in issue.
    Let us know how it goes!
    Best,
    Sara

  • I'm trying to convert a pdf file to word and I continue to get the message "An error occured while signing in".  I believe I'm properly signed in, I can see my account, etc.  Any suggestions?

    I'm trying to convert a pdf file to word and I continue to get the message "An error occurred while signing in".  I believe I'm properly signed in, I can see my account, etc.  Any suggestions?

    Hi tkam,
    I think I may have just the answer you're looking for. If you're converting from within Adobe Reader, please choose Help > Check for Updates and install any available updates. This error was resolved in the most recent Reader update. (You can also try signing in directly via the ExportPDF website at https://cloud.acrobat.com/exportpdf.)
    Please let us know how it goes.
    Best,
    Sara

  • I have a samsung scx 4100 series and i just updated to mountain lion and now i keep getting a "filter failed" error, anyone have any suggestions as to how to fix it.

    I have a samsung scx 4100 series and i just updated to mountain lion and now i keep getting a "filter failed" error, anyone have any suggestions as to how to fix it.

    Hi again, when you clicked on Mountain Lion and Lion in the App Store you are telling the laptop to reinstall them both.
    You may have allowed simutanious downloads checked at the bottom of the window, I don't know, but I expect Mountain Lion is downloading, so Lion is waiting for it to finish, so if you have Mountain Lion installed cancel both download's.
    Cancell both downloads anyway.
    Go to the apple logo , top left, click on it, then click on about this mac, a window will open telling you what's installed,  Mountain Lion is OX 10 version 10.8.2 click on more info, to find out more, Lion will be OX10 version 10.7.4.
    Only update were it say's check for updates, not download now.

  • ITunes radio was working last night and now today I get the message An error occurred while contacting the radio tuning service. Check your internet connection, or try again later" What's up?

    ITunes radio was working last night and now today I get the message "An error occurred while contacting the radio tuning service. Check your internet connection, or try again later"
    What's up?

    Two things to try, first, reset your PRAM.
    Next, try rebooting your computer.
    Please post back with results,

  • Desktop Manager "disconnected" and I can't get rid of the error message

    I just purchased a Blackberry Curve 8530, running v5 software, my computer is Windows 7. I installed the 501_b073_multilanguage software that I downloaded from Blackberry's website. When I launch the Desktop manager I get this message: "Before you begin, verify that your current BlackBerry device is connected to your computer." The troubleshooting posts I've seen on this forum include many tips (the ones I've tried are below). One in particular I can't do is "The desktop manager is showing "disabled."
    -Make sure that the user has gone into the desktop manager and selected options > connection settings > detect."
    ... because I can't get rid of the error message dialoge box, and I can't click on the options menu in the BB Desktop Manager.
    I have tried the following:
    uninstalled it and reinstalled it twice - 2nd uninstall was a "hard" uninstall where I deleted the registry files by hand
    moved the cable to the USB port in the back (after trying both the ports in the front) of the computer
    restarted the computer many times
    hard booted the phone by removing the battery
    plugged in, removed, and replugged in the phone.
    Also:
    The phone is installing correctly when I plug it in, but the software still doesn't seem to see it.
    In the Device Manager, the BlackBerry is showing up under Portable Devices. Double-clicking on it gives me the reassurring "This device is working properly." message.
    The Com1 port is working properly also, according to the Device Manager.
    Double-clicking on the device manager icon to get the properties shows that the Com1 port is "disconnected" -- when I try to configure it it just pops back to the disconnected state.
    If someone has an idea or something I haven't tried I'd sure appreciate it!!
    Thanks!
    K
    Solved!
    Go to Solution.

    Okay, folks, after a 3 1/2 hour phone call with a (very patient) telephone support person at Blackberry, here's what I learned.
    You can check your USB drivers this way:
    Plug in your phone into your USB drive. Assuming your Blackberry is "seen" by your computer...
    Go into the Device Manager on your computer (control panel)
    Expand the Universal Serial Bus controllers item on the bottom of the list
    Right-click on BlackBerry Smartphone and choose Properties
    Click on the Driver tab
    Click on the Driver Details button
    You should see one driver. I saw two. The one the BlackBerry likes is the RimUsb one.
    So here's what NOT to do: We tossed the entire driver that was the "extra". This effectively made using my mouse and keyboard impossible, as they are USB, and sent my poor husband into the basement to find a million-year-old keyboard (and then a mouse) with the old fashioned kind of connectors (PS2). Bleh. Don't do that.
    Here's what I did that worked (not saything this will work for you -- this modifies the Registry so better do a system backup with that backup and restore if you're nervous about this sort of thing):
    From the start menu, choose run, and type regedit to get into the Registry editor.
    Follow this file path: Computer, HKEY_LOCAL_MACHINE, SYSTEM, CurrentControlSet, Control, Class
    Click on: {36FCE60-C465-11CF-8056-4445535400000}
    If there's an item on the right called "UpperFilters", delete it. (see pictures)
    Hope this helps someone.
    Karin
    First pic: shows "before"
    Second pic: shows full file path and "after"

  • I am having trouble burning CD's and DVD's. Get the following message: error code 0x8002006E.  Can any body help ?

    I am having problems burning CD's and DVD's all of a sudden.  
    I get the following message: error code 0x8002006E.   I have followed all  the intsrucciones
    on Helps On Line from opening spece on my start up disc to allow burning thrue to  disc repair with disc utility
    and the problem still persists.  Can anybody help ?
    isanunez

    Are using the standard OSX Finder or do you have another finder application like Totalfinder?
    Long discussion of this error here:-
    https://discussions.apple.com/thread/1422026?start=0&tstart=0
    There might be something there to help
    Jerry

  • Elements 12 organizer has stopped working and premiere elements 12 get msvcr80.dll missing errors

    elements 12 organizer has stopped working and premiere elements 12 gets msvcr80.dll missing errors

    First deactivate the product(s) and then uninstall it from the machine using the procedure specifically for your OS.  If in Windows and I suspect it is then uninstall from the Control Panel.
    To deactivate the product you need to go Editor and then:
    Help >> Deactivate
    Please also make sure that you have your original CDs and /or DVDs handy including the necessary serial number as you will need them to install the product(s) again.
    After uninstalling the products, you need to restart the machine before you start to install again.
    You have created the backups of your sentimental photos, right?  You need to just in case the machine causes more problems down the line.
    G/L

  • Firefox does not "close" when closed under Windows 7; Task Manager must be used to "End Process." How do I close Firefox and reopen it without getting a "Still Running" error message?

    Even though Firefox has been updated multiple times (currently using Ver. 3.6.13) since I started using Windows 7, I am still unable to totally close it from the toolbar or taskbar. Firefox does closeout on the screen but apparently continues to run in the background. If I open Firefox at a later time, I get an error message stating that Firefox is still running. I then have to go Task Manager to "End Process." Electing to do so allows me to restart Firefox. I never had this problem with Firefox when using Windows XP and I never have this problem with any other software under Windows 7.

    https://support.mozilla.com/en-US/kb/Firefox%20hangs#w_hang-at-exit

  • Update caused itunes not to run tells me MSVCR80.dll is not installed. i uninstalled and reinstalled, but keep getting this message or "Error 7 (windows error 126)"

    I updated itunes today and now i have the following error:
    MSVCR80.dll not installed
    and itunes will not start at all
    I uninstalled and reinstalled itunes, but keep getting the same message
    Plus the message "Error 7 (windows error 126)"
    can anyone help with this??

    Troubleshooting issues with iTunes for Windows updates - MSVCR80

  • TS1424 trying to rent a movie through itunes on my apple TV and I continue to get a payment verification error even though the payment information is correct and the bank authorizes the purchase?

    What is the solution to problem renting movie through itunes on apple TV when payment verification not accepted even though the bank authorizes the payment?

    If you are also getting a message to contact iTunes Support then you can do so via this link and ask them why the message is appearing (we are fellow users here on these user-to-user forums, we won't know why) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • When i do initial set up w creative cloud set uo wont run send error message"installer failed to initialize" why and how can i get pass this

    When I do initial set up with creative cloud set up it wont run a send error message "installer failed to initialize" comes up. Why and how can I get passed this?

    Error "Installer Failed to Initialize" | Install desktop application | Windows

  • HTTP GET Failure 500 = Server Error

    Can HTTP GET all kinds of files from a SunOne server, ascii and binary, large and small, but always get failure 500 = Server Error when attempting to HTTP GET an EXE file. Absolutely positively can download binary image files (C4) that are significantly larger than some EXE files, so size is not the issue. What might trigger this error? Thanks.

    Hi,
    Pls don't forget to reward points and close the question if you find the answers useful.
    Eddy
    PS.
    Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!

  • Tax percentage and gross amount

    We have a requirement (South Africa) where we have the gross amount (final selling price) and tax percentage.  The net amount and tax amount has to be back calculated from the gross amount. 
    For example: 
    Gross price = 100 ZAR
    Tax % = 15%
    Therefore, the pricing should be as below:
    Net amount = 86.96 ZAR
    Tax amount = 13.04 ZAR
    Gross amount = 100 ZAR
    What is the best approach to handle this pricing scenario in SAP? 
    Is there is an option in standard SAP that can do the net amount calculation based on gross amount and tax percentage?
    Thanks in advance for your help.
    Shan

    Check this
    [Re: Tax inclusive in base price|Tax inclusive in base price;
    G. Lakshmipathi

  • Goods Receipt and Goods Return entries shows as Zero in PO history.

    Dear All,
    The Goods Receipt and Goods Return entries are showing as "Zero" in Delivery Cost Quantity, Amt. in local currency fields in PO History (T.Code: ME23N)
    What could be the reason?   How to find out the error?
    Expectiing valuable guidelines from the forum.
    Thanks in Advance.
    GB

    Hi
    Not ticked.
    GB

Maybe you are looking for

  • How do I delete my entire iCloud account?

    How do I delete my entire iCloud account?

  • HTML tags showing up in the pages also in 2.0?

    Hi, After a 5 minutes test of our application after an upgrade to 2.0 I found 3 places where html tags is showing in the bottom of the page. Normally it’s a html tag that is not getting closed. The examples look like this: </ <INPUT TYPE="hidden" NAM

  • What are the full specs of the hard drives on Time Capsule?

    Does anyone know the full specs of the "server grade" hard drives of a 4th gen 2TB time capsule? thanks Dustin

  • Can you use c7280 without ink

    I have a HP C7280 all in one.  They don't sell and I don't have the ink for it.  I do want to use it as a fax machine and or scanner.  Is it possible to bypass all of the messages about expired and empty ink to use these featuers in a non-print mode?

  • Assignments in transformations

    Hi, I'm working on a BW 7.4 SP07 system. Whenever I remove a characteristic from an InfoProvider, assignments of other characteristics (especially routines) are deleted. Normallay, I expect only to see the transformation inactive without changing any