Daily total / annual average query

Hi,
I am trying to write a report to calculate the daily total & annual average for 2008 for students still on site.
In the database I have a View that contains the start date and end date for every student, but I dont know how to calculate what I want. 
For some days there will be no students, for other there could be many.  Some students are on site for 1 day and other are on site for several months.  I have no idea where to start with this one so any help is very much appreciated.
Thanks,

Hi Kieran,
You should be able to create a formula in the format
if {@start_date} >= '01/01/2008' then {@start_date} else '01/01/2008'
Regards
Alan

Similar Messages

  • Calculate total and average for same key figure

    Hi Experts,
    I have a requirement where I need to calculate total and average for same key figure no of employees.
    eg:                
    If I enter 03,2009 as Input the reuslt should give from financiual year starting to current month.
         11.2008      12.2008     1.2009     2.2009     3.2009        average
             11          10       12       10        10         10.6
             10         10       11       12        10         10.6
    total         21         20       23       22        20          21.2
    we have only one characteristic in rows... companycode.
    Waiting for your Inputs.
    Regards
    Prasad Nannuri

    no it will work for u
    you have to use variable on 0calmonth or fiscal period depending on what Time characteristic u are using.
    lets say that variable is zcalmonth
    it is based on 0calmonth for e.g.
    now u restrict keyfigure with this variable zcalmonth with time char. = 0CALMONTH
    copy and paste the restricted keyfigure
    now set offset for variable in  variable selection screen dialog box = -1
    repeat this until u want
    make this variable mandatory
    now at query execution user will select any value for month/year
    and u will see all 5 months in result set
    now there can be maximum 12 months in a year, so u end up creating only 12 restricted keyfigures.
    use YEAR in restricted keyfigure too, and restrict it with YEAR VARIABLE processing by CUSTOMER EXIT = CURRENT YEAR
    in this case it will automatically removes any additional values...
    for e.e.g
    YEAR = 2008 only
    User entered 6/2008
    so lets say ur financial year starts in  april 2007 and ends in april 2008
    so u expect to see
    4/08
    5/08
    6/08
    but u created 12 restricted keyfigures , so it will show upto
    4,5,6 months only

  • How to Round on Daily bases in a Query.

    Hi All,
    I have a query which sum the columns between two dates I want to round the sum on the daily bases. My query is written below.
    SELECT sum(S_QTY * S_RATE), sum(S_QTY * S_TOT)
    FROM SAUDA
    WHERE S_PARTY = 'A080' AND S_CITY = 'Z' AND S_TYPE = 'S' AND S_BILL_TYPE = 'd' AND
    S_DATE BETWEEN '2005-03-30-00.00.00' AND '2006-03-31-00.00.00' AND UPPER(S_CITY) != 'F';
    SUM(S_QTY*S_RATE) SUM(S_QTY*S_TOT)
    3700 2.775
    What I want is to round the sum on daily bases, means the values which I am getting is the total sum but not the individual dates. Try to help me.
    SKM

    Try this:
    SELECT sum(round(S_QTY) * S_RATE), sum(round(S_QTY) * S_TOT)
    FROM SAUDA
    WHERE S_PARTY = 'A080' AND S_CITY = 'Z' AND S_TYPE = 'S' AND S_BILL_TYPE = 'd' AND
    S_DATE BETWEEN '2005-03-30-00.00.00' AND '2006-03-31-00.00.00' AND UPPER(S_CITY) != 'F';
    I hope this will solve ur problem.

  • Calculating Percent totals and Averages in SSRS

    Below is a report created using SSRS. I want to be able to calculate the percentage(%) total to add up to 100 % in the Total column. For some reason my averages are not working as you can see from the table. The idea is to calculate the averages of opportunities
    as well as Sold. But from my calculation, things are not adding up as I supposed. This report is not grouped by parent. How do I make this to work as it should? Thank you.
    (NB: Please zoom in to view the image)
    Zionlite

    Hi,
    According  to the description, I doubt you may manually add Total and Averages columns. Did you manually add Local and International or they were in a column group?
    You can use the following expression for the Opportunity Cost(averages) column in the total row:
    =Sum(Fields!opportunitycost.Value)/2
    How did you calculate the percentage column? If it is Sold value divided by Opportunity Cost value, use:
    =Sum(Fields!sold.Value)/Sum(Fields!opportunitycost.Value)
    Also try to define the scope in the expression and see if it make difference.
    If there is no progress, please capture the screenshot of your design tab.(Click on the report and capture the image of your report structure)
    Also, tell us the expression of the text box which in problem.
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Total of average

    Hello. I am a simple discoverer report which has 3 columns:
    'Product' and 'Cost' and 'Average Cost'
    The 'Product' and 'Cost' columns are summation columns straight from a business area, that is produced from a table:
    SUM(Product), SUM(Cost)
    The 'Average Cost' column is the follwing Calcuation:
    AVG(Cost).
    The average caculates properly.
    However when I try to total the 'Average Cost' column, the total does not calculate properly.
    Is there any way to fix this?

    If I'm understanding you correctly, you have something like
    product line A
    units 50
    cost 1000
    average cost 20
    product line B
    units 10000
    cost 100000
    average cost 10
    and you want the average cost across all products, which is (101000/10050), which is about 10.05.
    So what are you doing, and what result do you get?
    -- jim

  • Daily total production details

    Dear experts
    As per DSA we can easily take single item wise production and Delivery details.
    But our customer needs to take daily total production report that also mandatory for excise department.
    Is SAP provide any report for this?
    warm regards

    Dear Experts
    DSA and Total Production daily wise both format  is same.  Actual  DSA  report will be given per Item wise report.
    But My customer requirement is same format but it has to be show total numbers production , total numbers sales and total excise duty every day.
    how to change the selection criteria to this?
    regards

  • POS system reports daily totals for each store, not for each cashier

    Hi!
    We are implementing SAP Retail (ERP 6.0 EHP4 stack 3), SAP PI (Netweaver PI 7.1 SP 8) and SAP BW (NetWeaver 7.0 ehp1 stack 4, incl BI content 704, SP 3 ) for a client. Their POS system is a 3rd party system, i.e. not SAP POS.
    This issue concerns the fact that the POS system reports daily totals for each store, not for each cashier.
    At my client, the daily settlements are done for each cashier. At the end of day, we will get cash drawers counted with sum of each tender (cash and checks) at the end of day. In addition, the POS system will send sum of each tender, sum of all sales and sum of different finance transactions made each day. However, this u201Ctotals messageu201D is not sent separately for each workstation, or for each cashier, but rather for each store. So we only gets the totals per store.
    Questions:
    i)     Are the tasks available for comparing totals to the aggregates for POS transaction able to handle u201Cstore-only figuresu201D?
    ii)     If not, how can we adapt the tasks so they can handle u201Cstore-only figuresu201D?
    iii)     Can we trigger outbound tasks sending WPUUMS and WPUTAB using outbound dispatcher automatically, or must we run this as a manual task of an employee, after checking that all stores have delivered their totals?
    iv)     The u201Cstore-only figuresu201D does not include cashier statistics. Do we need the u201Ccashier statisticsu201D as total figures, or can we just populate the BAPI for each POS transaction with data, in order to populate BW infocubes for cashier statistics?
    Thanks for any advice !
    Best regards,
    Oeystein Emhjellen

    Hi Kees ...
    Your profile indicates you are running Leopard v10.5.8
    You need to upgrade to Snow Leopard V10.6 in order to use the App Store. This is an "upgrade", not an "update".
    Make sure your Mac meets Snow Leopard's requirements here.
    You must have the minimum of v10.6.6 installed in order to access the App Store.
    You can purchase Snow Leopard here > Mac OS X 10.6 Snow Leopard - Apple Store

  • Help please: trying to post daily totals to a summary table

    Hi everyone:
    I have a problem with Numbers that I know has a simple solution, but I cannot find it.  I am tracking daily diet information that I want to post to a summary table.  I have a table, "Food Information" that contains a list of all of the daily food choices.  I can select which foods are eaten and the table calculates the daily total for calories, carbs, protein etc.  I then cut-and-paste these totals to a daily summary table that has a column for each item being tracked and a row for each day of the year. 
    I would like to be able to automate the transfer of the daily totals to the summary table.  I use the same "Food Information" table every day, but the totals change as the food choices change from day-to-day.  I cannot find a way to automatically copy the totals at the end of each day to the summary sheet without them changing the next day when the new daily totals are calculated. Any help would be appreciated.

    Wayne:
    Screenshots below.  I have removed some of the line items to simplify the tables.  Thanks for the help

  • Totals in a query

    I have the following query. I want to add totals for open qty  and open line totals in this query. How can I do it? The selection criterea will select only one customer.
    SELECT  T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T1.[ItemCode],
    T1.[Dscription], T1.[OpenQty] as [Backorder Qty],
    T1.[LineTotal] as [Row Total]
    FROM Pitkar.dbo.ORDR T0 INNER JOIN Pitkar.dbo.RDR1 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN Pitkar.dbo.OITM T2 ON T1.ItemCode = T2.ItemCode WHERE
    T1.[LineStatus] ='O' and T0.[CardCode] between [%0] and [%1]

    Hi,
    This might help also.
    SELECT 
    T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Dscription],
    sum(T1.[OpenQty]) as [Backorder Qty], sum(T1.[LineTotal]) as [Row Total]
    FROM ORDR T0
    INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
    WHERE T1.[LineStatus] ='O' and T0.[CardCode] between '[%0]' and '[%1]'
    GROUP BY T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Dscription]
    ORDER BY T0.[CardCode]
    Regards,

  • How to get total numbers and total price in query reports

    Hi,
    how to get total numbers and total price in query reports.for example:
    particular item is issued 3 times a week...I need total quantity of item issued
    my query...
    SELECT T0.[DocNum], T1.[ItemCode], T1.[Quantity], T1.[Price] FROM OIGE T0  INNER JOIN IGE1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[ItemCode]  Like '%%[%1]%%'  and  T1.[U_WOType]='[%0]'

    Hi,
    Try this:
    SELECT T1.[ItemCode], SUM (T1.[Quantity]) as [Total Quantity], SUM (T1.[Quantity] * T1.[Price]) as [Total Price] FROM OIGE T0  INNER JOIN IGE1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[ItemCode]  Like '%%[%1]%%'  and  T1.[U_WOType]='[%0]'
    Group By T1.[ItemCode]
    Beni.

  • Weekly totals via daily totals

    I am trying to have my weekly totals update as I input my daily totals. This is what I do now:
    =SUM(Daily 2010::Totals :: C16:C22)
    The only problem is when I drag down, instead of the next cell becoming C23:C29, it becomes C24-C30.
    I'd rather not have to type in, or drag selected cells, for each week.
    Thanks.

    Companion Pet Hospital wrote:
    I am trying to have my weekly totals update as I input my daily totals. This is what I do now:
    =SUM(Daily 2010::Totals :: C16:C22)
    The only problem is when I drag down, instead of the next cell becoming C23:C29, it becomes C24-C30.
    I'd rather not have to type in, or drag selected cells, for each week.
    Normal behaviour. When you move the formula down one row all cell references that are not absolute are incremented by one row.
    To increment the row reference by seven, you'll need to use OFFSET and some extra math in the formula. Here's an example. Table 1 is on the left. The formula in Table 2::B2 can be filled down by dragging the handle.
    For more about OFFSET (and the rest of the supported functions in Numbers), see the iWork Formulas and Functions User Guide. OFFSET is discussed on page 206, with description and some examples. The guide (and the equally useful Numbers '09 Users Guide) iis available through the Help menu in Numbers.
    Regards,
    Barry

  • Can anyone suggest a method whereby I can calculate a numerical value that gives the total or average power between two stated frequencies of the AutoPowerSpectrum?

    Using Measurement Studio (Vis. Basic), I'm trying to calculate as a numerical value the total or average power between two stated frequencies of the AutoPowerSpectrum. The PowerFrequencyEstimate Method gets me part of the way there. Using appropriate values of the input variables SearchFreq and Span, I divided the range between my two frequencies into 12 segments and let PowerFrequencyEstimate find the frequency and its power at the highest point in each segment. Then I added the 12 resulting powers. Since these are power values at several peaks, not average power over a given frequency range, it's not exactl
    y what I want. Do any other approaches occurr to anyone?
    Thanks.

    Most people here won't do your homework for you. If you make an attempt yourself and get stuck then post your code (wrapped in code tags for easy reading), include any errors you get and what line they occur on and most of all ask a specific question. Don't just say "It doesn't work".
    However, your assignment mentions that you are not allowed to use inbuilt C/C++ functions. This is a Java forum. Although the languages are similar and some here have C experience, try posting in a C forum.

  • Difference between 2 sub-totals in SAP query

    Hello Experts,
    Is there any possibility to find out the difference between 2 sub-totals and display it at the bottom of the ALV output( like total) in SAP Query using SQ01.
    For example: see below example(Request you to paste the below in an excel sheet for more readability).
    PRZ     25.05.2011     A 007 008 01 15     10     EA           0,00     INR          0,00     INR          2,00     INR               0,00     INR
    PRZ     27.05.2011     A 007 008 01 00     1     PC          10,00     INR          0,00     INR          0,20     INR               0,10     INR
    PRZ     27.05.2011     A 007 008 01 00     1     PC          10,00     INR          0,00     INR          0,20     INR               0,10     INR
    Sub-total               10     EA     20,00     INR          0,00     INR     2,40     INR     20     INR
                   2     PC                                        
    DRP     26.05.2011     WDB2020261X744924     1     PC          60,00     INR         50,00     INR         30,00     INR               0,00     INR
    DRP     31.05.2011     WDB2020261X744924     1     PC          60,00     INR         50,00     INR         30,00     INR               0,00     INR
    Sub-total               2     PC     120,00     INR     100,00     INR     60,00     INR               0,00     INR
    Grand totals               10     EA     140,00     INR     100,00     INR     62,40     INR     20     INR
                   4     PC                                        
    In the same way as Grand total, Is there any possibility to find out the difference between the 2 sub-totals and display at the bottom after the Grand Totals row.
    Please let me know if there is any possibility for the same.

    Just to update on my question.
    In the sub-totals line you can see that there is 20,00 INR value which is summation of the above fields present in individual line numbers above. And the same way for the rest of the fields as well.
    After calculating the sub-totals in this manned, I need to find out the difference between the subtotals and display it at the bottom of the output.
    Please let me know if this is possible.

  • Total and Average in RESULT of same keyfigure?

    Hi guyz,
    Just want to ask if having the SUM and AVERAGE result of one (1) keyfigure is possible in BEx Query Designer?
    Here is the report:
                                                                  Volume
    Customer A           Material X               100
                                     Material Y               200
                                     Material Z               300
                                     RESULT                600             --->  total --- (100 + 200 + 300) = 600
    Customer B           Material X              400
                                     Material Y              500
                                     Material Z              600
                                     RESULT               1500           ---> total --- (400 + 500 + 600) = 1500
    RESULT                                                1050           ---> average of result --- (600 + 1500) / 2 = 1050
    How will I do the AVERAGE? I already got the TOTAL since it's the DEFAULT in CALCULATION tab. But is it possible to also have the AVERAGE?
    Thank you!
    Loed

    Hi Loed,
    You can try to use Exeption aggregation to acheive this.
    OR
    You can use cell restrictions and get this done.There are many documents avaliable for Cell Restrictions
    Rgds
    SVU123

  • Help in Moving Average Query

    Hello,
    I would like to have a query for finding moving average. based on some conditions.
    I have written query as follows:
    SELECT Column1,
    MONTH_END_DATE,
    (AVG(sum(Col2 *(case when (Col3 ='XYZ') then 1 else 0 end)))OVER (PARTITION BY Column1 ORDER BY MONTH_END_DATE ROWS 5 PRECEDING)) AS AVG_XYZ,
    sum(Col2 *(case when (Col3 ='XYZ') then 1 else 0 end)) as Cumm_XYZ
    FROM
    Table_cd
    WHERE
    Column1 ='1234567'
    GROUP BY Column1, MONTH_END_DATE.
    My problem is if there are no data in a month, then the average calculated will vary from the required.
    For Eg., If i have to find the average of months between JULY and DECEMBER and if the table doesnt have data in the month of OCTOBER, NOVEMBER then while finding the average it will consider only 4 Months instead of 6 Months..So is it possible to write query such that if there are no data in a month then consider the values for that month as zero and then find the average..
    If anybody can help me in this regard, it will be very useful

    Mr.BluShadow if u can just show me how i can find
    average for the values returned by the example
    written by you, it would be very helpful..Obviously the hint wasn't enough... here's another...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select to_date('01/07/2007','DD/MM/YYYY') as dt, 1 as val from dual union all
      2             select to_date('02/07/2007','DD/MM/YYYY'), 2 from dual union all
      3             select to_date('03/07/2007','DD/MM/YYYY'), 3 from dual union all
      4             select to_date('04/07/2007','DD/MM/YYYY'), 4 from dual union all
      5             select to_date('01/08/2007','DD/MM/YYYY'), 5 from dual union all
      6             select to_date('02/08/2007','DD/MM/YYYY'), 6 from dual union all
      7             select to_date('03/08/2007','DD/MM/YYYY'), 7 from dual union all
      8             select to_date('01/09/2007','DD/MM/YYYY'), 8 from dual union all
      9             select to_date('02/09/2007','DD/MM/YYYY'), 9 from dual union all
    10             select to_date('03/09/2007','DD/MM/YYYY'), 10 from dual union all
    11             select to_date('01/12/2007','DD/MM/YYYY'), 11 from dual union all
    12             select to_date('02/12/2007','DD/MM/YYYY'), 12 from dual union all
    13             select to_date('03/12/2007','DD/MM/YYYY'), 13 from dual union all
    14             select to_date('04/12/2007','DD/MM/YYYY'), 14 from dual
    15            )
    16  --
    17  select m.dt, AVG(NVL(t.val,0)) as val
    18  from t, (select add_months(to_date('01/07/2007', 'DD/MM/YYYY'),rownum-1) as dt from dual connect by rownum <= 6) m
    19  where m.dt = trunc(t.dt(+),'MM')
    20  group by m.dt
    21* order by dt
    SQL> /
    DT               VAL
    01-JUL-07        2.5
    01-AUG-07          6
    01-SEP-07          9
    01-OCT-07          0
    01-NOV-07          0
    01-DEC-07       12.5
    6 rows selected.
    SQL>

