Query to calculate total

hi everybody I have a situation-----
I have a table xyz having a column AAA ( datatype varchar2) as below
AAA
100KG
100kg
100 KG
100K.G.
200QTL
200 QTL
200qtl
Now I want my output as below (total according to the unit)
KG QTL
400 600
So how should I proceed so that I get my result...
Thanx
Message was edited by: achyot
Achyot

Write the code for you, no. Tell you how, happy to.
1. get a sharp stick and go find the clown that designed a table that mashed quantity together with the unit of measure. If you still have a job after that...
2. use substr() function to separate the unit of measure from the quantity into two columns.
3. now it is simply a matter of a subquery to sum the quantities by UOM and a pivot query to rotate the columns to rows. Method of doing a pivot varies depending on the release version of the db you are using.

Similar Messages

  • SQL Query to Calculate Total PO Amount

    Hi,
    I'm trying to create a Purchase Order view that includes Total Po Amount. Has anyone done this before and can provide me with the SQL? Or advice on how to write the query to calculate the po_line amounts for each po number?
    I've looked in the POXPOEPO.fmb form for the calculation(code) and looked at several APPS views(ie. PO_Headers_Inq_V) without any success.
    Any help would be appreciated.
    Thanks
    Tony

    Tony, I think this will help you:
    select sum(pl.unit_price * pl.quantity)
    from po_lines_all pl
    , po_headers_all ph
    where ph.segment1 = 1004257 -- po_number
    and ph.po_header_id = pl.po_header_id
    Regards,
    Ricardo Cabral

  • Sql query to calculate total credit having more than one tables

    i have these 9 tables and want to calculate totalcredit from these tables alse want to
    See more: SQL-server-2008R2
    i have these 9 tables and want to calculate totalcredit from these tables alse want to calculate totaldebit of all account no in which each accountno will show its own total credit and total debit 
    parties
    purchase 
    purchase body
    purchase return
    purchase return body
    sale 
    sale body
    sale return
    sale return body

    If you want to suggest you accurate solution, please post CREATE TABLE+ INSERT INTO + sample data + DESIRED RESULT
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Calculate total while designing query

    Hi All,
    I have a keyfigure purchase value . I am taking it in one column.
    Now I want to calculate total of purchase value for particular month.
    I can restrict time characteristic with variable but m not getting how to calculate total of this keyfigure.
    Please advise.
    Regards
    Shweta Goel

    what type of calculations?
    when you restrict a query by month you get the total in the result.
    if you want to use the purchase value for a month in a calculation, remove dates or order number from the query, have a aggregated result on which you can do the calculation and users can drill down if they need to see detail.
    regards
    Ramesh

  • You Can't Calculate Totals on that!...SO #@!%#! WHAT, YOU GREAT PILE OF !@#

    In Access you have an asterix which represents every field in the table. Useful if you want to see all the data in a table for a single record. I've done it a million times before.
    So why is it telling me that I can't calculate totals on the *, so I should remove it from the query grid and replace it with the fields I want and calculate totals then.
    I DON'T WANT TO CALCULATE ANY #!@%#@!! TOTALS!!
    I AM PUTTING THE FIELDS I #@!%$#! WANT - I WANT ALL OF THEM!! I JUST DON'T WANT TO DOUBLE CLICK 30 TIMES WHEN ONCE WILL DO!
    It's driving me insane because I'm going through hundreds of Oracle tables and it takes so long to browse to the record I'm looking for and it should work to use the asterix, I've done it so many times before.
    How do I override this utterly unhelpful behaviour? Am I stuck in some sort of "Queries will only calculate Totals! mode that I don't know about?
    I know, I know, Access is a micro$loth invention, not Oracle, but we have to use an ODBC link to the SQL database via Acces and it's going to kill me.
    Unless I slam my PC into my neighbour's head first!
    Any help greatly apprciated.
    Sorry for the rant!
    Cheers
    IsNull

    IsNull wrote:
    Cheers,
    I am serious and I know this isn't an Access site, and I know there are differences between SQL in Access and SQL in Oracle, and I'm trying to get funding to do some proper SQL and VBA training, but if anyone can help I'd be very grateful.What? with the funding? Sorry, there's a credit crisis doncha know! ;)
    In the Access/ODBC/Oracle query design view you can create a query by linking fields in tables and then choosing fields you want to output in the query results. At the top of each table is an asterix which uses all the fields from the entire table in a query and outputs the data from all the fields. I'm looking through various tables to find useful fields and using one particular record as my example so I get consistent data output.
    Now, I can look in the actual linked tables and see what they contain, but I want the data for a single record, not the general table contents and there are hundreds of thousands of records. So I'm using the query design to search for the data for a single record and using only one table per query. But if I double click on the asterix to indicate "Use All Fields from this Tabel" I get the "But you can't calculate totals on that!" message. If I add them all individually I get an "Illegal use of LONG data".I once looked at Access, many moons ago. Didn't like it.
    However, from what you describe, it would seem that you need to somehow join the tables as you're doing, but also apply some restrictions on the data so that you're not trying to retieve all the rows back. As for it's error complaining about the totals, I would expect something like you've got an aggregate function in there and things aren't being grouped together. Either that or there's some "setting" somewhere that automatically tries to total things, which hopefully you could turn off. The best thing is to take the error message/number and lookup what that means via some website/documentation that lists Access errors and how to resolve them.
    You'll be lucky to find anyone here who will know (or care about) Access.

  • 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

  • Query to calculate time

    hi all,
    i have 2 udf field of type 'Time', StartTime and EndTime in order to catch the info of some process time.
    again 2 fields of date in order to catch the range of days for the process goes.
    like the following
    Startdate | Enddate | Starttime | Endtime
    15/04/09--| 16/04/09| 9:30- | ---14:00
    Now i need a query to calculate the time differences in hrs. like the process runs thro 4 n half hrs a day and totally as per the table value the total run process time is 9 hrs.
    How to bring out in query any one plz help...
    Thank you so much,

    Hi Yatsea, sorry tis time too its not reteiving correct answer, the values i gave over here is jus for example. but in real there may be many different values. So will be useful in case of providing the query taking in the field names plz.
    i hav a work around working on . will write here, plz guide me to correct the query to get me correct answer.
    in order to find the specific hrs between start and end time for 2 days,
    1. can find first total days within start and end date (EndDate-StartDate) + 1 = 2
    2. 2nd find the hrs between start and end time (EndTime-StartTime) = 4.30 hrs
    3. after tht should multply the 2 values 2 * 4.30 = 8.60 which should round as 9 hrs
    Select (datediff(day,enddate,startdate)+1) * (endtime-starttime)
    will it help..? its not giving correct answer. may gone wrong wit time format. but this concept will give correct anawer i hope...
    PLz...help me getting solution.
    Edited by: New  User on Apr 16, 2009 3:52 PM

  • Query - to calculate data for previous year

    Hi forum,
    I have a requirement to calculate
    ' Total number of complaints received current month last year / total number of complaints last year)*current year total complaints target.'
    I have no of complaints as key figure.
    Any ideas how to do it in query designer.
    Thanks in advance.
    Regards,

    Hi,
    The requirement is user will select the month he wants to see the records.
    Based on input I have to calculate
    1. Records from same month previous year.
    2. Total records last year and
    3. Total records this year.
    I just need 1 input variable. Please explain in detail.
    Should i create 2 RKF for records of previous year and for records of this year.
    regards

  • How to calculate totals in Blocked ALV Report

    Hi All,
    Can any body tell how to calculate totals & sub totals in
    Blocked ALV Report[Blocked List].
    Thanks in advance
    Thanks & Regards,
    Rayeezuddin.

    read this it might help
    Sums                                                       
    15. No_sumchoice(1) TYPE c : This parameter allows the choice for summing up
    Only by fieldcatalog.
    Value set: SPACE, 'X'
    'X' = fields which are to be summed, passed by the calling program (FIELDCAT-DO_SUM = 'X'). The user should not be able to change this value interactively.
    16. No_totalline(1) TYPE c : Removes the option of having totals after sub-totals.
    Value set: SPACE, 'X'
    'X' = no total record is to be output. Subtotals can still be calculated and output. The fields in the subtotals are flagged DO_SUM = 'X' in the field list.
    17. No_subchoice(1) TYPE c : Does not allow the user to interactively change the field chosen for subtotals.
    Value set: SPACE, 'X'
    'X' = value whose change triggers subtotals, provided by the calling program. The user should not be able to change this value interactively.
    18. No_subtotals(1) TYPE c : No subtotals possible          
    Value set: SPACE, 'X'
    'X' = no subtotals.
    19. Numc_sum(1)  TYPE c : Totals only possible for NUMC-Fields.
    20. No_unit_splitting TYPE c: No separate total lines by inh.units   
    21.totals_before_items TYPE c: Display totals before the items   
    22. Totals_only(1) TYPE c :  Show only totals      
    Value set: SPACE, 'X'
    'X' = only total records are output.
    23. Totals_text(60) TYPE c : Text for 1st col. in totals   
    Value set: SPACE, string (max.60)
    ' ' = The first column in the total record contains an appropriate number of '*'s to indicate the total by default. If the first column is wide enough, the string 'Total' is output after the asterisks.
    'String’ = The string passed is output after the total indicated by '*', if the column is wide enough.
    24. Subtotals_text(60) TYPE c : Texts for subtotals
    Value set: SPACE, string (max.60)
    ' ' = In the first column of subtotal records, the subtotal is indicated by an appropriate number of '*' by default. If the first column is not a subtotal criterion, the string 'Total' is output after the asterisks, if the column is wide enough.
    'String’ = the string passed is output after the subtotal indicated by '*', if the column is wide enough and the first column is not a subtotal criterion. If it is a subtotal criterion, its value is repeated after the total, if the column is wide enough.
    ELSE TELL ME I WILL PASTE COMPLETE HELP
    regards

  • How to calculate total number of pages in a script

    hi
    how to calculate total number of pages in a script

    Jyothsna,
    Date:-&sy-datum&
    Time:-&sy-timlo&
    Total No.of Pages:-&sapscript-formpages&
    Page No:-&PAGE&/&SAPSCRIPT-FORMPAGES&
    Give the above said lines in your text editor,and given the paragraph format.Better create one more window and give the above said lines in the text editor.
    K.Kiran.

  • Query to get total counts in the given scenario

    Hi,
    I am using Oracle 10g
    I have a table A with following data
    AgId     Trm     CD     S
    1000     100010     12-JAN     A
    1000     100019     20-MAR     A
    1000     100019     20-JUL     D
    1001     100011     25-JAN     A
    1001     100011     20-FEB     D
    1001     100011     23-MAR     A
    1001     100012     31-JAN     A
    1002     100013     14-FEB     A
    1002     100013     05-APR     D
    1002     100015     02-MAY     A
    1003     100014     03-MAR     A
    1003     100014     25-MAR     D
    1004     100016     22-MAY     A
    1004     100017     21-JUN     A
    1004     100018     01-JUL     A
    1005     100020     21-MAY     D
    1005     100020     21-JUL     A
    1005     100020     11-AUG     D
    Here the overall status of AgId '1000' is A as he is having atleast 1 Trm active
    Similarly, status of AgId '1001' is A
    status of AgId '1002' is A
    But,status of AgId '1003' is D as his trm is disconnected after activation(according to date column'CD')
    Then, status of AgId '1004' is A
    and finally status of AgId '1005' is D again as his trm deactivated, activated and deactivated at last
    So, considering these criteria can any one give me a query to get total no of AgId's who are 'Active' and similarly for 'Deactive'

    Hi,
    when you put some code please enclose it between two lines starting with {noformat}{noformat}
    i.e.:
    {noformat}{noformat}
    CREATE TABLE ... etc.
    {noformat}{noformat}
    Also do not forget to put correct statements. Your insert were missing semicolon at the end.
    Coming back to your problem, I assum that the current status of any trm is the latest status so I have done what follows:
    {code:sql}
    SELECT agid
         , trm
         , cd
         , s
         , ROW_NUMBER () OVER (PARTITION BY agid, trm ORDER BY cd) rn
         , COUNT (*) OVER (PARTITION BY agid, trm) rn_tot
    FROM a
    ORDER BY agid, trm, cd;
    Output:
          AGID        TRM CD        S         RN     RN_TOT
          1000     100010 12-JAN-12 A          1          1
          1000     100019 20-MAR-12 A          1          2
          1000     100019 20-JUL-12 D          2          2
          1001     100011 25-JAN-12 A          1          3
          1001     100011 20-FEB-12 D          2          3
          1001     100011 23-MAR-12 A          3          3
          1001     100012 31-JAN-12 A          1          1
          1002     100013 14-FEB-12 A          1          2
          1002     100013 05-APR-12 D          2          2
          1002     100015 02-MAY-12 A          1          1
          1003     100014 03-MAR-12 A          1          2
          1003     100014 25-MAR-12 D          2          2
          1004     100016 22-MAY-12 A          1          1
          1004     100017 21-JUN-12 A          1          1
          1004     100018 01-JUL-12 A          1          1
          1005     100020 21-MAY-12 D          1          3
          1005     100020 21-JUL-12 A          2          3
          1005     100020 11-AUG-12 D          3          3I have used to columns rn and rn_tot to find the latest entry for a specific agid, trm
    Using the query above I have done the following:
    WITH mydata AS
       SELECT agid
            , trm
            , cd
            , s
            , ROW_NUMBER () OVER (PARTITION BY agid, trm ORDER BY cd) rn
            , COUNT (*) OVER (PARTITION BY agid, trm) rn_tot
        FROM a
    SELECT agid
         , CASE WHEN SUM (CASE s WHEN 'A' THEN 1 END) > 0 THEN 'A' ELSE 'D' END s
      FROM mydata
    WHERE rn = rn_tot
    GROUP BY agid;
    Output:
          AGID S
          1000 A
          1001 A
          1002 A
          1003 D
          1004 A
          1005 D
    {code}
    Which is listing the agid and its status if at least there is one trm with final status 'A' for that agid.
    To sum up everything you can do simply like this:
    {code:sql}
    WITH mydata AS
       SELECT agid
            , trm
            , cd
            , s
            , ROW_NUMBER () OVER (PARTITION BY agid, trm ORDER BY cd) rn
            , COUNT (*) OVER (PARTITION BY agid, trm) rn_tot
        FROM a
    totdata AS
       SELECT agid
            , CASE WHEN SUM (CASE s WHEN 'A' THEN 1 END) > 0 THEN 'A' ELSE 'D' END s
         FROM mydata
        WHERE rn = rn_tot
        GROUP BY agid
    SELECT S, COUNT(*) cnt
      FROM totdata
    GROUP BY S;
    Output:
    S        CNT
    D          2
    A          4
    {code}
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to count and calculate total percentage for field

    hi all,
    i have two tables as follow:
    i have a inner join as follow :
    SELECT distinct dbo.Motor_Story.Name, dbo.Goods.kala, dbo.Goods.type, dbo.Goods.id_story FROM 
    dbo.Goods INNER JOIN dbo.Motor_Story ON dbo.Goods.id_story = dbo.Motor_Story.Id
    I have the following data are entered
    in my database,
    type
    kala
    no
    Panaconic                       
    Monitor
    1
    Sony                            
    Telvision
    2
    Samsung                         
    Phone
    3
    Vaio                            
    Computer
    4
    Panaconic                       
    Monitor
    5
    Sony                            
    Telvision
    6
    Panaconic                       
    Phone
    7
    Panaconic                       
    Printer
    8
    Sony                            
    Computer
    9
    Panaconic                       
    Monitor
    10
    Sony                            
    Telvision
    11
    Samsung                         
    Phone
    12
    Panaconic                       
    Printer
    13
    i want create a view so that, count 'dbo.Goods.type' and calculate total percentage of ' dbo.Goods.type, than other products based on 'dbo.Goods.kala'.
    pls hlp me.
    best regards.

    Hi,
    Welcome to MSDN.
    I am afraid this is not the proper forum for this issue, since it is not a specific vb.net issue.
    I would suggest you consider posting this issue in sql forum for more dedicated support.
    http://social.msdn.microsoft.com/Forums/en-US/home?category=sqlserver
    Thanks for your understanding.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Query with running Total

    Hello,
    I have a insert from query:
         insert into tablexxxx
         SELECT ALL      G.c1, G.c2,
                         CASE
                         WHEN G.colt1  NOT IN ( 'A', 'B', 'C') THEN G.DATA1
                         WHEN G.colt1      IN ( 'B', 'C')      THEN &DATASF
                         WHEN G.colt1      =   'A'             THEN &DATASI
                         END colt3,
                     CASE G.colt2 WHEN 'D' THEN  G.IMP1  else 0   END    IMPD,
                    CASE G.colt2 WHEN 'A' THEN  G.IMP1  else 0   END    IMPA,
                         CASE
                         WHEN G.colt1  NOT IN ( 'B', 'C')
                         THEN (&VALU1 -1)
                         ELSE COLX
                         END      COLX,
         FROM table1 G, table2 S, table3 C
         WHERE  G.colt4    = S.colt4      
         AND (     (G.colt1  = 'M' AND  G.DATA1 BETWEEN &DATA_IP AND &DATA_FP AND G.TCOL6 = EXTRACT(YEAR FROM &DATA_IP) - 1 )
                OR (G.colt1 <> 'M' AND  G.DATA1 BETWEEN &DATA_IP AND &DATA_FP)
                OR (G.colt1  = 'A'  AND (&DATASI BETWEEN &DATA_IP AND &DATA_FP AND G.DATA1 = &DATAIE) )
                OR (G.colt1  = 'B'  AND (&DATASF BETWEEN &DATA_IP AND &DATA_FP AND G.DATA1 = &DATAFE) )
                OR (G.colt1  = 'C'  AND (&DATASF BETWEEN &DATA_IP AND &DATA_FP AND G.DATA1 = &DATAFE) )  )
         AND  G.colt5  = C.colt5(+)
         ORDER BY 3,4,5 ; 
         NOW I HAVE TO INSERT in previous query 2 RUNNING TOTALE e.g:
               sum(CASE G.colt2 WHEN 'D' THEN  G.IMP1 + &myvalue1  else 0   END    IMPD) over (order by CASE
                         WHEN G.colt1  NOT IN ( 'A', 'B', 'C') THEN G.DATA1
                         WHEN G.colt1      IN ( 'B', 'C')      THEN &DATASF
                         WHEN G.colt1      =   'A'             THEN &DATASI
                         END) running_sum,
             sum(CASE G.colt2 WHEN 'A' THEN  G.IMP1 + &myvalue2  else 0   END    IMPA) over ((order by CASE
                         WHEN G.colt1  NOT IN ( 'A', 'B', 'C') THEN G.DATA1
                         WHEN G.colt1      IN ( 'B', 'C')      THEN &DATASF
                         WHEN G.colt1      =   'A'             THEN &DATASI
                         END) running_sum1    Could anyone help me to write it? ( maybe is better write it with SELECT-UNION?)
    Thanks in advance

    Hi IceMan,
    I think about having resolved in this way, I don't sincerely believe that is the optimal solution,
    but of sure it is that simpler,anyway, one opinion of yours would be very pleasant:
    1) I have made an Insert-Select with the 2 runnings total = 0
    INSERT INTO  TABLEX
    SELECT ALL G.c1, G.D2,
    CASE
      WHEN G.colt1 NOT IN ( 'A', 'B', 'C') THEN G.DATA1
      WHEN G.colt1 IN ( 'B', 'C') THEN &DATASF
      WHEN G.colt1 = 'A' THEN &DATASI
    END D1,
    CASE G.colt2 WHEN 'D' THEN G.IMP1 else 0 END IMPD,
    CASE G.colt2 WHEN 'A' THEN G.IMP1 else 0 END IMPA,
    CASE
    WHEN G.colt1 NOT IN ( 'B', 'C')
    THEN (&VALU1 -1)
    ELSE COLX
    END COLX, 0 RUNIMP_D, 0 RUNIMP_A
    FROM table1 G, table2 S, table3 C
    WHERE ........
    ORDER BY 3,4,5 ;2) in the populated table(step 1) I have made an UPDATE-SELECT getting the 2 runnings total
    UPDATE TABLEX A SET  (RUNIMP_D, RUNIMP_A ) =(
    SELECT  --G.D1, G.D2, G.IMPD,G.IMPA,
             SUM(G.IMPD) OVER (ORDER BY G.D1, G.D2,G.IMPD) RS1  ,
           SUM(G.IMPA) OVER (ORDER BY  G.D1, G.D2,G.IMPA) RS2
      FROM TABLEX G
    WHERE  G.ROWID = A.ROWID     
    --ORDER BY 1,2
    where G.D1 is that I get from
    CASE
    WHEN G.colt1 NOT IN ( 'A', 'B', 'C') THEN G.DATA1
    WHEN G.colt1 IN ( 'B', 'C') THEN &DATASF
    WHEN G.colt1 = 'A' THEN &DATASI
    END D1
    and
    G.IMPD is:
    CASE G.colt2 WHEN 'D' THEN G.IMP1 else 0 END IMPDThanks again for your reply

  • How to calculate total time of mouse movement

    Hi Everyone.
    I am doing project on gesture recognition with touchpad. I need to find out the total time of completion of gesture on touchpad. For that I need to calculate total time of cursor movement on laptop touchpad. When cursor starts moving, that time I need to capture time and when it stops also. I need to find out difference between the start time and stop time. Please help me to do this task. Presently I am trying with event structure and timed structure but I am getting only present time only. I tried with counter but unable to get the difference.

    I missed the mouse move event when I saw this earlier, and for some reason I thought the first attempt would give you what you wanted. 
    Here is a different VI. It uses mouse move event with some logic that remembers the first mouse move event. Otherwise, you won't get the correct time.
    Attachments:
    Mouse Move Time.vi ‏11 KB

  • What will be the peoplesoft query to calculate voluntary termination count and involuntary termination count? I am working on OBIA HR analytics workforce deployment reports and need to validate the reports

    what will be the peoplesoft query to calculate voluntary termination count and involuntary termination count? I am working on OBIA HR analytics workforce deployment reports and need to validate the reports. I also want to know the tables involved

    Hi Andrew,
    Part A:
    I've done some restating of the question, and distributed the calculations among several fields, not all of which need to be included on the visible layout. Other than formatting the Date fields and moving the 'Completed Date' field and its label, I've left this in the default "Layout 1" produced by AppleWorks.
    Field List:
    Priority: Popup menu with six items: 00, J, D, 1, 2, 3  Defaults to 00
    TL (time limit in months): Calculation:  CHOOSE('Priority',0,1,3,4,6,12)
    Received: Date. Option: Automatically insert today's date (ie. Date Record created) (may be edited)
    Target Date: Calculation:
    DATE(YEAR('Received')+INT(MONTH('Received')+'TL')/12,MOD(MONTH('Received')+'TL', 12),DAY('Received'))
    Remaining (Days): Calculation: INT('Target Date'+1-NOW())  (see revision below)
    Completed: Checkbox. Set default value to Unchecked.
    Completed Date: Date: Entered manually
    OnTarget: Calculation: IF('Completed',IF('Completed Date'<'Target Date',"On Target","Over"),IF(INT(NOW())>'Target Date',"Over","On Target"))
    The On Target field shows the current status of the case while still open, and the state on the closing date when it was closed.
    Having done that, I was unhappy with the Remaining field continuing to calculate an ever larger negative number after the case had been closed. Hence this revision below:
    Remaining: Calculation: IF('Completed','Target Date'-'Completed Date',INT('Target Date'+1-NOW()))
    Shows the number of days remaining while the case is open, the days remaining at completion if the case has been marked Completed and the completion date entered.
    Rsults (and some further formatting of the Layout) below.
    Part B:
    You will need Subsummary parts when sorted on Completed and on On Target. Fields can appear on  a Layout only once, so each subsummary part will need a separate Summary type field for each field to be summarized.
    Regards,
    Barry

Maybe you are looking for