How to Perform this calculaction in Query

Hi Experts
How can i achieve this Calculaction at query Level.
Data:
Emp_ID--Wage_IDPayroll_Date--Amount
1--03925.01.2008-5000
1--03925.02.2008-5000
1--03925.03.2008-5000
1--03925.04.2008-6000
1--03925.07.2008-6000
The employee will have No of different Wage types in his pay run.
But as per my requirment i want to calculacte Employee Salarly.
Lets Consider Wage Type 039 which is Salarly
The Cal i need to perform is
Select the Wage Type 039 and then Select the Latest (25.07.2008) Payroll date and then select the amount assiociated with it for and the 12* amount give salarly
In the above case aslarly should be 72,000

Hi,
Soluition can be the following:
Put Pay_Roll_date also as a key-figure in your cube and add to columns.
Add condition (top 1) on keyfigure,
In Character Assignment tick ïndividual char. and Char combinations.
Tick also Emp_id and Wage ID. do not tick Pay_Roll_date (the characteristics, not the keyfigure)
Hide key-figure Pay_roll_date & Amount
Make calculated keyfigure Salary = 12 * Amount.
That should do it.
Udo

Similar Messages

  • How to achieve this Calculaction in Query Designer

    Hi Experts
    Could you please update me on How can i acieve this calculaction...
    I had 2 KFs & 1 Formula (% Calculaction) in my Report
    Col A--Col B---Col C (%)-----
    R1----32 50%--
    R2----23(-33%)--
    R3----141217%--
    R4----161060%--
    Over
    all
    Result352729%--
    Col C = Col A % Col B
    In my Query  i had a condition on Col C
    Show Col C >0
    Then output of query is
    Col A--Col B---Col C (%)-----
    R1----32 50%--
    R3----141217%--
    R4----161060%--
    Over
    all
    Result352729%--
    THE OVERRESULT IS NOT CHANGING
    MY requirment is to achieve overresult for above query output
    Over
    all
    Result332437%--
    I can managed to get the Overall result for Col A & Col B in the Properties>Calculactions>Calculate result As-->Total
    What setting i have to make to change Col C Overall result
    Thanks

    Hi,
    I think that deactivating the condition and using a formula instead will work.
    Try e.g. this formula for Col C:
    ( 'Col A' % 'Col B' > 0 ) * ( 'Col A' % 'Col B' )
    You might also want to activate zero suppression in the report.
    Hope it helps.
    BR
    Stefan

  • How to Achieve this in SQL Query?

    How to Achieve this ?
    I have a table with numeric value populated like this
    create table random_numeral (numerals Number(10));
    insert into random_numeral values (1);
    insert into random_numeral values (2);
    insert into random_numeral values (3);
    insert into random_numeral values (4);
    insert into random_numeral values (5);
    insert into random_numeral values (6);
    insert into random_numeral values (56);
    insert into random_numeral values (85);
    insert into random_numeral values (24);
    insert into random_numeral values (11);
    insert into random_numeral values (120);
    insert into random_numeral values (114);
    Numerals
    1
    2
    3
    4
    5
    6
    56
    85
    24
    11
    120
    114
    I want to display the data as follows
    col1 / col2 / col3
    1 / 2 / 3
    4 / 5 / 6
    11 / 24 / 56
    85 / 114 / 120
    Can anyone Help me?

    I hope there might be some simple way to do this and waiting for experts to reply.
    Try the below query.
    SQL> select * from random_numeral;
      NUMERALS
             1
             2
             3
             4
             5
             6
            56
            85
            24
            11
           120
      NUMERALS
           114
           100
           140
    14 rows selected.
    SQL> select a.numerals ||' / '||b.numerals||' / '||c.numerals from
      2          (select numerals,rownum rn1 from
      3          (
      4              select numerals,mod(row_number() over(partition by 1 order by numerals),3)
      5              from random_numeral
      6          )
      7          where rn=1) a,
      8          (select numerals,rownum rn1 from
      9          (
    10              select numerals,mod(row_number() over(partition by 1 order by numerals),3)
    11              from random_numeral
    12          )
    13          where rn=2) b,
    14          (select numerals,rownum rn1 from
    15          (
    16              select numerals,mod(row_number() over(partition by 1 order by numerals),3)
    17              from random_numeral
    18          )
    19          where rn=0) c
    20  where   a.rn1=b.rn1(+)
    21  and b.rn1=c.rn1(+)
    22  /
    A.NUMERALS||'/'||B.NUMERALS||'/'||C.NUMERALS
    1 / 2 / 3
    4 / 5 / 6
    11 / 24 / 56
    85 / 100 / 114
    120 / 140 /
    SQL>Cheers,
    Mohana

  • How to put this condition in Query

    Dear experts,
    I have a scenario where in the calculation should be dynamic between key figures in query
    For example i have a
    Target Cost and Actualcost1, Actualcost2, Actualcost3
    i need to findout the variance between the Target and Actual
    but the catch is that i need to findout the variance with the latest actual cost
    1. )  Target cost = 100
    Actual cost1=10, Acutal cost2=0, actual cost3=0
    then the formula should be Actual cost1-target cost
    2. )But if
    Target cost  =100
    Actual cost1=10, Actual cost2=5, Actual cost3=0
    then the formula should be Actual cost2- Target cost
    3. Target cost =100
    Actual cost1=10, Actual cost2 = 5, Actual cost3= 15
    then the formula should be Actual Cost3-Target cost
    How to achieve this
    Thanks and regards
    Neel

    Hi Neel,
    Do you have indicator saying that a particular actual cost is the latest? If you have any indicator thsi would make the job easy. Else you need to create new formulas to derive the logic.
    Else you can proceed with the belwo logic.
    1.target cost
    2. Actual Costs 1 - Hide
    3. Actual Costs 2 - Hide
    4. Actual Costs 3 - Hide
    5. New formula whcih evaluates the latest.
    Write the condition
    If Actual costs3 = 0 and actual cost2 = 0 then actual cost1.
    else if actual cost2= 0 then actual cost1
    else if actual cost1 NE 0 and actual cost2 NE 0 then Actual cost3.
    Then hide the above new formula.
    And in a new formula you can find the diff between the Target cost and the latest cost derived in teh above new formula.
    If the conditions is too big in the above new formula, you can split across two three new formulas and derive the logic.
    Just make some changes to the above logic if it is not 100%.
    I believe this logic will work.

  • How to do this with one query?

    here is the basic query
    <cfquery name="getCenturies"
    datasource="#application.dsn#">
    SELECT riderId, rideDistance, rideDate
    FROM mileageLog
    WHERE rideDistance > 99
    </cfquery>
    and my results would be something like
    Kevin 114
    Chris 103
    Kevin 100
    Don 102
    Kevin 106
    Now how can I get the count for each person
    Kevin 3
    Chris 1
    Don 1

    jkgiven wrote:
    > I appreciate your help
    >
    > taking a look at your suggestion, the >99 part needs
    to refer to the
    > rideDistance column (the 114, 103, 100, 102, 106) thus
    the greater than 99
    > amounts. And how would I refer to each rider count total
    (Kevin 3, Chris 1, Don
    > 1)
    >
    > I reworked the quety to this... but still no go
    > SELECT riderId, count(riderId) AS riderCount,
    rideDistance
    > FROM mileageLog
    > GROUP By riderId
    > HAVING rideDistance >99
    >
    > It tells me that rideDistance is not part of an
    aggregate function. I thought
    > to get around this I just had to have each variable
    called for in the SELECT
    > line?
    >
    in the SELECT statement change rideDistance to
    SUM(rideDistance) - i
    think that is what you want to get anyway, isn't it? - and
    you won't get
    that error. it's not the SELECT statement you have to have
    the vars
    listed in; it's either in the GROUP BY or use an aggregate
    function on it..
    Azadi Saryev
    Sabai-dee.com
    Vientiane, Laos
    http://www.sabai-dee.com

  • HOw to achieve this at report/query level

    Hi Experts
    Please update me how can i achieve this at query level
    Lets Consider Data in my Cube
    Dept_id--Date--
    Qty
    -101.01.20093-----
    -101.01.20095-----
    -101.01.20098-----
    -101.01.20091-----
    -101.01.20099-----
    That is how data is avaliable in my cube
    When i run the report the output is displayed as
    Dept_id--Date--
    Qty
    -101.01.200926-----
    That is what it actually do...it will sumirises into one record.....
    BUT
    My requirment is the query result should be ....with out summarisation
    Dept_id--Date--
    Qty
    -101.01.20093-----
    -101.01.20095-----
    -101.01.20098-----
    -101.01.20091-----
    -101.01.20099-----
    Please update me is there any setting i can make at query level

    Hi,
    By default data will be aggregated in Query.
    How come data available in Cube at different aggregation level...? due to request no or some other characteristic which is unique for each record...??
    If some other characteristic available, make it available that characteristic in rows to get desired result.
    Srini

  • How to perform this loop Sum?

    Hi,
    This is my issue:
    Position       Seq        Amount
    10                 0             1000  
    10                 1               500
    10                 2               250
    20                 0             1000
    30                 0             2000
    What i wanted to do is if under the same Position and have Seq > 0 then sum up the Amount with Seq > 0 ONLY which is 750 for the Position 10. If the Position only have Seq = 0 then only take Amount where Seq = 0 which is 1000 for Position 20 and 3000 for Position 30.
    Can anyone teach me on how to use the For Loop to perform the above task? Or if there is any other solution to it also is very much appreciate.
    Thank you very much.
    Ng

    Hi Ng,
    You need to use a running total to sum the values. 
    1)  Create a group on Position.  Format the Detail section to Hide. 
    2)  Create a formula like:
    NumberVar TotalAmount := 0;
    Drop this formula into the Group Header section and format the formula to suppress. 
    3)  Create another formula like below and drop into the Detail section. 
    NumberVar TotalAmount;
    If > 0 Then
         TotalAmount := TotalAmount + ;
    4)  Create one last formula and drop it into the Group Footer. 
    NumberVar TotalAmount;
    What happens is the formula in the Group Header will initialize the variable called TotalAmount to 0 when the value of Position changes. 
    The second formula is the one that does the summing.  Because it's in the detail section, you do not want to show this.  To troubleshoot you may want to see it but all it does is increment with each record. 
    The last formula will show the total for each Position. 
    Good luck,
    Brian

  • How to fix this QtyOnHand FMS query with SO and PO ShipDates.

    Hi Forum,
    I have this query that returns available quantity that takes into account (from PO)  on order and on commit (SO) based on dates of order and receive.
    declare
    @onhand as float,
    @openqty_s_order as float,
    @openqty_p_order as float
    set @onhand = (select oitw.onhand from oitw
    where oitw.whscode = $[$38.24.0] and oitw.itemcode = $[$38.1.0])
    set @openqty_s_order = (select sum(openqty) from rdr1
    where (rdr1.shipdate <= $[$38.25.0]) and (rdr1.itemcode = $[$38.1.0]) and (rdr1.whsCode = $[$38.24.0]))
    set @openqty_p_order = (select sum(openqty) from por1
    where (por1.shipdate <= $[$38.25.0]) and (por1.itemcode = $[$38.1.0]) and (por1.whsCode = $[$38.24.0]))
    select (@openqty_p_order + @Onhand - @openqty_s_order)
    Whenever the SO ShipDate is <= PO Ship Date, the value returned by entire query is 0.0 instead of OnHand - Qty committed by SO's.
    This query works when SO ShipDate is >= PO ShipDate, it returns OnHand-Qty Committed by SOs + Available through POs
    To repeat the problem:
    BASICALLY whenever @openqty_p_order has no value returned then the entire select -> select (@openqty_p_order + @Onhand - @openqty_s_order) returns 0.0, even though @onhand - @openqty_s_order have values that is not zero.
    Appreciate your help. Thank you.

    Hi Syed Aleem,
    Modify the Query as follows :
       Select @OpenQty=isNull(sum(openqty),0)
       From RDR1
       where (rdr1.shipdate <= $[$38.25.0]) and (rdr1.itemcode = $[$38.1.0]) and (rdr1.whsCode = $[$38.24.0]))
       Select @openqty_p_order=isNull(Sum(OpenQty),0)
       from por1
       where (por1.shipdate <= $[$38.25.0]) and (por1.itemcode = $[$38.1.0]) and (por1.whsCode = $[$38.24.0]))
    The problem occurs when there is no row to select then aggregate clause returns NULL which cannot be used in any Operation .
    Hence use isNull function to avoid this error.
    Thanks and Regards,
    Pooja Singh.

  • How to perform this type of search in Pages

    I have a list of over a thousand words and need to do a search for general words that would fit in a particular space, i.e. a crossword puzzle and needs 8 letters.
    How do you search a list of words in Pages for all words that have the fifth letter as an E?
    or... how would you search for a word that has the following that you know...
    ???A??SE
    So you are looking of a specific list for a word, or in my case could be a name, that would be on that list that has an A as the fourth letter and ends in SE and is 8 letters long?
    I have to do search strings off this list and it has thousands of names and words.
    Thank you.
    Randal

    Thank you for that. Any suggestions on a program that can. Just tried Bean and no luck there either. Bummer. Sometimes I do miss Windows, but never enough to go back to it. So need a text editor that can GREP...

  • How to perform this kind of requirement

    Hi Experts,
    User wants a report to track customer attitute history and also the change indicator. I created a DSO  and set a key figure to record the customer attitude (key are customer ID and system date). use number 1,2,3,4,5 instead of five different kinds of attitude in DSO. In query, I create two restrict key figures and use user input two date variable to restrict the value of that key figure. current issue is that the value display in report is as number 1,2,3,4,5. user can't get the description as five kinds of attitude. Could you please give some comment and solution about this kind of requirement. Thanks.
    Br, Delve

    Hi,
    "Attitude" has to be present in the DSO/Cube. It could be a Data field in DSO but it has to be a dimension in the Cube. Only then you will be able to pull it in the query.
    Being in dimension, every new value of the attitude will create a new record in the cube. So for 5 different days you will get 5 records. Then in query if you drag this dimension, it will show you 5 different attitudes as per date.
    You can choose to display only the latest attitude by restricting this field in the query to the last date in the date range.
    Regards,
    Nishant.

  • How to solve this issue in query definition

    Hi Experts,
    I need to solve an issue existed in a query.
    This query is built on a infocube which main char and key figures as follow:
    sales doc., item, material, fiscal year/period, ordered qty, billed qty.
    The query has to show opened qty for specific sales doc / item level. the formula for  opened qty = ordered qty - billed qty. But some of the sales doc /item are partial delivered i.e. there are several deliveries' entries for same sales doc/itm. for example the entries as follow:
    sales doc---- item--materailfiscal year/periodordered qty-- billed qty
    20001------ --    30--- m1 2009/002  200--
      25
    20001--    30 -m1 2009/002 -  200--
    100
    Then after the execution of the query we got the opened qty: (200 - 25) + (200 - 100) = 175. This is totally wrong because the correct opened qty should be 200 - 25 - 100 = 75.
    Could any body provide a solution to get the correct result ?
    Thanks a lot
    Edited by: Leon Ouyang on Dec 15, 2008 4:12 PM
    Edited by: Leon Ouyang on Dec 15, 2008 4:13 PM
    Edited by: Leon Ouyang on Dec 15, 2008 4:43 PM

    Hi Leon,
    Somewhere in your infocube there must be an indicator whether it is the first delivery or not.
    Change ordered quantity into a resctricted keyfigure using the restriction of the indicator first delivery.
    Your overview will be:
    sales doc---- item--materailfiscal year/periodordered qty-- billed qty
    20001------ -- 30--- m1 2009/002 200--
    25
    20001-- 30 -m1 2009/002--
    100
    And your total will be correct.
    Success,
    Udo.

  • How to perform this action..

    am having a condition in where clause like :-
    "and decode(si1.common_cat_id,4,si1.site_id,1, si1.site_id) = td.site_id(+)"
    now my query is running with condition but not giving the desired results..
    My requirement is like :-
    if si1.common_cat id = 4/1 then si1.site_id = td.site_id(+) else this condition sould not make any diffrence to my query..
    Any suggestions??
    Thanks
    Kapil

    OK. Great.
    :"else this condition should not make any diffrence to my query"?
    So, you have two queries.
    one query has following conditions (in addition to other conditions):
    AND si1.common_cat id IN (4,1)
    AND si1.site_id = td.site_id(+)
    the second query does not have these two conditions.
    Is this what you mean by "else this condition should not make any diffrence to my query"?
    null

  • Filtering on 0activity - how to achieve this in a query?

    Hi all,
    I have a requirement in my report which is: Give me, of all network numbers, only they keyfigures concering activity 0001.
    In the BEx querydesigner I have 0WBS_ELEMT, 0NETWORK and 0ACTIVITY as characteristics.
    The next step is that I want to filter on a certain activity code, say 0001.
    The only problem is that the key of 0ACTIVITY consists of both 0NETWORK and 0ACTIVITY and I can never select just 0001 as a filter.
    Is there a way to achieve filtering on query level? Or do I have to adapt my model in BW?
    Thanks,
    JW

    Thank you Alexander!
    Well, I found several sub optimal solutions in the query designer.
    One is creating a variable with an offset value to select only the activity code, and using this to create a keyfig z_activity to display just the activity code. Then, you can set a condition on this keyfig to show only certain activity codes.
    Advantage: datamodeling unchanged.
    Disadvantage: high maintenance solution
    The optimal solution seems to be on the BW-side: an option is to define an attribute only z-infoobject and add it to InfoObject 0ACTIVITY, filling via the routine of the InfoObject in the maintenance screen.
    The downside to Alexanders solution is that, by adding it to the InfoProvider, you make it transaction data while it is actually master data...
    Edited by: J. W. ter Avest on Jan 13, 2011 1:11 PM

  • How to perform this?by copying the IE URL of successfully logged in to another IE Browser and the user still logs in which is wrong.

      I have a problem. the user had successfully logged in in an IE Browser. Then I copy the URL of the IE
      to another IE Browser. The output must be, the browser will ask the user to log in again which is correct.
      In my application, the output was still logged in which is wrong.
      Kindly help

    I have the Application.cfm
    I dont use parameter such as CFID and CFTOKEN for my code.
    Is it possible to do it without using this parameter?
    Can
    you give me simple code that if it is successfully logged in, then it
    will perfom that the browser will ask you to log in again.
    Thank you for the reply and knowledge.
    jepoy1

  • How to get this with Single query

    Friends
    I am sure using SQL analytical function, the following can be achieved using a single query:
    Date_value | Cust_id | Customer_tenue | avg_bal
    01-aug-09 | 111 | 0 | 1000
    01-aug-09 | 112 | 1 | 2000
    01-aug-09 | 113 | 2 | 900
    01-aug-09 | 114 | 3 | 1250
    01-sep-09 | 111 | 1 | 1200
    01-sep-09 | 112 | 2 | 2000
    01-sep-09 | 113 | 3 | 1900
    01-sep-09 | 114 | 4 | 1250
    01-oct-09 | 111 | 2 | 1100
    01-oct-09 | 112 | 3 | 2200
    01-oct-09 | 113 | 4 | 1900Expected result
    If customer’s tenure is 0 then mark as ‘New’,
    If customer’s balance is increased from last month then mark as ‘Augment’
    If customer’s balance is same as last month then mark as ‘Maintain’
    If customer’s balance is decreased from last month then mark as ‘Diminish’
    Else ‘Left’
    Help please....

    If customer’s tenure in last month is 0 then mark as ‘New’,There's not such case in test data... last month is October, isn't it?
    SQL> with t as (select DATE '2009-08-01' Date_value, 111 Cust_id, 0 Customer_tenue, 1000 avg_bal from dual union all
      2  select DATE '2009-08-01', 112 , 1 , 2000 from dual union all
      3  select DATE '2009-08-01', 113 , 2 , 900 from dual union all
      4  select DATE '2009-08-01', 114 , 3 , 1250 from dual union all
      5  select DATE '2009-09-01', 111 , 1 , 1200 from dual union all
      6  select DATE '2009-09-01', 112 , 2 , 2000 from dual union all
      7  select DATE '2009-09-01', 113 , 3 , 1900 from dual union all
      8  select DATE '2009-09-01', 114 , 4 , 1250 from dual union all
      9  select DATE '2009-10-01', 111 , 2 , 1100 from dual union all
    10  select DATE '2009-10-01', 112 , 3 , 2200 from dual union all
    11  select DATE '2009-10-01', 113 , 4 , 1900 from dual)
    12  select date_value, cust_id, avg_bal, oldbal, case when Customer_tenue=0 and nextbal is null then 'NEW'
    13                                                    when oldbal<avg_bal then 'Augment'
    14                                                    when oldbal=avg_bal then 'Maintain'
    15                                                    when oldbal>avg_bal then 'Diminish'
    16                                                    else 'Left' end status
    17    from (select date_value, cust_id, customer_tenue, avg_bal, LEAD(avg_bal) over (partition by cust_id order by date_value desc) oldbal,
    18                 LAG(avg_bal) over (partition by cust_id order by date_value desc) nextbal
    19            from t)
    20  order by cust_id, date_value;
    DATE_VALU    CUST_ID    AVG_BAL     OLDBAL STATUS
    01-AGO-09        111       1000            Left
    01-SET-09        111       1200       1000 Augment
    01-OTT-09        111       1100       1200 Diminish
    01-AGO-09        112       2000            Left
    01-SET-09        112       2000       2000 Maintain
    01-OTT-09        112       2200       2000 Augment
    01-AGO-09        113        900            Left
    01-SET-09        113       1900        900 Augment
    01-OTT-09        113       1900       1900 Maintain
    01-AGO-09        114       1250            Left
    01-SET-09        114       1250       1250 Maintain
    Selezionate 11 righe.Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/29/estrarre-i-dati-in-formato-xml-da-sql/]

Maybe you are looking for

  • How to add date in XSLT?

    All, soa version: 11.1.1.4 There is a requirement for me to add date to the current date in XSLT.  I searched in 'Data functions', there I couldn't find any pre-defined functions.  How do I achieve it in XSLT?  Any help is appreciated. thanks sen

  • HT1688 where do i find my contacts that i backed up last week

    I know that there is a way to get all of the contacts that I backed up last week, but I cannot find it on my phone.  Any help?

  • Labview Forum Star Rating Seems Odd - For Those Blue Contribute​rs ;)

    Whilst browsing throught the fourms one day.... I noticed the following indicated 1 star thread Absolutely Beginner in LabView.(But advanced in CVI) Need help! http://forums.ni.com/ni/board/message?board.id=170​&message.id=39090 Now I read these one

  • [SOLVED] No Audio in Flash Video

    In x86_64 i dont have any sound in flash videos. Sound everywhere else works. Until yesturday it also worked here, there wasnt any changes, even no updates which is quite mysterious. First i tried updates but nothing changes, i have sound everywhere,

  • Tutorials on Windows do not recognized default JSP URI

    On Windows 2000 as well as XP I get the following default message when I try to run any tutorial I create by following the tutorial instructions. However, when I ran the pre-built JATO samples they run OK. It seems there is some URI context path prob