Problem in a Formula.!!

Hi all
I have a KF( TRANSACTION),for which I get negative Values,So I want to make that to ZERO if negative.I made it through an IF STATEMENT...
But now based on that formula,I need to calculate TOTAL SALES..
TOTAL SALES= CHARGE + TRANSACTION.
When I use the TRANSACTION...the result I shld get some values
But I am getting as *....may be for -ve values,but wht about +ve values.For +ve values also I am getting *....
Is there any other idea to make the -ve value ZERO.
urgent..Pls give some idea.
Thanks

Hi,
have you deleted with your formula the unit from the key figure?
try the nodim command in the formula for total sales.
regards
Cornelia

Similar Messages

  • Problem in Pricing Formula

    Hi,
    For specifyic condition types, i need the condition values to be displayed always in 'INR', i have created a formula routine for this and assigned to my pricing procedure .
    structures i am changing are XKOMV and KOMK.
    using 'CONVERT_TO_LOCAL_CURRENCY' i am converting the amount
    ( xkomv-kwert ) into indian currency value and for currency key
    i have passed 'INR' to komk-waerk field
    here i am facing 2 problems, after coming out of my include xkomv-kwert is getting overridden by old value in some other include, hence i am getting the same old value on the screen and currecny key is getting dislayed as 'INR' for all the records not just only for my condition type.
    Can you pls correct me if what is done by me is wrong
    Regards,
    Sowjanya

    An amount in local currency is calculated from a specified foreign currency amount. For this, you may either specify the translation rate manually (Parameter RATE) or have the system determine it from table TCURR on the basis of the rate type, date and currency key. Because the ratios for the units of the currencies involved in the translation are significant for this translation, table TCURF is always read by the program, and there must be a valid entry there for the data specified. IF exchange rate fixing is defined for the exchange rate type TYPE_OF_RATE or an alternative exchange rate is defined for the currency pair, this information is transferred to the calling program.
    When table TCURR is read, the foreign currency key is always taken as the first part of the key and the local currency as the second part.
    or you can also do the manual conversion by taking the exchange rate from table TCURR for the particular date and multiply this exchage rate to foreign amount then to get the amount in local currency.
    hope this will work.

  • Substitution Variable problem in member formula

    I'm using the following member formula for a member in a sparse dimension - Scenario.
    @VAR("Actual",&PO_PriorLE->"Final");
    I can get this to validate in Essbase, but when I try putting it into Planning, the refresh to Essbase bombs and the formula will not validate in Planning.
    Version - 9.3.1
    Thoughts?
    Regards,
    Paul
    Edited by: penglish on May 27, 2009 3:20 PM

    Hi,
    I have just tried it on 9.3.1 patch 10 and had no problems.
    I take it the member assigned to &PO_PriorLE already exists ?
    Have you tried replacing the substitution var for the real member name in the formula.
    What is the error message when you try and validate?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Problem in using formula when key figure is commulative

    Hi all ,
    I am problem in generating the report when we use the  of cummulative key figure to the formula..
    consider the following senerio..
    Date      KF1 KF2 KF1(C) Kf2(C) Formula (KF1(C) - KF2(C)
    5.10.2005 1   2   1       2      -1 (wrong result)
    6.10.2005 3   4   4(1+3)  6      -1
    7.10.2005 5   6   9(4+5)  12     -1
    System is taking the actual KF1data is subtracted with KF2 data it not taking cummulative data, Actually my requirement i want to subract the cummulative data between two key figure (ie KF1(c)-KF2(c))
    My Required Output:
    Date      KF1 KF2 KF1(C) Kf2(C) Formula (KF1(C) - KF2(C)
    5.10.2005 1   2   1       2            -1 (Correct)
    6.10.2005 3   4   4(1+3)  6            -2 (4-6)
    7.10.2005 5   6   9(4+5)  12           -3 (9-12)
    pls let through the lights on the above issues.
    with Regards,
    Hari

    Hi Murali..
    Thanks a lot, now i got a proper output and working fine..
    what i did yesterday was i have creted a two key figure as a cummulative key figure ..
    and when i try to subtract two cummulative key figure system is subtracting with actual key figure and hence i got wrong result.
    Today i did same thing, only diffence is i made the third formula key figure as cummulative ..
    With regarsds,
    Hari

  • IP - Problem in FOX formula: how to use 0FISCPER3 counter of a DO function?

    Hi,
    IP 7.0:
    I'd like to define a top-down function which distributes the values in 0FISCPER3 = # to the periods selected by the user with two variables (period from and period to variable).
    -> Problem I experience is the conflict in different data types. How can I use the value of the selection variable for 0FISCPER3 in a counter of a DO function. Here is the code:
    formula example:
    change the value of the keyfigure ZQUANTITY of PRODUCT11
    to the value of ZQUANTITY of PRODUCT09 times 1.1
    assumption for fields to be changed: ZPRODUCT
                     ==> operand: {name of keyfigure, ZPRODUCT}
      DATA L_FACTOR TYPE F.
      L_FACTOR = 1.1.
      { ZQUANTITY, PRODUCT11 } = { ZQUANTITY, PRODUCT09 } * L_FACTOR.
    DATA LV_COUNTER TYPE 0FISCPER3.
    DATA LV_PERIODS TYPE  0FISCPER3.
    DATA LV_PERIOD_FROM TYPE 0FISCPER3.
    DATA LV_PERIOD_TO TYPE 0FISCPER3.
    *Transfer variable period from and period to into local variable and count interval of periods.
    LV_PERIOD_FROM = VARV(Z_PERIOD_FR).
    LV_PERIOD_TO = VARV(Z_PERIOD_TO).
    LV_PERIODS =  LV_PERIOD_TO - LV_PERIOD_FROM.
    Do top-down distribution for all adjustment values on period = #
    LV_COUNTER = (LV_PERIOD_FROM).
    DO.
    <b> { 0G_QVVGRM, LV_COUNTER} = { 0G_QVVGRM, # } / LV_PERIODS.</b>
    <b> LV_COUNTER =  LV_COUNTER + 1.</b>
        IF LV_COUNTER >= LV_PERIOD_TO.
            EXIT.
      ENDIF.
    ENDDO.
    -> the lines indicated in bold give errors. If I change the datatype of LV_COUNTER to I, how to start the do function the value of the first period selected by the user?
    function TMLV is also not supported apperantly in IP.
    Help would be very appreciated
    regards
    D

    Small extension:
    function TMVL does work, but I still have the problem to use the difference in periods solely for calculation in a key figure. I cannot switch from type 0FISCPER into F or I. In SAP R/3 ABAP this is no problem but apperantly in FOX it is???
    Hereby revised coding:
    DATA LV_COUNTER TYPE I.
    DATA LV_PERIODS TYPE  0FISCPER3.
    DATA LV_PERIOD_FROM TYPE 0FISCPER3.
    DATA LV_PERIOD_TO TYPE 0FISCPER3.
    DATA LV_FISCPER3 TYPE 0FISCPER3.
    *TRANSFER VARIABLE PERIOD FROM AND PERIOD TO INTO LOCAL VARIABLE AND COUNT INTERVAL OF PERIODS.
    LV_PERIOD_FROM = VARV(Z_PERIOD_FR).
    LV_PERIOD_TO = VARV(Z_PERIOD_TO).
    LV_PERIODS =  LV_PERIOD_TO - LV_PERIOD_FROM.
    DO TOP-DOWN DISTRIBUTION FOR ALL ADJUSTMENT VALUES ON PERIOD = #
    LV_COUNTER = 0.
    DO.
      LV_FISCPER3 = TMVL(LV_PERIOD_FROM,LV_COUNTER).
    <b>{ 0G_QVVGRM, LV_FISCPER3} = { 0G_QVVGRM,#} / LV_PERIODS.</b>
    { 0G_QVVGRM,#} = { 0G_QVVGRM,#} - { 0G_QVVGRM, LV_FISCPER3}.
    IF { 0G_QVVGRM, #} < 0.01.
    EXIT.
    ENDIF.
    LV_COUNTER = LV_COUNTER + 1.
    ENDDO.
    ERROR: conflict between operation type F and 0FISCPER3

  • Problem in Report Formula Column

    I recently Transfer my databse 9i to 10g and iam using developer 2.1 release 5 as a front hand.
    so problem is that my reports run successfully with oracle 9i but when i change my database to oracle 10g iam facing error in reports formula column. when i use select statement in formula column. i gave u an example about that.
    function CF_1Formula return Number is
         lc_count NUMBER;
    begin
         SELECT      count(*)
         INTO     lc_count
         FROM     tab;
         RETURN (NVL(lc_count,0));
    end;
    when i compile formula column i got this error.
    ORA-00600 internal error , argument:[17069], [19156148],[],[],[],[],[],[]
    please help me in this matter.
    Thanks.
    M.Sohail Tai

    hi fs,
    Thanks for reply me my friend.
    i also use the column name but same error is appeared when i compile formula column . this is only the example i gave to u. now i give u actual code.
    function CF_Close_Rate1Formula return Number is
    lc_rate number;
    begin
    select CL_RATES_CLOSE
    into lc_rate
    from sys_cl_rates
    where cp_id = :v_cp_id
    and loc_id = :v_loc_id
    and trade_type_id = :trade_type_id
    and cp_list_id = :cp_list_id
    and CL_RATES_DATE = (select max(cl_rates_date)
                   from sys_cl_rates
                   where cp_id = :V_CP_ID
                   and loc_id = :V_LOC_ID
                   and trade_type_id = :trade_type_id
                   and cp_list_id = :cp_list_id);
                   --= :lc_closing_date;
    return (nvl(lc_rate,0));
    EXCEPTION WHEN NO_DATA_FOUND THEN
    RETURN(0);
    end;
    This work properly with 9i database but not with 10g database.
    Reply me soon .
    Thanks,
    M.Sohail Tai

  • Problem with member formulas and allocation

    Hi guys,
    I am experiencing a problem I am not currently able to solve. I'm building a planning application in which
    volumes can be inputed in different units of measure (5 are currently available). For example a user can input in liter or KG, and the
    system converts this data in all the different units of measure available, executing a script logic after
    the input (for every bas member is also stored a conversion factor, which is used  by the logic for conversion).
    Two are the major issues of this approach:
    1) storing 5 different volumes for every SKU is consuming in term of disk and DB space;
    2) script logic must be executed every time the user sends data and in some cases this could be time-consuming.
    The solution I'm trying is to use member formulas in order to calculate different units of measure, storing
    only one of these. However, this way lead to another problem: when I try to input data with a top-down approach, using BPC
    ALLOCATION ENGINE, I cannot use the correct unit of measure as a driver for the spread.
    For example, if I input volumes is KG, and the unit of measure stored is only liter, I cannot use nor KG as a driver (because is not stored,
    but only a member formula) neither liter, because the spread using this driver would lead to a wrong result.
    What I would like to do is to give the user the possibility to input in the desired unit of measure at an aggregated level and spread data
    using the existing mix, which must be volumes with the same unit of measure used for input.
    Does anyone has an idea that could help me?
    Regards
    Edited by: utenza pubblica Public on Oct 23, 2009 4:48 AM

    hi
    i found a solution for the Problem in another Forum
    http://businessintelligence.ittoolbox.com/groups/technical-functional/hyperion-admin-l/dynamic-calc-formulas-not-refreshed-1719379?cv=expanded
    The suggestion is
    1. change the Member from Dynamic Calc to Store
    2. Refresh (After these Step the Formulas where still out of sync)
    3. change the Member from Store to Dynamic Calc
    4. Refresh
    After these Steps the Formulas are in sync again.
    Kevin Kraft
    Edited by: Kevin Kraft on Mar 25, 2009 12:33 PM

  • Problem with the Formula variable

    Dear All,
    There is a need to convert INR values to USD values. Since my source table in r/3 is not having currency value stored i cant use currency translation type to achieve the same.
    So i am using formula variable to determine the Exchange rate.
    I have created the CKF with the following calculation = INR values / 'ZEXC_RT'.
    Here zexc_rt is a formula variable which is a customer exit and of type Number.
    Now in cmod i am writing a code to determine the value for this formula variable. But the problem is with data type of formula variable and tcurr table UKURS (Exchange rate) field. I have defined formula variable as Number and my UKURS field is of decimal data type because of which the currency conversion is not taking place.
    Here is my code below . Kindly suggest how can i achieve this.
    My logic is :- Whenever the user runs the report take the system date and determine the previous month. Then go to tcurr table and get the exchange rate which matches with the previous month date.
    WHEN 'ZEXC_RT'.
    *   IF I_STEP=2.
        CLEAR L_S_RANGE.
        DATA:  v_date(10).
        DATA:  v_rate type C.
        DATA: z_date(8).
        concatenate sy-datum+0(4) sy-datum+4(2) '01' into v_Date.
        v_date = v_date - 1.
        concatenate v_date+0(4) v_date+4(2) '01' into v_date.
    select SINGLE UKURS into v_rate from tcurr where GDATU = V_date
    and KURST ='M'.
        l_s_range-low = v_rate.
        l_s_range-opt = 'EQ'.
        l_s_range-sign = 'I'.
        APPEND l_s_range TO e_t_range.

    Hi Anup,
    I am not able to get the exact problem.
    CKF is not working means it is giving the INR Values or it is giving some random value.
    Please check your code first by writing a text program in se38 if you are able to read the value correctly from TCURR.
    Domain UKURS has a conversion routine EXCRT. You may require to use it to get the correct value.
    Once you get the right value in the program, you can use the same logic in your formula variable and you should get the correct values.
    Let me know if it helps.
    Regards,
    Gaurav

  • Problem building a formula

    I am building a complex formula and the tools don't seem to allow what I need to do.
    My code is
    [Code]
    Local StringVar vTest1 := Trim ({PURCHORDER.L_INDEX});
    if length(vTest1) >= 1 then
      Local StringVar docType := {L_HPCR.OBJECT}[6 To 6];
      Local StringVar Comment1 := {L_HPCR.OBJECT}[95 To 256];
      If docType In ["P", "p"]
      and ({PURCHORDER.L_INDEX} = {L_HPCR.L_INDEX})Then
        Comment1
      Else
        "no type P comment"
    else
      "no comment"
    [/Code]
    The problem is that there are docTypes of D and P. The returned value is D - then next record is P.
    I really would like to loop through 5 records while the L_INDEX values are equal.
    Does anybody have an idea how to do this???
    Edited by: jcarrott on Jan 18, 2010 10:25 PM
    The PO comments are of several types, The first part of the L_HPCR.OBJECT field is 'TYPE=' . This comment has 2 types a D and a P. The L_INDEX is the same for both. The code above only finds the the first comment (type=D), so the message that prints on the PO is "no type P comment" when in fact there is one. I really want the record where docType is = to P and the indexes are equal. I can't seem to get that condition to work.

    1.  Using Group Expert, add a group on the index field.  Then you will have formats for Group 1 Header, Details, and Group 1 Footer (assuming this is the only group, which, if you don't know what groups are, is probably the case :->).
    2.  Create a formula field like the one below (in #4).  Place it on the Detail format.  Make sure the formula has WhilePrintingRecords at the top.  This will need to use a shared variable (which I'll call CommentText), described more fully below.
    3.  Since the new group is only so you can look at all of the records for a group prior to printing the comments, create another formula field to get the CommentText shared variable (basic syntax):
    WhilePrintingRecords
    shared CommentText as string
    formula = CommentText
    CommentText = ""   ' reset the value of the comment for next index.
    Place this in the group footer where you want to print the comments.
    4.  A shared variable will keep its value between reading records, so your formula will need to look something like (basic syntax):
    WhilePrintingRecords
    shared CommentText as string
    dim docType as string
    dim comment1 as string
    if length(Trim ({PURCHORDER.L_INDEX})) >= 1 then
      docType = {L_HPCR.OBJECT}[6 To 6]
      comment1 = {L_HPCR.OBJECT}[95 To 256]
      If docType In [\"P\", \"p\"]
         and ({PURCHORDER.L_INDEX} = {L_HPCR.L_INDEX})Then
          CommentText = CommentText + Comment1  ' concatenate all comments if more than 1 P rec
      end if
    end if
    formula = ""
    HTH,
    Carl

  • Block creation problem in member formula

    Hi,
    I have a member formula as below :
    IF(.....)
    x = a/b;
    ENDIF
    where a,b have their own member formulas.
    There is no issue with the calculations of x,a or b, but I am facing an issue with block creation of x.
    Is there a way to handle block creation through member formulas? I know the way out through calc scripts, but i am trying to limit the use of calc scripts.
    Thanks!
    Note:The storage property of all three members is store. Also, a and b lie in the same intersection (same block), and x lies in another intersection.

    In the following section of the dbag: http://docs.oracle.com/cd/E12825_01/epm.111/esb_dbag/frameset.htm?dcaoptcs.htm...
    Under the sub-section: In Equations in a Dense Dimension...
    It states as follows:
    In Equations in a Dense Dimension
    When you use a cross-dimensional operator in an equation in a dense dimension, Essbase does not automatically create the required blocks if both of these conditions apply:
    Resultant values are from a dense dimension.
    The operand or operands are from a sparse dimension.
    You can use the following techniques to create the blocks and avoid the performance issue.
    Ensure that the results members are from a sparse dimension, not from a dense dimension. In this example, the results member Budget is from a sparse dimension:
    FIX(Sales)
    Budget = Actual * 1.1;
    ENDFIX
    FIX(Expenses)
    Budget = Actual * .95;
    ENDFIX
    Use the DATACOPY calculation command to create and then calculate the required blocks. See Using DATACOPY to Copy Existing Blocks.
    Use a member formula that contains the dense member equations:
    FIX(Sales, Expenses)
    Budget (Sales = Sales -> Actual 1.1;*
    Expenses = Expenses -> Actual .95;)*
    ENDFIX
    The phrasing of that last part would lead me to believe that block creation via a member formula is possible. Though I'm not sure of the member to which that formula should be applied. Furthermore, the code looks funky in that we're fixing on Sales and fixing on Expenses, and them on the left side of the equation within the fix.
    Thoughts anyone?

  • Report painter- problem in creating formula variable- ps

    Hi Experts,
      i have copied report  6P3 - 6PP1-001 Act/Com/Total/Plan    from library in report painter.
    our requirement is we want two user fields from cj20n  in this report. they are prps-usr04
    and prps-usr05.
    i have added these in header as  special text variable as they were ALREADY available at header under
    MASTER DATA FOR PROJECTS / WBS ELEMENT IN REPORT-WRITER. 
    now my requirement is to add new columns. for that i required these two fields in formula.
    but as they are not present in formula component  i am not able to get it.
    what should i do to enter these fields in component list in formula?
    PLEASE GUIDE ME?
    AMOL

    ActRunningBal is a running total calculated in crystal or database field? If it is a database field then you can try this
    if {command.CR-Amount} &lt;&gt;0 then
    {command.CR-Amount}
    else
    previuous()+previous({command.Dr-Amount})
    If it is a running total you cannot apply previous function on it.
    Regards,
    Raghavendra

  • Problem with a Formula in ABAP

    hello,
    im new in ABAP.
    I have to implement a formula.
    ((Variable ==0) OR (Variable ==1)) 100 + ((Variable >=2) AND (Variable <=4))95
    This Formula is used normally in a query. but i need it in my StartRoutine as ABAP Code.
    hope anyone can help
    regards sunny

    >
    sunnyfriday wrote:
    > hello,
    > im new in ABAP.
    >
    > I have to implement a formula.
    >
    > ((Variable ==0) OR (Variable ==1)) 100 + ((Variable >=2) AND (Variable <=4))95
    >
    > This Formula is used normally in a query. but i need it in my StartRoutine as ABAP Code.
    >
    > hope anyone can help
    >
    > regards sunny
    Possibly...
    IF variable EQ 0 OR variable EQ 1
      variable = 100.
    ENDIF.
    IF variable GE 2 AND variable LE 4.
      variable = variable + 95.
    ENDIF.
    Where does this formula come from?  Without knowing it's difficult to answer you directly.

  • Problem with custom formula

    Hi Experts,
    We have a requirement in which we have to show the fact data of the cube to be annualized for time dimension i.e. if users check at year level the value should be multiplied by 1,for quarter level the value should be multiplied by 3 and for month level it should be multiplied by 12.
    I wrote a formula like this and it compiled successfully.
    IF(FINANCIALPERIOD_LEVELREL EQ 'CALENDAR_MONTH') THEN this_aw!measure * 12 -
    ELSE IF (FINANCIALPERIOD_LEVELREL EQ 'CALENDAR_QUARTER') then this_aw!measure * 4 -
    ELSE this_aw!TEST_CUBE_SALSA_MEAS * 1
    When I run rpr on this formula I get following error.
    ORA-34612: Your program or expression uses too much execution space. Eliminate recursion or reduce the levels of nesting.
    I treid limiting it to if else only but same error. Any resolution to this?
    On the side note when I write the above expressions in a program and tries to compile it gives me structural errors?
    Thanks
    Brijesh

    What is the definition of the "TEST_CUBE_SALSA_MEAS" measure
    i.e can you supply the full output of the command below
    fulldsc  TEST_CUBE_SALSA_MEAS*
    Please also issue a fulldsc command on your formula so that we can have a look at its dimensionality and other parameters
    Edited by: YF on Jan 22, 2009 3:24 PM

  • Problem in Creating Formula

    Hi,
    I have two columns in the report query that comes from the database namely DR-Amountand CR-Amount. I am creating a third column in the report using a formula that says that if CR-Amount is not equal to 0 return that value else return previous value of formula + dramt but it gives me error saying "A formula cannot refer to itself either directly or indirectly"
    Below is what I want :
    if {command.CR-Amount}<>0 then
        {command.CR-Amount}
    else
    previous({@ActRunningBal})+({command.Dr-Amount})
    How Can I achieve this?
    Thanks in advance
    Reena

    ActRunningBal is a running total calculated in crystal or database field? If it is a database field then you can try this
    if {command.CR-Amount} &lt;&gt;0 then
    {command.CR-Amount}
    else
    previuous()+previous({command.Dr-Amount})
    If it is a running total you cannot apply previous function on it.
    Regards,
    Raghavendra

  • Problem with "/" in formula

    Hi
    I use CR XI R2
    I would like to write something like this in my formula
    - string field from database
    "/" -  like a normal text string, not like a division,

    Hi..
    Also you can use :
    If you want to show entire as string then " / "
    Thanks,
    Sastry

  • Problem in % display (formula)

    Hello,
    I have a simple report with one key figure (e.g. Sales in EUR).
    Now I want to create a formula which shows the % sales from result.
    Example:
                               Sales in EUR       Sales in %
    Customer A         30.000                30%
    Customer B         20.000                20%
    Customer C         50.000                50%
    Result               100.000
    I tried with formula %CT, %GT and %RT.
    The result is always wrong.
    How to solve this issue?

    HI,
    you have to use %GT when you want to get the % share of individual values over the over all result.
    Percentage Share of Overall Result (%GT)
    ●      %GT <Operand>
    in your case %GT sales, this should give the correct results. Check once again how you are using this formula.
    This shows how high the percentage share is with regard to the overall result. The overall result is the outcome of aggregating the highest results level. Dynamic filters (filters that were not specified in the Query Designer) also play a role in calculating the overall result
    please go through this for more information
    http://help.sap.com/saphelp_nw2004s/helpdata/en/e2/16f13a2f160f28e10000000a114084/frameset.htm
    Regards,
    rik

Maybe you are looking for