How can I sum values over a date range?
I want to sum values (revenue) for a range of dates (i.e. for each month). I'm trying to use the MONTH function nested in SUMIF and keep getting an error message. I want it to be SUMIF( MONTH (column of dates), cell with month, column with revenue) and it tells me "all ranges must be the same size". It works if I create a separate column where I extract the month from each date and then compare that to a column with the number of the month, but that is really annoying.
You can use the sumif() function to compute the sum of revenues after the "End Date", the sum of revenues before some date and you can use the sum function to summ all revenue. Then you can combine these into a single formula to get the answer by:
sum between two dates is:
sum("of all revenue") - sumif("before date") - sumif("after date"
Cell B4 of the smaller table =SUM(Revenue)-SUMIF(Date, "<"&B1,Revenue)-SUMIF(Date, ">"&B2,Revenue)
I highlighed cells to show before and after dates to highlight the sumif("after") and sumif("before")
Similar Messages
-
How can I sum the values in a given column on sheet 1 i.e. A1:A50 based on the adjacent columns specific value i.e. B1:B50 = “Dinning Room” on sheet 2
For Example:
SHEET 1
A
B
$50
Dinning Room
$800
Dinning Room
$300
Kitchen
$1,000
Master Bedroom
$100
Dinning Room
SHEET 2
Display the total SUM amount of each Project based on Sheet 1
Project Name
Total Cost
Dinning Room
$950
Kitchen
$300Would be a good idea to open iWork Formulas and Functions User Guide and search for the description of the function named SUMIF
The Guide is available for every user thru the Help menu.
Yvan KOENIG (VALLAURIS, France) jeudi 19 mai 2011 17:32:42
Please :
Search for questions similar to your own before submitting them to the community
To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer ! -
How can I make a query by date with several TDMS files?
Hi,
I have a project that can write and read TDMS files everyday (a file for each day with date and time). There, I can import those files to excel (I choose a file and load it). But, I have a question: How can I make a query by date with those TDMS files? I'd like make a time stamp for start date and stop date, where I could compare the TDMS file dates and sum the values that are in the channels where these files are similar. For example, I save a file with "02/01/2013" name, in other day "03/01/2013", in other day "04/01/2013"... so, i'd like put in time stamp for start date "02/01/2013" file and to stop date "04/01/2013" file, than, sum all values that range with my TDMS files existing. How can I make that?
Thanks all,
ValHello Val_Auto.
You're Brazilian, no? Me too. = ^ - ^ =
I converted VI to version of your LabVIEW (8.5). Is attached in this reply.
This VI search all your TDMS in a range of dates and join them in a single TDMS. I hope this is what you wanted.
Query TDMS is the main VI. The TDMS VI Search changes the date format that out from calendar control (which is DD / MM / YYYY) to DD-MM-YYYY. This is because you can't name files using "/". I chose "-" but, if necessary, you should change to keep the same format of your TDMS files.
If you have any doubt as to its operation or how to make changes to adapt VI for your application, keep at your disposal.
Thank you for your contact; I hope have helped you and succeed in your application.
Wesley Rocha
Application Engineer
National Instruments Brazil
Visite a nossa comunidade em PORTUGUÊS!!!
Attachments:
Query TDMS.vi 62 KB
tdms search.vi 24 KB -
How can i sum the columns by condition?
ID Type QTY
1 A 20
2 A 20
3 B 20
I want to some QTY group by A but I also need the ID column to identify the order of row.
How can I sum QTY group by A and the result is sort by ID ?
Thanks youWhats your expected output?
Is this the below?
Create Table test(id int,[Type] char(1), QTY int)
Insert into test Values(1,'A',20),
(2,'A',20),
(3,'B',20)
SElect *,SUM(qty)Over(partition by Type) From test Order by id
Drop table test -
How can I sum all the amount per line?
HI,
How can I sum all the amount per line?
EXAMPLE:
[code]
TOTAL:
1,000 2,000 5,200 $8,200
400 1,200 6,000 7,600
[/code]
THANKS!!If you are sure of the number of columns that you are gonna get then you can add them to a variable and display.
total = itab-col1 + itab-col2 + itab-col3.
If you dunno how many columns will come , you have to use field symbols.
Say the datatabse table has 16 columns which will contain your price and you have to calculate the sum of all those , then assign them to field symbols and calculate.
Have a look at the following code.
FORM GET_VALUES_FROM_COSS .
FIELD-SYMBOLS: <FS1> TYPE ANY.
DATA: V_COMPONENT1 TYPE I.
V_COMPONENT1=31. " your field of table from which amount field starts
Cumulate the posting values of all the 16 period buckets as to get
total production order cost. This is to handle the partial posting of
production order values in different periods.
DO 16 TIMES.
ADD 1 TO: V_COMPONENT1.
ASSIGN COMPONENT V_COMPONENT1 OF STRUCTURE COSS TO <FS1>.
IF COSS-WRTTP EQ '05' AND COSS-KSTAR EQ C_KSTAR1.
ADD <FS1> TO I_FINAL-PL_LABCOST.
ELSEIF COSS-WRTTP EQ '04' AND COSS-KSTAR EQ C_KSTAR1.
ADD <FS1> TO I_FINAL-ACT_LABCOST.
ELSEIF COSS-WRTTP EQ '05' AND COSS-KSTAR EQ C_KSTAR2.
ADD <FS1> TO I_FINAL-PL_MATCOST.
ELSEIF COSS-WRTTP EQ '04' AND COSS-KSTAR EQ C_KSTAR2.
ADD <FS1> TO I_FINAL-ACT_MATCOST.
ELSEIF COSS-WRTTP EQ '05' AND COSS-KSTAR EQ C_KSTAR3.
ADD <FS1> TO I_FINAL-PL_OPCOST.
ELSEIF COSS-WRTTP EQ '04' AND COSS-KSTAR EQ C_KSTAR3.
ADD <FS1> TO I_FINAL-ACT_OPCOST.
ELSEIF COSS-WRTTP EQ '05' AND COSS-KSTAR EQ C_KSTAR4.
ADD <FS1> TO I_FINAL-PL_FACCOST.
ELSEIF COSS-WRTTP EQ '04' AND COSS-KSTAR EQ C_KSTAR4.
ADD <FS1> TO I_FINAL-ACT_FACCOST.
ELSEIF COSS-WRTTP EQ '05' AND COSS-KSTAR EQ C_KSTAR5.
ADD <FS1> TO I_FINAL-PL_LABCOST.
ELSEIF COSS-WRTTP EQ '04' AND COSS-KSTAR EQ C_KSTAR5.
ADD <FS1> TO I_FINAL-ACT_LABCOST.
ELSEIF COSS-WRTTP EQ '05'.
ADD <FS1> TO I_FINAL-OTHER_PL_COST.
ELSEIF COSS-WRTTP EQ '04'.
ADD <FS1> TO I_FINAL-OTHER_ACT_COST.
ENDIF.
ENDDO.
ENDFORM. " GET_VALUES_FROM_COSS
Let us know if u need more inputs -
How can I sum durations in Numbers 3.1?
How can I sum durations in Numbers 3.1?
"For some crazy reason, that worked!"
The "crazy" reason was that 0h 0m can'r be mistaken for the time part of a Date and Time value. If you give Numbers values that are clearly durtations, no matter what format the cell is set to, then Numbers will interpret those value correctly.
Regards,
Barry -
How can we get Dynamic columns and data with RTF Templates in BI Publisher
How can we get Dynamic columns and data with RTf Templates.
My requirement is :
create table xxinv_item_pei_taginfo(item_id number,
Organization_id number,
item varchar2(4000),
record_type varchar2(4000),
record_value CLOB,
State varchar2(4000));
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
select * from xxinv_item_pei_taginfo;
Item id Org Id Item Record_type Record_value State
493991 224 1265-D30 USES fever TX
493991 224 1265-D30 HOW TO USE one tablet daily TX
493991 224 1265-D30 SIDE EFFECTS XYZ TX
493991 224 1265-D30 DRUG INTERACTION ABC TX
493991 224 1265-D30 OVERDOSE Go and see doctor TX
493991 224 1265-D30 NOTES Take after meal TX
Above is my data
I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
its a BI Publisher report.
please suggestif you have data in db then you can create xml with needed structure
and so you can create bip report
do you have errors or .... ? -
How can I get values from listbox?
Hi all,
I need to get price values from Price List (Inventory -> Item Master Data screen). It's important to get values from field 'Price' BEFORE item will be added/updated.
How can I get values from Pricelist listbox?
Thanks for any suggestions or short sample code.
Best regards,
AndyHi Andy
Here is som sample code that will get the description of the price list and also the price that is displaying at the time. The item master must be open for this snippet of code
Public Sub GetItemPriceFromOpenWindow()
'this is assuming item master is open
Dim oEdit As SAPbouiCOM.EditText
oEdit = SBO_Application.Forms.GetForm("150", 1).Items.Item("34").Specific
SBO_Application.MessageBox(oEdit.Value)
Dim oCmb As SAPbouiCOM.ComboBox
oCmb = SBO_Application.Forms.GetForm("150", 1).Items.Item("24").Specific
SBO_Application.MessageBox(oCmb.Selected.Description)
End Sub
Hope it helps -
How can I sum up raws? the Sum function seems to work only on columns. Right now I have to create a separate formula for each raw
Hi dah,
"Thanks, but can I do one formula for all present and future raws? as raws are being added, I have to do the sum function again and again"
You do need a separate formula for each group of values to be summed.
If the values are in columns, you need a copy of the formula for each column.
If the values are in rows, you need a copy of the formula for for each row.
If you set up your formulas as SGIII did in his example (shown below), where every non-header row has the same formula, Numbers will automtically add the formula to new rows as you add them.
"Same formula" in this context means exactly the same as all the formulas above, with one exception: the row reference in each formula is incremented (by Numbers) to match the row containing the formula.
Here the formula looks like this in the three rows shown.
B2: =SUM(2)
B3: =SUM(3)
B4: =SUM(4)
That pattern will continue as rows are added to the table.
Also, because the row token (2) references all of the non-header cells in row 2, the formula will automatically include new columns as they are added to the table.
Regards,
Barry -
How can I pass a Presentation Variable (Date) into a prompt
Hello
How can I pass a Presentation Variable (date) into a prompt? I seem to be able to do this successfully for a non-date value but have had no luck with a Date variable.
Here's a simplistic version of what I'm trying to do:
1. I have a Presentation Variable called startDate which is a Date that defaults to this SQL - SELECT "Reporting Dates"."Measure Date" FROM Trading WHERE "Reporting Dates"."Date Name" = 'Current'.
2. I now want to pass this variable into a prompt with SQL like this: SELECT "Position Date"."Position Date" FROM Trading where "Position Date"."Position Date" = date'@{startDate}{2009-04-24}'
I get this error: Datetime value @{startDate}{2009-04-24} from @{startDate}{2009-04-24} does not match the specified format.
Now I can use the exact same syntax in a filter. For example, a simple Answers request where I pick Position Date with a filter saying "Position Date"."Position Date" = date'@{startDate}{2009-04-24}' works fine.
What am I doing wrong?
Thanks!Can you provide more information please?
1. What is the format of the first date prompt, is it YYYY-MM-DD or?
2. Which data type is Position Date."Position Date" in the physical layer, date or date time?
3. What is the column formula in the first prompt?
4. The first prompt is set to drop-down or?
5. If you are using this SQL Results in the second prompt:
SELECT "Position Date"."Position Date" FROM Trading where "Position Date"."Position Date" = date '@{startDate}{2009-04-24}'
then @{startDate} must be in YYYY-MM-DD format to work properly, otherwise (for example):
datetime value 01/01/2000 from 01/01/2000 does not match the specified format.
This doesn't work for example:
SELECT Times.time_id FROM "Normal model" where Times.time_id =date '01/01/2000'
Regards
Goran
http://108obiee.blogspot.com -
How to get maximal value from the data/class for show in Map legend
I make WAD report that using Map Web Item.
I devide to four (4) classes for legend (Generate_Breaks).
I want to change default value for the class by javascript and for this,
I need to get maximal value from the class.
How to get maximal value from the data/class.
please give me solution for my problem.
Many Thx
Eddy Utomouse this to get the following End_date
<?following-sibling::../END_DATE?>
Try this
<?for-each:/ROOT/ROW?>
==================
Current StartDate <?START_DATE?>
Current End Date <?END_DATE?>
Next Start Date <?following-sibling::ROW/END_DATE?>
Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
================
<?end for-each?>
o/p
==================
Current StartDate 01-01-1980
Current End Date 01-01-1988
Next Start Date 01-01-1990
Previous End Date
================
==================
Current StartDate 01-01-1988
Current End Date 01-01-1990
Next Start Date 01-01-2005
Previous End Date 01-01-1988
================
==================
Current StartDate 01-01-2000
Current End Date 01-01-2005
Next Start Date
Previous End Date 01 -
How can I insert values from table object into a regular table
I have a table named "ITEM", an object "T_ITEM_OBJ", a table object "ITEM_TBL" and a stored procedure as below.
CREATE TABLE ITEM
ITEMID VARCHAR2(10) NOT NULL,
PRODUCTID VARCHAR2(10) NOT NULL,
LISTPRICE NUMBER(10,2),
UNITCOST NUMBER(10,2),
SUPPLIER INTEGER,
STATUS VARCHAR2(2),
ATTR1 VARCHAR2(80),
ATTR2 VARCHAR2(80),
ATTR3 VARCHAR2(80),
ATTR4 VARCHAR2(80),
ATTR5 VARCHAR2(80)
TYPE T_ITEM_OBJ AS OBJECT
ITEMID VARCHAR2(10),
PRODUCTID VARCHAR2(10),
LISTPRICE NUMBER(10,2),
UNITCOST NUMBER(10,2),
SUPPLIER INTEGER,
STATUS VARCHAR2(2),
ATTR1 VARCHAR2(80),
ATTR2 VARCHAR2(80),
ATTR3 VARCHAR2(80),
ATTR4 VARCHAR2(80),
ATTR5 VARCHAR2(80)
TYPE ITEM_TBL AS TABLE OF T_ITEM_OBJ;
PROCEDURE InsertItemByObj(p_item_tbl IN ITEM_TBL, p_Count OUT PLS_INTEGER);
When I pass values from my java code through JDBC to this store procedure, how can I insert values from the "p_item_tbl" table object into ITEM table?
In the stored procedure, I wrote the code as below but it doesn't work at all even I can see values if I use something like p_item_tbl(1).itemid. How can I fix the problem?
INSERT INTO ITEM
ITEMID,
PRODUCTID,
LISTPRICE,
UNITCOST,
STATUS,
SUPPLIER,
ATTR1
) SELECT ITEMID, PRODUCTID, LISTPRICE,
UNITCOST, STATUS, SUPPLIER, ATTR1
FROM TABLE( CAST(p_item_tbl AS ITEM_TBL) ) it
WHERE it.ITEMID != NULL;
COMMIT;
Also, how can I count the number of objects in the table object p_item_tbl? and how can I use whole-loop or for-loop to retrieve values from the table object?
Thanks.Sigh. I answered this in your other How can I convert table object into table record format?.
Please do not open multiple threads. It just confuses people and makes the trreads hard to follow. Also, please remember we are not Oracle employees, we are all volunteers here. We answer questions if we can, when we can. There is no SLA so please be patient.
Thank you for your future co-operation.
Cheers, APC -
how can i get acsess to my data if my iphone is shut and can´t open any more??how can i get acsess to the memory card????please help
You can't. There is no memory card. It uses flash memory that's soldered to the logic board. If you didn't back it up, your data is gone.
-
How can we update the last synchronization date and time..on SUP in sccm 2012 R2
Hi,
Can you any one please guide me how can i update the last synchronization date & time in SUP on SCCM2012 r2 , some how its updated as future date and when ever i try to synch the SUP with disconnected WSUS its shows in the wsyncmgr.log
"Wakeup for a polling cycle " and " Wakeupby inbox drop" and "Wakeup by SCF change"
Thanks
Balaji KYou'll probably have to call CSS on this one as this not normal by any means. The messages you noted above are completely normal but if that's all you are seeing then there's an issue.
Have you reviewed wcm.log and wsusctrl.log?
Jason | http://blog.configmgrftw.com | @jasonsandys -
HT2486 how can I export the contact book data to a csv file for editing?
how can I export the contact book data to a csv file for editing?
You can edit a card right in Contacts. No need to export and re-import.
Select a name and on the right side, click the Edit button:
Maybe you are looking for
-
Also, does anyone know if I can boot from the new intel mini's HD using my 12" PowerBook's keyboard and screen? If so, then I would deffinitely reconsider buying a MacBook Pro now and wait for it to have a better optical drive. Thanks for your posts
-
Calling Multiple forms for a single Output Type in Smartforms
Hi SAP Gurus.. I want to call 2 smartforms simultaneously for a Single O/P type. But the problem is that My Driver Program in Standard. I cannot edit the Driver form. Whatever I need to do I can do it only in the Smartforms. Please help me out in thi
-
How do i save image as a Jpeg?
I cant work out how to save my image so i can print it!!
-
Resetting the Registry so other Users have full access to Flash Player 9
Does anyone have a solution for fixing the registry after installing FP9, so all users can have full access to it. I found this site http://www.donglefree.com/toppage1.htm to fix the installation problem, (and it worked perfectly), but now all other
-
Intermittend connection problem from J2EE (separate) engine to ABAP
When i run the test report FP_CHECK_DESTINATION_SERVICE the first time it works and returns the number of bytes transmitted. The second time it does not . The third time it works , the fourth time it does not etc etc etc No matter how long I wait in