How to divide the two numeric fields?
Hello.
I tried to divide two numeric fields, called A and B and put the result in a hidden field called C. I need the value for an XML export.
My question is; How is it possible to divide A and B? I don't have a problem in multipling other areas, but trying to divide I get at most / overflow error.
Best regards
Mathias
Hello
During the distribution, please check that the value of the field as the line is not null or zero first. So the event calculate the hidden field would look something like this:
if (b.rawValue == null || b.rawValue == 0) { c.rawValue = "0"; // If c is a numeric field. If it is a text field then you could put a message "division by zero" } else { c.rawValue = a.rawValue / b.rawValue; }
Hope that helps,
Niall
Tags: Adobe LiveCycle
Similar Questions
-
Try to divide the two numeric fields and have response in the third field num
Okay, I do something wrong and can not understand it. I use the code below in the field of PSF of my form to divide two different fields digital and for the life of me I can't understand why it does not work. I guess it's something simple. I downloaded the form. Please take a look at the form and me know where I am on leave. You almost have something simple and I just don't see
< activity = "click on" name = "event__click" >
< script contentType = "application/x-javascript" >
If (NumericField13.isNull |) NumericField13.rawValue == 0)
{
NumericField28.rawValue = '0 '.
} elseif(NumericField27.isNull ||) NumericField27.rawValue == 0) {}
NumericField28.rawValue = '0 '.
} else {}
NumericField28.rawValue = NumericField13.rawValue / NumericField27.rawValue;
}
< /script >
< / event >
I think it has something to do with the way which is made the division. I think he's trying to divide by zero, although at this time I tried several different if/then instructions and can't see where I go into the equation, so I tried the above only a click again and could not get that to work either.
Thanks in advance for your help.
Justin
First thing is that you have this script running on the click... event so that your code will not run until a user clicks on the field. I suggest that you put it
the calculate event. In this way, every time one of the other values named in the formula change t
hen she'll recalculate this field.
Second, there was a script error in your formula... I modified to look like this (it seems just more logical that way to me)
If (NumericField13.isNull |) NumericField13.rawValue == 0) {}
NumericField28.rawValue = '0 '.
} else {}
if(NumericField27.IsNull ||) NumericField27.rawValue == 0) {}
NumericField28.rawValue = '0 '.
} else {}
NumericField28.rawValue = NumericField13.rawValue / NumericField27.rawValue;
}
}Third, your shodul of NumericField27 have a default value 1 or you should make its value acheck so that she does not have a possibility to get a 0 or your division will fail.
Finally, shodul you rename your fields have insstead of generic names like numericField XX more descriptive names. Many people like to know the type of field to the name then, instead of NumericField27 SQFT_NumFld what would you say? With this technique, I can say immeadiately field in which you speak (Square Footage) and its type (numeric). Just my 2 cents worth!
Paul
-
Dividing the two calculated fields
Hi people,
I am able to divide two calculated fields viz (# opportunities created / # opportunities Won) but I want to display "0.00" when the numerator and the denominator are '0 '.
The calculation that I use is
1.0 * (COUNT (DISTINCT BOX WHEN opportunity. "Created Date" "< = CURRENT_DATE AND opportunity. '" Created Date' > = TIMESTAMPADD (SQL_TSI_DAY-30, CURRENT_DATE) THEN opportunity. ("' Opportunity ID ' NULL OTHER END) / COUNT (DISTINCT BOX WHEN opportunity. "Stage of current sales' = ' Closed / Won" AND opportunity.' " Modified by time"< = CURRENT_DATE AND opportunity. "" Modified by DateTime "> = TIMESTAMPADD (SQL_TSI_DAY-30, CURRENT_DATE) THEN opportunity. ((' ' END of NULL OTHER opportunity ID '))
Any suggestions?
Thank you and best regards,
Amit KulPut a case when statement around it:
When case (DIVISIONS. VAL1/DIVISIONS. Val2) is null then 0 DIVISIONS on the other. VAL1/DIVISIONS. End Val2concerning
John
http://obiee101.blogspot.com/ -
Paint or Windows Photo Gallery
I try to combine a picture of my sister with a picture of a poem beside it, how to combine the two into a single photo?
If you have the poem recorded in an image format,
the following freeware can create a side by side
Panorama.(FWIW... it's always a good idea to create a system)
Restore point before installing software or updates)Download IrfanView
http://MajorGeeks.com/IrfanView_d4253.html
(filename: iview433_setup.exe)
(uncheck if you don't want Google Chrome)Download plug-ins too...
IrfanView plugins
http://MajorGeeks.com/IrfanView_PlugIns_d4908.html
(filename: irfanview_plugins_433_setup.exe)When the program is installed... read more...
Open IrfanView and go... Image / create the Image of the Panorama...
(this will open the screen to "Create a panorama image")On the screen to "Create a panorama image"... left click on the add images"" button.
(Displays the 'Open' screen. Now, drill down to the
the folder that contains your saved Photos of veterinarians.Now... click left (highlighted), the two images, you want to join.
(you can select more than one if you hold down your Ctrl key)
The two images highlight... left click on the button 'open '.
(Or... you can add the images one at a time... which is always easier)Now, go back to the screen "Create the panorama image.
and the file names of the selected pictures need to be in the
Field "Input Images.Now with the names of two files in 'Images of entry' field...
You can left click on the button 'create Image '.(the positions left and right of these images can be swapped in)
selection of a file name and using the "mount image" / "Move."
Images down"buttons...)Now you should see a display of the combined image.
Reach... File / save as...Choose a backup location / enter a file name / choose a format...
On the left, click on the button "Save..." -
How to tie the two serial numbers using test including the tie in the database.
I have two separate committees, I need to link the serial number too. One is being tested as a separate unit, then the two are tested together, I need to make sure that I connect them in the database. Don't know how to do it, looking for any input I can get. Using a labVIEW vi to request the entry of a Board, and then use information interface to USE testbed for UUT of the hand.
I have juries, one of the boards, A onboard, was tested by a different sequence file, then A is connected to Board B, and then they are tested as a complete set. Received a few suggestions on how to save the two serial numbers, but went with a popup message added types of step (modified record results), and then just have the user scann the second number in and it stands as one of the results of the step in the database.
-
How to break the two folders that are cross-linked?
I tried to move C:\users\richard to E:\My Documents ' My Documents'.
Some how the two directories have become reticulate.
Make any change in directory caused the same change in the directories of the sentence.
How to restore the two inventories back to normal?
I tried to move the directory in E:\ back to C:\, but received a parsing error.
TIA,
Richard
Wednesday, February 5, 2014, 17:20:47 + 0000, Richard332 wrote:
I tried to move C:\users\richard to E:\My Documents ' My Documents'.
Some how the two directories have become reticulate.
Make any change in directory caused the same change in the directories of the sentence.
How to restore the two inventories back to normal?
I tried to move the directory in E:\ back to C:\, but received a parsing error.
The directory c: is not really a directory; It is a library which is
just a pointer to the real directory on E:, a bit like a shortcut.So if you get there via the library or the directory, you are in
in the same place - E:\My Documents and any changes there are also
See in the library. -
Hi all...
Here, I use the following scripts...
create table a10 (eno number, date f, date t, number of sal)
INSERT IN A10 (ENO, F, T, SAL) VALUES)
1, TO_Date (1 July 2013 12:00:00 AM ',' DD/MM/YYYY HH: mi: SS AM'), TO_Date (June 30, 2014 12:00 ',' DD/MM/YYYY HH: mi: SS AM')
(100);
INSERT IN A10 (ENO, F, T, SAL) VALUES)
1, TO_Date (May 1, 2013 12:00:00 AM ',' DD/MM/YYYY HH: mi: SS AM'), TO_Date (April 30, 2014 12:00 ',' DD/MM/YYYY HH: mi: SS AM')
(200);
COMMIT;
entry:
ENO F T SAL
07/01/2013 2014/06/30 100 1
1 05/01/2013 30/04/2014 200
Expected results:
ENO F T SAL 1 05/01/2013 2013/06/30 200
1 30/04/2014 300 07/01/2013
1 05/01/2014 2014/06/30 100
I'm little bit confused how to divide the dates here... Any help is appreciated.
Thank you all
Stéphane
Hello
Always tell what version of Oracle you are using, especially if it's so old.
In Oracle 10 (or 9, by the way) you can do this way:
WITH cntr AS
(
SELECT LEVEL AS n
OF the double
CONNECT BY LEVEL<=>=>
)
got_change_date AS
(
SELECT d.eno
C.n
WHEN 1 THEN f
ANOTHER t + 1
END AS change_date
C.n
WHEN 1 THEN 1
OF ANOTHER-1
END as mul
sal
BY a10 d
CROSS JOIN cntr c
-WHERE... - If you need any filtering, put it here
)
got_total_sal AS
(
SELECT eno
change_date f
Advance (change_date) OVER (PARTITION BY eno
ORDER BY change_date
) - 1 AS t
SUM (sal * mul) over (PARTITION BY eno
ORDER BY change_date
) AS total_sal
OF got_change_date
)
SELECT *.
OF got_total_sal
WHERE t IS NOT NULL
ORDER BY eno, f
;
-
How to control the number of fields in the Advanced mode in <; af:query >;
Hello
How to control the number of fields in the Advanced mode in < af:query >?
Say I have 20 fields in my table, and I created a view of criteria with 2 fields. This would work perfectly in basic mode. But in Advanced mode , the choice of fields is possible by clicking on the Add fields button. I didn't have the customer to search with all 20 fields. Only 10 fields must be listed in the Advanced Mode, even if there are 20 fields in my table.
How can I control the list of fields in ADDFields button?
Any ideas?
KRYou can uncheck the contestable ownership of attributes that you must not appear in the Advanced Mode (but they will not appear in the other modes too!) or by programming the value the same as those mentioned here.
http://adfcodebits.blogspot.com/2010/11/bit-27-setting-view-object-attributes.html
Also, you can hide the button AddFields as suggested here - http://www.notjustjava.com/2011/12/cool-tips-to-showhide-components-of-the-query-control-of-adf/
-
To access the two video fields of framing in the workspace?
I'm new on video and have just learned there are two video frames / frame of the video.
Is it possible to access the two video fields of the frame within the workspace of PP CS6?
I work with dv 29.97 FPS.
Thanks in advance.
Thomas
iMac Mac OS X 10.8.3 end of 2012
Hi Thomas,
If you ask if you can somehow "edit" on the ground, then no. But if you want to see full frame (combined fields), in the program monitor, do a right-click (or Mac equivalent) or there is a key it click on as well and in the drop-down list, look at the options of fields and set at a TIME rather than up or down.
Thank you
Jeff Pulera
Safe Harbor computers
-
How to divide the column Date OBIEE
Hello
We have the name of the date column: To_Date and the format is DD/MM/YY hh.
How to divide the date in YEARS, MONTHS, DAY as new columns.
kindly help on that.
Kind regards.
CHR
Published by: 867932 on November 23, 2011 22:18Hi user,
All 3 functions can be written in RPD too. MDB layer, duplicate the date column-> the mapping tab to column of Goto-> expression-> functions Builder Select-> calendar Date functions / hour-> select DayofMOnth function. The column of your logic formula will look like,
DayofMonth (YourDateColumn)
Rgds,
DpKa -
How to display the serial No. field not to mention that the search results displayed
How to display the serial No. field not to mention that the search results displayedHello
You missed to add the varstatus property in your table
Try with this code:
lines = ' #{bindings. " SahajDetailVO1.rangeSize}.
emptyText = "#{bindings." SahajDetailVO1.viewable? "{'No data to display.': 'Access Denied.'}".
fetchSize = "#{bindings." SahajDetailVO1.rangeSize}.
rowBandingInterval = "0" id = "t1" styleClass = "AFStretchWidth."
varStatus = 'vs' >
-
How to carve, and concatenate the two text fields in a form
Hi people,
Newbie here... have two fields in a form: FirstName and LastName. Want to have these appear later as: name, first name.
For example: 'Rick' "Stockstill" should later manifest as: 'Stockstill, Rick' with a comma separating the names and trailing blanks removed.
It is a piece of cake in Excel, but have not figured out how to do the same with Acrobat. My first try at a script looks like this:
(Recipient.rawValue = trim (LastName.rawValue) +","+ FirstName.rawValue);
The field 'Recipient' is a standard text field which I am filling using the property to 'calculate '. The good news is that I get no error message, but the bad news is that the field recipient does not get filled.
Any help is greatly appreciated.
At the latest,
Rick Stockstill
North East Independent School District
San Antonio, TX
210-407-0317.
[email protected]OK, in this case you can use this code as the custom recipient field calculation script:
event.value = trim(this.getField("LastName").valueAsString) + ", " + trim(this.getField("FirstName").valueAsString); function trim(s) { return s.replace(/^\s+/,"").replace(/\s+$/,""); }
-
How to divide the C: drive into two partitions without a third-party program?
Hello
Is there a way to divide the C: drive into two partitions C: and D: on Windows XP without a third pary program?
If anyone has an idea, please give some steps.
Thank you.
Assem
Hey Assem,
Once you have created a primary partition, it is not possible (for Windows XP) to divide the partition without using third-party software. You can see:http://support.microsoft.com/kb/309000 to create a new partition.
I hope this helps...
-
How to divide the Panel layer in two?
How do divide you the layers panel in half? I've seen references to do this but Googling this question does not work.
I use CS2
Far as I can tell that the person referred to the screenshot of the layers panel appeared in the article, not the real layers panel in Photoshop.
-
How to divide the notes on two pages?
Im a book with hundreds of notes (sometimes lengthy) composition. I want a rule above the first note of the page. I also want to split notes on two pages, if necessary. I had no problem with this in CS4 (but maybe the circumstances are different). Now I'm using CS5.
Problem: when there are more references note in the same paragraph at the bottom of the page, all the notes go to the next page, even when there is enough space for at least part of the first note. I have a workaround for it (only to leave the reference to the first in that paragraph, move the other references to somewhere on the next page, setting the text color to zero and put false references on the original locations), but it's not ideal. I forgot something?
Problem 2: I have set the rule dividing the body of the text and notes to 0.3 pt a length of 40 pt. With a reference divided into two pages, this goes well for the first page, but on the second page there is now a thick line and a lot more time (the standard system for notes rule?). This problem occurs in CS4. Anyone know if this will be fixed? Suggestions for a workaround? Or did I do something wrong?
Without actually seeing your document, it is difficult to propose a solution to the first. Looks like your reference text has not only the option to keep all the lines together, but also keep with next.
The 2nd problem is easily solved, though. It is * even * because it works in CS4. In the note Options dialog box, you see the options for the rule on the first Page, but the little drop-down menu selector allows access to the Pages that follow on as well. It works the same as with paragraph nets - a dialogue, but the drop-down list determines which settings you change.
Maybe you are looking for
-
printer HP psc download file win.ini recognition range queries
I followed all directions of HP to download the driver for hp psc 1210 xi, but at the end of the installation, it gives a code 1913 and ask for verification of the win.ini file, which I can not locate. He asked that this converted file to 'read only'
-
Windows\System32\Spool\Drivers\W2X86\3\LXBTtimedll does not
Above does not load on Windows XP Home Edition boot how to fix?
-
My lifecam light will not stay when I plug it into my USB...
I can't even interact with anyone. mic works but the cam does not work... it don't it turn on for 6 seconds, then turns off
-
BlackBerry 8130 pearl smartphones cache cleaning
How can I clean the cache in my pearl 8130.
-
Problem troubleshooting Windows
Hello world "There is a problem I face every time, whenever I try to open the window to troubleshoot a dialog, called WerFault.exe box opens would possess information such as - 'the instruction at 0xf7998a8e referenced memory at 0x00000000. "The memo