Maybe you are looking for

  • Can I relocate the Apple Loops & Index folder to another drive?

    There's like 10GB of Apple Loops on my boot drive. I would LOVE to move all of that stuff off to a data drive. Is there a PLIST file or something that tells SoundtrackPro, etc where this treasure-trove of stuff is located - or is it hardwired to be i

  • Error in sql 2008 reporting services with sharepoint 2013

    i have database sql 2008r2 and sharepoint 2013 enterprise database is in cluster server and sharepoint have 2 servers one for webfront end and one for services. im tring to configer ssrs in the web front end server for sharepoint and i install sql 20

  • How to paste screen shot in the forum editor

    please help how to paste screen shot in the forum editor

  • Satellite A300D-205 How to change 32-bit to 64 bit

    Hi! I have Satellite A300D-205, with a Windows 7 32-bit on it. I upgraded to Windows 7 from Windows Vista 32-bit by an upgrade DVD from Toshiba I need Windows 7 as 64-bit. I have been searching on the net about this, and the only thing I understood,

  • Metastat error "there are no exsiting databases

    Good day We have a numerous T2000, T5220 and V240/V245 in our fleet. Most have mirrored drives supporting the Solais 10. On one of our v245 we appear to have lost one of our drives. The metastat command returns the following: bash-3.00# metastat d6: