How to make the sum of numeric fields based on a value in a text field - charge memo
I'm working on a Weekly Report of expenses employee that contains a list of charges and each can be marked as a company or a paid employee costs. There are two fields in the form which is to show totals for the company and the employee paid expenses. There are seven columns for amounts, one for each day of the week. Expense Code text fields are called "Exp1" through "Exp7". Digital type amount fields are called 'Amount1' by 'Amount7. The fields under each column share the same name. (Hope that makes sense). A screenshot is below, and a link to the form is included in order to better understand the composition of the form. I don't know how to for a total of to the top of all expenditures that are marked with a 'C' and all those marked with an "E". I'm not well versed in Java. Any suggestions would be greatly appreciated! Thank you!!
Link to the form:
https://www.dropbox.com/s/sgsle5bkam2y4am/expense%20Report%20v1_0%20-%20LC%20Original.PDF? DL = 0
I tried to implement your requirement in the form at the following link. If please test and let me know if it works.
Tags: Adobe LiveCycle
Similar Questions
-
How to make the sum of the time through SQL?
Dear friends
I have a sh_detail table and there are three fields hours1, hours2 hours3. all fields are of type varchar2.
data are like
hours1 hours2 total hours3
02:45 00:18 01:25
00:38 01:45 00:00
02:15 02:00 00:15
1. I want to add on three fields in the total column
2 and want to make the sum of all areas as select sum (hours1) of sh_detail.
Please help I will be grateful.
Kind regards.
As others have said, use the NUMBER to store times, or the type of data correct INTERVAL, even if the latter cannot be aggregated (using the SUM).
In the meantime, this will give you the output desired in a few minutes (it is trivial to convert it back in format hh: mm if you wish):
SQL> with sample_data (id, hours1, hours2, hours3) as ( 2 select 1, '02:45', '00:18', '01:25' from dual union all 3 select 2, '00:38', '01:45', '00:00' from dual union all 4 select 3, '02:15', '02:00', '00:15' from dual 5 ) 6 select id 7 , sum(h1) h1 8 , sum(h2) h2 9 , sum(h3) h3 10 , sum(h1+h2+h3) as total 11 from ( 12 select id 13 , to_number(substr(hours1, 1, 2))*60 + to_number(substr(hours1, 4, 2)) as h1 14 , to_number(substr(hours2, 1, 2))*60 + to_number(substr(hours2, 4, 2)) as h2 15 , to_number(substr(hours3, 1, 2))*60 + to_number(substr(hours3, 4, 2)) as h3 16 from sample_data 17 ) 18 group by rollup(id) ; ID H1 H2 H3 TOTAL ---------- ---------- ---------- ---------- ---------- 1 165 18 85 268 2 38 105 0 143 3 135 120 15 270 338 243 100 681
-
How to make the sum of hours which is the varchar2 data type in oracle
Hi my table is like this
emp_ngtshthrs (empno number (10), nightshifthrs varchar2 (20));
now I want sum employee nightshifthrs how do the sum hours, it's my hours 01:00, 05:00, 08:00, 10:00, 07:00 and 09:00
I want the sum type varchar2 hours how to do? and I want to display the sum is greater than 24:00Well, first of all you have posted your question in the wrong forum. You should have posted your question in the forum SQL and PL/SQL .
The second problem I see is that you are being too generic when you have your employees enter their night shift hours worked. If you are able, I recommend that you change your table to record hours separately from minutes and make columns of type NUMBER instead of the VARCHAR2() type. Then, you can simply use arithmatic to total the hours and minutes worked.
If you are locked in your table and cannot change it, you can convert characters to numbers and then perform your basic arithmatic on values. For example:
1 with tab1 as ( 2 select 10 as empno, '01:00' as nightshifthrs from dual union all 3 select 10 as empno, '05:00' as nightshifthrs from dual union all 4 select 10 as empno, '08:00' as nightshifthrs from dual union all 5 select 10 as empno, '10:00' as nightshifthrs from dual union all 6 select 10 as empno, '07:00' as nightshifthrs from dual union all 7 select 10 as empno, '09:00' as nightshifthrs from dual) 8 select sum(to_number(replace(nightshifthrs,':','.'))) AS hours_worked 9* from tab1 SQL> / HOURS_WORKED ------------ 40 SQL>
Of course, if your users can and do enter the minutes, then which complicates the example I provided. You will need to convert the decimal minute, sum the amount, then convert the decimal time and add this to your hours. For example:
1 with tab1 as ( 2 select 10 as empno, '01:15' as nightshifthrs from dual union all 3 select 10 as empno, '05:00' as nightshifthrs from dual union all 4 select 10 as empno, '08:30' as nightshifthrs from dual union all 5 select 10 as empno, '10:00' as nightshifthrs from dual union all 6 select 10 as empno, '07:45' as nightshifthrs from dual union all 7 select 10 as empno, '09:00' as nightshifthrs from dual) 8 select sum(to_number(substr(nightshifthrs,1,2))) + SUM(to_number(SUBSTR(nightshifthrs,4,5)))/60 9* from tab1 SQL> / HOURS_WORKED ------------ 41.5 SQL>
I hope this helps.
Craig...
-
Question about the SUM of numeric fields
Hey all,.
I hope I posted this in the appropriate forum (this could probably go in the forum of the JS as well and if so, please excuse me.)
My question:
I have a mileage monthly log with a field where the user enters the odometer of the vehicle beginning reading (this is a MANDATORY FIELD) at the beginning of the month, OR when the vehicle is used first.
I have then 31 fields below corresponding to the days in a month with each field containing the odometer of END of reading for that day. If the vehicle has not been used for a particular day, the day field would be empty. At the bottom would be a field "total miles". For example, the data must be like this:
Beginning mileage: 111 111
1st 111 200
2nd 111 300
3rd
4 112 000
5 112 300
6th
7 113 000
...
...
...
31 114 100
MILEAGE TOTAL 2 989
'Total mileage' = 'Start mileage' LESS ' reading of the odometer of the 31st day AKA the LAST ENTRY for MONTHS.
That is my question. How can I make the "mileage" field be dynamic? Say that the vehicle was used from the 5th through the 10th, how can I have the "mileage" field display the odometer reading?
If all goes well, I explained this well enough for someone to help me and any help will be greatly appreciated.
Hello
It is an example where FormCalc has an advantage over JavaScript. There are built in functions in FormCalc for maximum and minimum values.
In the total mileage, you could set up two variables, one for Max and the other for minutes and then subtract.
var maxMiles = Max(mileage[*]) var minMiles = Min(mileage[*]) $ = maxMiles - minMiles
This is based on the script to calculate the total field event. It depends also how you have configured the table. If the lines have the same name: for example Row1 [0], Row1 [1], Row1 [2],... Row1 [30] and the mileage field is named the same in each line, then the script may look like:
var maxMiles = Max(Row1[*].mileage[*])
Hope that helps,
Niall
-
Beginner problems - how to make the sum of the lists in a drop-down table
Hello
Please forgive my newness but I'm creating a table with 10 + lines and columns and need to calculate the sum of the columns. The user must select a number from a drop-down list and I would like to summarize these nbumbers at the bottom of the column, seems simple enough...
I have named each cell in the links tab but can't seem to find the script of the sum on the right. I just started using livecycle and have had a good experience so far.
I wish it was like excel where you just need to click or highlight the cells you want to summarize and do with it but I can't seem to find the easy button...
You can not simply highlight a column, name it and then use that name in a script to sum?
Thanks a lot for all the help and I have looked around, but can't get a grip on this one, so I apologize if this is requested before.
Go easy on me.
You have to be very accurate with referencing the fields or the formulas will not work. If you have renamed the fields of their default values, then you should reference them as you named the.
Here's an example of my hierarchy, called as you explained:
In this case, the use of scripts on the Total field will look like this:
this.rawValue = (Row1.A1.rawValue * 1) + (Row2.B1.rawValue * 1) + (Row3.C1.rawValue * 1) + (Row4.D1.rawValue * 1);
So that when I switch to preview, it behaves correctly:
-
How to make the sum of the two values in the text boxes?
Hi people,
Am a beginner in oracle 9i with forms 6i forms.using. I want to add two values in two text boxes and the result should be displayed in the third text box.
How to write code in when the button is pressed the trigger of a push button? pls suggest me.
Concerning
VIDSI have not problem
Better you recreate the new formBlock3
1 button
2. item1
3 item2
4 point 3.every article must be in a canvas
what button to trigger
writing and code test it again.give point 1 only
give point 2 only
Now press the button
output should on the 3rd point.Check and return back.
Iqbal
-
How to calculate the limits of dynamic range based on a value
Hi all, I need to create a function that accepts as parameters:
Ticket_id NUMBER
NUMBER fluctuation
Resolution_time NUMBER
For each Ticket_id, the function should calculate the Resolution_time who "go time" according to the Fluctuation_ratio.
For example:
Ticket_id = 12
Fluctuation_ratio = 0.5
Resolution_time = 1.6 (hours)
The fluctuation_ratio said that the range increased by 0.5 hours each time. So in this example, it must consider lines like these:
"0-0, 5 h'"
"0,5- 1 h"
1 to 1.5 h'
'1.5 to 2 h'
..........
So the function must return the string: * "1.5 to 2 h."
If the fluctuation_ratio was 3, the lines had to be:
"' 0 - 3 hours"
3 6 h"
6 9 h'
9 12 h'
..........
and the function should return the string: *'0 - 3: "*"
Anyone know how I can achieve this? Is there an analytic function which calculate each time the lower and the upper limit of the range 'hour '?
Thanks in advance, any help will be appreciated
AlexHello
Here's a function that does what you requested:
CREATE OR REPLACE FUNCTION resolution_range ( in_fluctuation IN NUMBER , in_resolution IN NUMBER ) RETURN VARCHAR2 DETERMINISTIC IS low_val NUMBER := in_fluctuation * FLOOR ( in_resolution / NULLIF (in_fluctuation, 0) ); return_txt VARCHAR2 (4000) := TO_CHAR (low_val) || '-' || TO_CHAR (low_val + in_fluctuation) || 'h'; BEGIN RETURN return_txt; END resolution_range ;
I tested it using this query:
WITH test_data AS ( SELECT 12 AS ticket_id, .5 AS fluctuation_ratio, 1.6 AS resolution_time FROM dual UNION ALL SELECT 13, 3, 1.6 FROM dual ) SELECT test_data.* , resolution_range (fluctuation_ratio, resolution_time) AS range FROM test_data ;
and got this output:
TICKET_ID FLUCTUATION_RATIO RESOLUTION_TIME RANGE --------- ----------------- --------------- -------------------- 12 .5 1.6 1.5-2h 13 3 1.6 0-3h
-
How to take the sum of a cluster
Hey Im trying to convert a matlab code in labview and I came across this issue with clusters. can anyone help?
Let's say that:
[Pxx, w] is periodogram (mydata, [], [], var]
Time = Sum(mydata.^2) /length (mydata)
FREQ = Sum (Pxx)
Pxx = Pxx * time/frequency
Pxx = sqrt (Pxx)
LogLog (w, Pxx)
I managed to make the PSD of mydata and translate code time labview...
But how to make the sum of the Pxx which is clearly going to be a cluster of 3 elements (magnitude, df, f0)... Help?
My point exactly! I therefore decided to unbundle the Psd with the sum of the elements of the array size. He then rebundle with f. and don't know if it will work DT...
-
How to calculate the sum of two digital form fields based on the selection of the checkbox.
I have a form in Acrobat Pro who needs a custom calculation. How to calculate the sum of two digital form fields based on a selection of the checkbox. I have three number fields. Field-A and B are simple one or two digits. Field-C is the sum, or the total field. I want to field-C have a control box which, when turned on and off, just gives a. gives the sum of A + B
_ Field - 2
_ Field - A 4
[check] _ _ field - 6 C
[disabled] _ _ field - 2 C
Thank you
The custom field C calculation script could be:
(function () { // Get the values of the text fields, as numbers var v1 = +getField("A").value; var v2 = +getField("B").value; // Set this field's value based on the state of the check box named "CB" if (getField("CB").value !== "Off") { event.value = v1 + v2; } else { event.value = v1; } })();
Replace 'A', 'B', and 'CB' with the real names of the fields.
-
How can I make the popup with empty fields and create new record?
I would use a popup create new record.
I created an af:popup drag and drop a data control VO in jsff. Then, I created a button and place an af:showPopupBehavior. I was able to pop-up window by clicking on the button.
However, the window filled with information from the record 1. and when I select a record in the table and click on the popup, the popup is filled with this record.
How can I make the popup with empty fields and create a new record by recording the popup?
Thank youHello
You must call the CreateInsert for the underlying ViewObject operation when opening the popup because it does not allow to clear the input field, you must have a new record created
Frank
-
How to make a sum of text_field or column with where condition?
Hi all
In Oracle forms 6i, I created a form in which there are 5 text_Items (with 20 none of the displayed fields) namely ACCOUNT FD DO, AMOUNT, INTEREST RATE, STATUS and INTEREST_YEAR.
FD ACCOUNT NO.
AMOUNT
INTEREST RATE
STATUS
INTEREST_YEAR
47665
50000
- 11.5
E
5750
37463
60000
12
D
7200
47651
100000
- 12.5
D
12500
34766
70000
11
E
7700
I want to make the sum of the INTEREST_YEAR where status = 'E '.
I created a TOTAL_INTEREST_YEAR name field in which I want to display the sum.
How the sum with where condition?
Thank you.
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
Oracle form Builder 6i.
Michael,
When you write the formula for a calculated item, it does not use PL/SQL expressions (to include built-in DECODING) in Forms 6i. If there was no conditional control over your calculation, you can simply make your article a summary point and perform the summation over column interest_rate . However, because your calculation depends on the value in the STATUS column, you will need to use a combination of a calculated item and a summary article because you can't use an IF, DECODE or any other PL/SQL statement in the formula for the calculated item. Therefore, you need to create a function in the knot of program units and call the function in your formula. I tested it using the following code and it worked correctly.
First, create the following function in the node of the object browser program units.
FUNCTION calc_interest RETURN NUMBER IS n_ret_val NUMBER := 0; BEGIN IF ( :YOUR_BLOCK.STATUS = 'E' ) THEN n_ret_val := :YOUR_BLOCK.interest_rate; END IF; RETURN n_ret_val; END calc_interest;
First, you must change the property to BLOCK request all archives = Yes
Then, open the palette of your calculated item property, and set the following properties:
1. calculation = Formula
2 property Forumla = CALC_INTEREST
3. point data base = No.
Now create a second item in the table not based on in your block that will display the amount of the interests summarized. Open the palette property for this element and set the following properties:
1 Data Type = number
2 calculation Mode = Summary
3. function = sum
4 summarizes point = "name of your element calculated.
5 base of data point = No.
6 canvas = "your canvas.
When you query your block, you should see the sum of all records where STATUS = 'E '.
It worked for me, in my example form that I created so this should work for you.
Craig...
-
How to change the color of form fields
I don't know how to change the color of form fields. They default to gray, but I don't know how to make a different color.
Gray does not match the color scheme of my landing page!
Thank you!
I think you have two options when you are working on a landing page with an embedded format:
- You can change the background color of the entire form field set by selecting the shape, and then clicking on the Toolbox. In the window that opens go to the second (on a paint brush icon) and select the background color you want.
- You can change the background color of the actual fields in the form by adding CSS styles. Select the Toolbox, go to the last tab (Tools Extract page) and in the middle of this window, you will see "head | CSS | JS"- select this average CSS tab and enter the style code to get the color you want. Here is an example of code you can put in it. Note that #000000 is the color code for black. Here is more information about the code: css - background in the input fields and text color? - stack overflow
-
Can you please tell me how to make the thicker arrows on the Pages.
Can you please tell me how to make the thicker arrows on the Pages. Thank you very much. There is something incredibly simple to do, but I, having a disconcerting brain, am totally unable to understand. Please please help me. Thank you
< re-titled by host >
Try here > Pages for Mac: Add and edit forms
-
When I open a new tab, NO best sites don't show up... shows just a search engine box. I have Firefox 33.0. Why is there no 'pin' button when I opened a new page? How to make the top sites page appears when I open a new tab?
Here is some additional information on the configuration of the new tab page:
(1) in a new tab, type or paste Subject: config in the address bar and press ENTER. Click on the button promising to be careful.
(2) in the search above the list box, type or paste newtab and make a pause so that the list is filtered
(3) double-click the preference browser.newtab.url and enter your favorite page:
- (Default) page thumbnails = > subject: newtab
- Blank tab = > subject: empty
- Built-in Firefox homepage = > topic: welcome
- Any other page = > full URL of the page
Press Ctrl + t to open a new tab and check that it worked. Fixed?
Some traps:
If Firefox will not let you change this setting: you can have what is called SearchProtect on your system.
Firefox if allows you to save your changes, but he doesn't know: one of your extensions may be the substitution of her. You can consult, disable and/or remove extensions on the addons page:
"3-bar" menu button (or tools) > Add-ons > in the left column click on Extensions
If the modification works during your session, but during the next startup is leads to: you could have a user.js file in your personal settings Firefox (your Firefox profile folder). This article describes how to track down and delete the file: How to fix preferences that will not save.
A little luck?
-
I have associated my pencil to Apple for the iPad Pro; But how to make the Widget of batteries displayed on the notification Center 'today '?
See if it works. Scroll to the bottom of the list in the display today. Tap on edit. Press on the + sign next to battery.
Maybe you are looking for
-
iMovie 06 hd will not show some fonts in the font book
Using iMovie 06 HD for some reason accurate but cannot get some of the fonts used in the book of the fonts on the computer. IMovie 09, same problem checked. Ant ideas?
-
Adding photos to my ipad air 2 computer?
Hello How do I add photos to my ipad from pc air? I'm puzzled.
-
I thought that the wifi is always enabled when activated? Is there a setting that I need to activate to prevent disabling when my phone goes to sleep and the screen is automatically locked wifi? I can't find any installation for her I need some app w
-
Problems with DAQmx - tasks missing when I run my application on another PC
Hello I use a NI USB 6009 and my program use DAQmx and different tasks for the input and output signal. I created an application and I want to run this application on another PC, which doesn't have the development environment, but the runtime engine
-
Slimware utilities is legitimate?
I was taken in slimware to update the drivers. Is - is this legitimate? Or is there a better and more confident upadate way. Thank you