Compute totals in query

Hi,
I can not compute the t.quantity and t.linetotals in this query.
SELECT T.ItemCode,  T.dscription, SUM(T.quantity) as HVH, sum(T.linetotal) as Omzet
FROM
(select
itemcode, dscription, quantity, linetotal
from
inv1 t0 inner join oinv t1 on t0.docentry = t1.docentry
where
t1.cardcode between '300000' and '310000' and
t1.docdate >= '20101101' and t1.docdate <= '20101130'
and t0.itemcode in (select itemcode from oitm t2 where t2.cardcode = '600319')
UNION ALL
select
itemcode, dscription, -quantity as quantity, -linetotal as linetotal
from
rin1 t0 inner join orin t1 on t0.docentry = t1.docentry
where
t1.cardcode between '300000' and '310000' and
t1.docdate >= '20101101' and t1.docdate <= '20101130'
and t0.itemcode in (select itemcode from oitm t2 where t2.cardcode = '600319')) T
group by T.itemcode, T.dscription
order by T.itemcode
Is there somebody who can help??
thx
mark

Hi Mark,
did not Gordon answer your issue allready in this thread ? See totals in query on 1 line
Thats the same query, isn't it?
Regards Steffen

Similar Messages

  • Using Firefox 5 with the latest flash player, exiting youtube the computer totally locks up. Tried Google chrome no problrms at all. Can you help please?

    After watching Youtube content often in HD full screen on pressing the icon to minimise the computer totally locks up totally unresponsive.
    Doing the same in Chrome has no issues.

    I'd still prefer to keep separate user accounts. I never had any issues like this before. The only time I started having a problem was when I was just trying to force empty the trash a few months ago. I came on here looking for a solution and someone posted a way to empty the trash using the terminal. Before then, I hadn't used the terminal for anything--it was just another app in my utilities folder.  (None of this has anything to do with having separate user accounts. Plenty of people with kids make second and third user accounts on their laptops so that multiple people can use one laptop, having more than one user on a laptop is not very difficult.) But thank you, I'll try that out and see if it works!

  • TOTAL IN QUERY

    Hi,
    I want to display total in query for each row like unit price + landed cost.Here unit price is always there but landed cost is applicable some times .So in some records it is blank.so in those case the total also appears as blank.
    Pls let me know how to handle this.
    Rgds,
    Rajeev

    Hi Rajeev,
    When you try to add a NULL value to another number the result is NULL, thus you should substitute NULL with 0 for e.g. ISNULL(Table.Field, 0) and then add this to the item cost, now you should get a valid value always.
    Hope this helps,
    Regards,
    Murtaza

  • Needed a running total in query

    Dear Gurus...Can I've a running total in query like this:
    Item_ Open_Qty_ Rec_Qty_ Iss_Qty_ Bal_
    A 10 5 2 13
    A 0 4 5 12
    A 0 0 6 6
    In this query column Bal is required whose value should be calculated as:
    Bal = ((Open_Qty + Rec_Qty) - Iss_Qty)
    Thanx in advance.

    389 posts and still you seem unaware of:
    - how important it is to mention your database version.
    - the tag, which implicates that you haven't read the FAQ for a while.
    - the 'search' option you have on the right side of the screen.
    You can query running totals easily by using analytic function SUM.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Computer Totally Cannot be Power On

    Hi hi to everyone,
    Recently, i have replace some part of my PC. The parts replaced are 1GB(2 X 512MB)ram, new DVD-Rom and a new harddisk.
    After connecting all the new parts, i power on the computer and everything run smoothly on the first run. Then, i switch off the computer to screw back the casing. When i tried to on it back, the whole computer totally cannot be power on as in totally no power even the power supply fan is not moving. Then, i tried troubleshooting the power supply and found that the power supply fan is running in stand-alone mode. Please advise on what to do...
    My Computer Specification as follow:
    1) Power Supply: Antec SmartPower 350W
        +5V   : Max - 35A    Min - 1.5A
        +12V : Max - 16A    Min - 0.8A
        +3.3V: Max - 28A    Min - 0.5A
        -5V   : Max - 0.5A   Min - 0A
        -12V  : Max - 0.8A   Min - 0A
        +5V SB : Max - 2A    Min - 0A
    2) Motherboard: MSI 865PE NEO2-S
    3) CPU: Intel Pentium 4 2.6GHz
    4) RAM: GEIL DDR400 1GB(2 X 512MB) CL2.5
    5) VGA: MSI FX-5200 128MB 8X-AGP
    6) Hard-Disk:
        a) Seagate 7200rpm 160GB Hard-Disk
        b) Hitachi 7200rpm 60GB Hard-Disk
    7) Drive
        a) LG 16X/52X DVD-Rom
        b) Creative 24X/10X/40X CD-RW
    8) 4 External Casing Fan
    Thanks a million for any advice....

    Quote from: Carpe_Diem on 06-May-07, 00:06:38
    Hi hi,
    Firstly, thanks for the advice.... and sorry for my stupid question.
    You suggest a new psu but it is basically working fine until the recent upgarde....
    Thanks
    "You suggest a new psu but it is basically working fine until the recent upgarde...."
    stats of that PSU are too weak. it can't be not enough to handle the changes, or it can be just damaged.
    try with better one with high amperes on +12V.
    other possibilities due memory failure or underpowered sticks. try but back your old memory.

  • Can not compute totals on a column based on a summary column

    Hi. I'm new in Discoverer.
    I have created a worksheet based on the following query:
    SELECT O101158.COD_HACIENDA, O101158.NOMBRE, O101266.DESC_UNIDAD, SUM(( NVL(O101501.PESO_NETO,0)/1000 ))
    FROM ASISTEN.SAT_HACIENDAS O101158, ASISTEN.SAT_UNIDADES O101266, ROMANA."BOLETO_CA#A" O101501
    WHERE ( ( O101158.COD_UNIDAD_OPER = O101266.COD_UNIDAD ) AND ( O101501.COD_HACIENDA = O101158.COD_HACIENDA ) ) AND ( O101501.ZAFRA = '2004-2005' )
    GROUP BY O101158.COD_HACIENDA, O101158.NOMBRE, O101266.DESC_UNIDAD
    ORDER BY O101266.DESC_UNIDAD ASC
    The expression SUM(( NVL(O101501.PESO_NETO,0)/1000 )) is defined in Discoverer as a calculated item.
    I have created a total on the sum expression. The idea is to have it compute at the "DESC_UNIDAD".
    The problem is that only the label "Sum" is printed at the right level. No total is calculated.
    Is this a restriction on totals based on aggregation or am i missing somthing here?
    Best regards, Luis ...!

    Hi Luis
    There have been a number of questions concerning summations of totals in recent weeks.
    Take a look at these threads:
    Cell sum not working
    Calculation shows Blank or NULL in Discoverer Viewer but not in Dis.Desktop
    Do either of these help?
    Best wishes
    Michael

  • Sum Total in Query Print Layout

    Hi, all
    I have a report which is created by a query, How can I insert a variable to show the Total Sum in footer.
    Thanks
    kimmy

    Hai!
    see this thread.
    Sub totals in PLD
    regards,
    Thanga Raj.K

  • Is my computer totally dead?

    I've got a 15" Macbook Pro that I purchased in August 2007. I don't remember any more exact specs on it but I'm pretty sure it was the 'middle' model if that helps any. Yesterday, about an hour after I installed some software updates for it, the screen turned into this sort of noisy bright pink grid and it stopped responding. I had audio going and that went on for about 2 more seconds before it started to repeat the same half second or so of audio over and over, like a cd skipping.
    I forced it to shut down and then immediately restarted it, and the screen was still messed up (with kind of pixelated blurs) but I could at least see the normal startup screen underneath. I had been hoping that the restart would fix it completely so when it still looked like that I shut it down again, without waiting for it to totally finish restarting, and I figured I would leave it alone overnight, let it cool off, and so on.
    This morning I turned it on and it really won't even start... I get a screen with a sort of noisy black and white wide vertical stripe pattern. I tried restarting it a few times, taking the battery out, hooking it to an external monitor, trying to run the utility disc... nothing. Now it doesn't even seem to get past the initial start-up phase.... the noise that the cd drive normally makes a few seconds after starting it up keeps repeating it self every 10 seconds or so and the screen always shows the black and white pattern. The external monitor is just blank when it's hooked up. I tried to boot from the utility cd but the computer just ejected it after about 20 seconds.
    I heard there were some problems with, and a program to replace, faulty nvidia graphics cards, but I looked a the page of symptoms and it doesn't seem to match what's happening with my computer. I don't even know which graphics card it has, seeing as I can't turn it on.
    I've never had any problems with it whatsoever before this point. It did happen an hour after I installed a batch of software updates (I know there were 4 items, one was a printer driver upgrade and one must have been the OSX update that adds the app store icon to the dock) which makes me a bit suspicious... whether there was something faulty about those updates or whether it was just a coincidence that this happened afterward.
    What do you think is wrong with it? Something fixable? (I hope... I don't particularly want to buy a new computer at the moment). Would it be possibly to at least salvage the information on the hard drive, if nothing else?

    Hi m, and welcome to Apple Discussions.
    Depending on exactly which model you have, it may be covered under the NVIDIA repair program. I would definitely bring it to an Apple Store or AASP and have it tested. You may be eligible for a free repair.
    If you want to know which model you have before getting it tested, take the battery out, get the serial number inside the battery bay, and enter it here: http://support.apple.com/specs/#
    To get your data, try FireWire Target Disk Mode. If that doesn't work, you'll need to remove the HD, put in in an external enclosure, and access if from another Mac.
    Message was edited by: tjk

  • Compute total on a field based on change in values in 2 other fields

    I have the following requirement
    ITAB has fields 
    PO#     PO_LINE# ............  PRICE
    100              1                          500
    100               2                         100
    200               1                          300
    300               1                         200
    300               2                         700
    300               3                         100
    and my required output in ALV is
    PO#     PO_LINE# ............  PRICE
    100              1                          500
    100               2                         100
                                     Total        600
    200               1                          300
                                     Total        300
    300               1                         200
    300               2                         700
    300               3                         100
                                      Total      1000
    i want to compute the total price for each PO#.
    Can someone please suggest how ?
    Thank u so much.

    Hello Asha,
    It appears that you are looking for the subtotal functionality that is built into ALV. The "sort" table that is accepted by the ALV FM has a field named "subtot" that can be used to flag a field for subtotals. In your case you would flag the PO# field for subtotals.
    A bare bones example of entering this information can be seen in the following:
    " Fill out the field catalog, layout, etc.
    " Now we will populate the sort information
    ls_sort-fieldname = 'PONUMBER'.
    ls_sort-up = 'X'.
    ls_sort-subtot = 'X'. "This is the field that will allow subtotals
    APPEND ls_sort TO gt_sort.
    " Call the the display ALV FM
    Now this comes with a number of conditions:
    1. For simple cases, the field you want to subtotal over must be the left-most column. In your example it looks like you meet this requirement as PO# is the first column.
    2. You also need to make sure that there is a column that allows totals. In your example you need to make sure price has the proper data type to allow for totals.
    If you are still having trouble, I would recommend looking at the following code example: [Display subtotal text in ALV grid|http://wiki.sdn.sap.com/wiki/display/Snippets/DisplaysubtotaltextinALV+grid]. It contains a more complete example of how to use subtotals in ALV.

  • Running Total Variation Query Time Optimization

    Hi all, 
    I've been struggling with this query for a while. I need to set a customer specific running total for 10 million rows (reset for every customer). But every time the number goes negative, I need to set it as zero.
    For example,
    member no              amount            wallet
    member1                 400                      400
    member1                 -500                     0
    member1                  200                    200
    member2                  700                    700
    member2                 -200                    500
    Query:
    DECLARE @member float
    DECLARE @prev_member float
    DECLARE @amount float
    DECLARE @wallet float
    DECLARE db_cursor CURSOR FOR  
    SELECT [Member no], [Transaction Amount] 
    FROM [wallet_master_3]
    ORDER BY [Member No], [rownum]
    FOR UPDATE
    OPEN db_cursor
    FETCH NEXT FROM db_cursor INTO @member, @amount
    SET @prev_member = @member
    set @wallet=0
    WHILE @@FETCH_STATUS = 0
    BEGIN   
           IF @prev_member <> @member set @wallet=0
           SET @wallet = @wallet + @amount
           IF @wallet < 0 SET @wallet = 0
           UPDATE [wallet_master_3] SET walletsize = @wallet
           WHERE CURRENT OF db_cursor
           set @prev_member=@member
           FETCH NEXT FROM db_cursor INTO @member, @amount
    END   
    CLOSE db_cursor   
    DEALLOCATE db_cursor
    I've tried using a cursor. In five minutes, it ran 17,000 rows but after running it for 15 hours, the code only manages to set the running total for 175,000 rows. I'm not exactly sure why. Is there a faster approach I can use? 
    Thanks!

    As an exercise a 'Quirky Update' may help you in this scenario. Try the below trick!
    DECLARE @Wallet AS TABLE
    MemberNo VARCHAR(10),
    RowNum INT,
    Amount INT,
    Wallet INT
    INSERT INTO @Wallet (MemberNo, RowNum, Amount) VALUES
    ('member1',1, 400),
    ('member1',2, -500),
    ('member1',3, 200),
    ('member2',1, 700),
    ('member2',2, -200)
    DECLARE @RunTotal AS INT
    UPDATE W1
    SET
    @RunTotal = W1.Wallet =
    CASE
    WHEN W1.RowNum = 1 THEN W1.Amount
    WHEN @RunTotal + COALESCE(W1.Amount, W2.Amount) < 0 THEN 0
    ELSE @RunTotal + COALESCE(W1.Amount, W2.Amount)
    END
    FROM @Wallet W1
    LEFT OUTER JOIN @Wallet W2
    ON W1.MemberNo = W2.MemberNo AND W2.RowNum = W1.RowNum - 1;
    SELECT * FROM @Wallet;
    RESULT
    MemberNo RowNum Amount Wallet
    member1 1 400 400
    member1 2 -500 0
    member1 3 200 200
    member2 1 700 700
    member2 2 -200 500
    You can read more on 'Quirky Update' in below articles
    Solving the Running Total and Ordinal Rank Problems - Jeff Moden
    Robyn Page's SQL Server Cursor Workbench
    NOTE: Please test it thoroughly before using in a production environment!
    Krishnakumar S

  • How to get grand total in query designer

    Hi,
       Antbody know how to get the grand total after the  last row in query designer? I
    Thanks

    Hi,
    If we select the very first Characterstic in the rows section and set the Supress result rows as "never".
    That will show the overall result in the end of the report,
    In the query properties tab ,check for display properties of the result.That should be set to bottom.
    Hope this will work.
    Thanks
    Mukesh

  • Daily Sales Total Comparison Query

    Hi Experts,
    I'm trying to make a query to get daily sales total for week and wish to make a graph.
    However, if there is no figures in credit note or Down payment invoice or invoice then query seems not showing any figures for particular date.
    I would be appreciated if anyone help this.
    SELECT DISTINCT
    GetDate(),
    SUM (DISTINCT T0.DocTotal) AS 'Daily INV Sum',
    SUM (DISTINCT T2.DocTotal) AS 'Daily DT INV Sum',
    SUM (DISTINCT T1.DocTotal*-1) AS 'Daily CR Sum',
    SUM (DISTINCT T0.DocTotal) + SUM (DISTINCT T2.DocTotal) - SUM (DISTINCT T1.DocTotal) AS 'Daily Sales Total'
    FROM OINV T0, ORIN T1, ODPI T2
    WHERE DateDiff(D,T0.DocDate,GetDate())=0 AND DateDiff(D,T1.DocDate,GetDate())=0 AND DateDiff(D,T2.DocDate,GetDate())=0
    UNION ALL
    SELECT
    DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 1, 0)),
    SUM (DISTINCT T0.DocTotal) AS 'Daily Sales Sum',
    SUM (DISTINCT T2.DocTotal) AS 'Daily DT INV Sum',
    SUM (DISTINCT T1.DocTotal*-1) AS 'Daily CR Sum',
    SUM (DISTINCT T0.DocTotal) + SUM (DISTINCT T2.DocTotal) - SUM (DISTINCT T1.DocTotal) AS 'Daily Sales Total'
    FROM OINV T0, ORIN T1, ODPI T2
    WHERE T0.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 1, 0)) AND T1.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 1, 0)) AND T2.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 1, 0))
    UNION ALL
    SELECT
    DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 2, 0)),
    SUM (DISTINCT T0.DocTotal) AS 'Daily Sales Sum',
    SUM (DISTINCT T2.DocTotal) AS 'Daily DT INV Sum',
    SUM (DISTINCT T1.DocTotal*-1) AS 'Daily CR Sum',
    SUM (DISTINCT T0.DocTotal) + SUM (DISTINCT T2.DocTotal) - SUM (DISTINCT T1.DocTotal) AS 'Daily Sales Total'
    FROM OINV T0, ORIN T1, ODPI T2
    WHERE T0.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 2, 0)) AND T1.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 2, 0)) AND T2.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 2, 0))
    UNION ALL
    SELECT
    DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 3, 0)),
    SUM (DISTINCT T0.DocTotal) AS 'Daily Sales Sum',
    SUM (DISTINCT T2.DocTotal) AS 'Daily DT INV Sum',
    SUM (DISTINCT T1.DocTotal*-1) AS 'Daily CR Sum',
    SUM (DISTINCT T0.DocTotal) + SUM (DISTINCT T2.DocTotal) - SUM (DISTINCT T1.DocTotal) AS 'Daily Sales Total'
    FROM OINV T0, ORIN T1, ODPI T2
    WHERE T0.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 3, 0)) AND T1.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 3, 0)) AND T2.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 3, 0))
    UNION ALL
    SELECT
    DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 4, 0)),
    SUM (DISTINCT T0.DocTotal) AS 'Daily Sales Sum',
    SUM (DISTINCT T2.DocTotal) AS 'Daily DT INV Sum',
    SUM (DISTINCT T1.DocTotal*-1) AS 'Daily CR Sum',
    SUM (DISTINCT T0.DocTotal) + SUM (DISTINCT T2.DocTotal) - SUM (DISTINCT T1.DocTotal) AS 'Daily Sales Total'
    FROM OINV T0, ORIN T1, ODPI T2
    WHERE T0.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 4, 0)) AND T1.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 4, 0)) AND T2.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 4, 0))
    UNION ALL
    SELECT
    DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 5, 0)),
    SUM (DISTINCT T0.DocTotal) AS 'Daily Sales Sum',
    SUM (DISTINCT T2.DocTotal) AS 'Daily DT INV Sum',
    SUM (DISTINCT T1.DocTotal*-1) AS 'Daily CR Sum',
    SUM (DISTINCT T0.DocTotal) + SUM (DISTINCT T2.DocTotal) - SUM (DISTINCT T1.DocTotal) AS 'Daily Sales Total'
    FROM OINV T0, ORIN T1, ODPI T2
    WHERE T0.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 5, 0)) AND T1.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 5, 0)) AND T2.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 5, 0))
    UNION ALL
    SELECT
    DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 6, 0)),
    SUM (DISTINCT T0.DocTotal) AS 'Daily Sales Sum',
    SUM (DISTINCT T2.DocTotal) AS 'Daily DT INV Sum',
    SUM (DISTINCT T1.DocTotal*-1) AS 'Daily CR Sum',
    SUM (DISTINCT T0.DocTotal) + SUM (DISTINCT T2.DocTotal) - SUM (DISTINCT T1.DocTotal) AS 'Daily Sales Total'
    FROM OINV T0, ORIN T1, ODPI T2
    WHERE T0.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 6, 0)) AND T1.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 6, 0)) AND T2.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 6, 0))
    UNION ALL
    SELECT
    DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 7, 0)),
    SUM (DISTINCT T0.DocTotal) AS 'Daily Sales Sum',
    SUM (DISTINCT T2.DocTotal) AS 'Daily DT INV Sum',
    SUM (DISTINCT T1.DocTotal*-1) AS 'Daily CR Sum',
    SUM (DISTINCT T0.DocTotal) + SUM (DISTINCT T2.DocTotal) - SUM (DISTINCT T1.DocTotal) AS 'Daily Sales Total'
    FROM OINV T0, ORIN T1, ODPI T2
    WHERE T0.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 7, 0)) AND T1.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 7, 0)) AND T2.DocDate = DATEADD(dd, 0, DATEADD(dd, DATEDIFF(dd, 0, GetDate()) - 7, 0))

    Could you let me know how to make pivot query?
                        AR INV TOTAL  |  AR Down Payment Total  | AR Credit Total  | (AR INV TOTAL+AR DP TOTAL-AR CREDIT TOTAL)
    Today's Sales
    Yesterday
    Until Week Before

  • How to make Columnwise total using Query in the picklist window

    Hi Experts,
    I want to make the column wise total for the values in the field(Picked) in the Pick list window through query.
    How to do it?
    Regards,
    Magesh.

    Hi Suda,
    I have the following values in the Picked fields:
                                  Picked
                                     10
                                     20
                                     30
                                     60
    i want to get the column total 60.. If iam clicking the Pickall button the values will get posted in the Picked field.. i want the query to total the value of picked field..
    How to do it?
    Regards,
    Magesh.

  • API to compute total RAM memory wired-down by all processes?

    Hi. We have a time-critical application that wires-down large memory blocks with mlock() and munlock(). We are concerned that, if other applications are running that are also wiring-down memory, we may inadvertently wire-down all the RAM in the computer, and the computer will hang (this has happened a couple of times).
    The solution we would like to adopt is: we compute the total memory wired-down on the computer, by all processes, so we can know whether or not we can wire-down. In other words, we want to, in software, compute the same figure that the Activity Monitor shows in its memory-usage pie chart.
    Question: Can anyone point us at an API to compute the total of all wired down memory, from all processes? Thanks in advance.

    Thanks for the ideas. What I learned after pursuing the above suggestions, is:
    1) sysctl() does not return the amount of Wired-down memory, or if it does, it is just one process
    2) "top" shell command does output the Wired-down memory count of all processes. The "top" value is identical to the Activity Monitor value. Unfortunately, there is no API for "top".
    3) There is a lower-level mach function host_statistics() (analagous to sysctl?) which will return VM stats: use HOSTVMINFO type (outputs structure vmstatistics_datat) which does include wired-down memory. However, the output value for wired-down memory is not the total of all processes (it is significantly smaller than the wired-down figure from "top" or Activity Monitor). Strangely, the "total active" and "total inactive" values from host_statistics() do reflect all processes. The mystery is: why does host_statistics() under-report the wired value (e.g. it says 400 MB when "top" shows 700 MB).
    In summary: host_statistics() is tantalizingly close to what I need, but does not output the correct value. "top" is more accurate, but slow and there is no API.

  • How to make a Moving total in Query Designer

    Hi,
    I make trend analysis over sales.
    Besides the actual sales figures, I would like to show a Moving Annual Total (MAT).
    I can make this based on a specific period (using an offset of 0 to -11, and so on), but now I want to see the trend over an interval (for instance 12 month).
    I am not able to incorporate the interval values into the period variable.
    Can anybody help me with this?
    Regards,
    Erik Henning

    Tanks again.
    I am able to make a time (Fiscal year period) variable of the type interval to set the limits to my query.
    I also was able to make a time (Fiscal year period) variable to set my offset to 0 to -11.
    The problem is combining those two.
    When I combine them, I have to enter the limit values and a value for the offset variable.
    When I do that, I get the offset value of the period I entered in all the periods within my limits and that is not what I want. I want this offset period variable to use all the periods of my interval.
    Can you tell me how to proceed?
    Erik

Maybe you are looking for