IF Condition in formulas

Hi All,
I have a quest.
I have a calculated KF which I will use to hold 1 or 0.
the value should be 1 when
IF KF1 = KF2
Calc KF = 1.
else
Calc KF = 0.
I do not find IF condition in the formula editing. Can you help.
Cheers
Kiran

Hi Kiran,
The IF formula will be like this.
((KF1==KF2) * 1)+ ((KF1<.>KF2) * 0)
The above is like...
IF KF1=KF2 THEN 1 ELSE KF1 NOTEQUAL KF2 THEN 0
Hope this helps.
Veerendra.

Similar Messages

  • Storing a conditional formatting formula in a variable

    I have a conditional formatting formula that exceeds the 393 character limit for Word fields. I've placed the formula directly into the template table, and it works correctly. But now, of course, there are several hundred characters of formatting information in that cell, along with the data field. Not pretty.
    Is there a way to store that long formula into a variable, and then refer to that variable as the conditional format? I'm getting stuck on the right-arrow tags (>). I can't figure out how to include those in the string and store them in the variable.
    Here's a simplified example of what I'm trying to do:
    <?xdoxslt:set_variable($_XDOCTX,'myvar',"<?if:number(Sales) gt 1000000?><?attribute@incontext:color;'red'?><?end if?>")?>
    The inclusion of the right-arrow tags (>) in the string causes a failure when attempting to Preview. If I replace all of the right-arrow tags with something else, like the number 8 ...
    <?xdoxslt:set_variable($_XDOCTX,'myvar',"<?if:number(Sales) gt 1000000?8<?attribute@incontext:color;'red'?8<?end if?8")?>
    ... the string is stored in the variable, and I can refer to it in the template table by using <?xdoxslt:get_variable($_XDOCTX,'myvar')?>. It's useless, of course, but it works correctly. The string is stored in the variable, and the contents of the variable appear in the template.
    So how can I imbed the right-arrow tags in this text string? Use an escape character? Imbed the ASCII code? I'd do either of those in a heartbeat if I could figure out the right syntax.

    Related information is available at:
    Where to put xsl:variable definition

  • Error while processing conditional formatting formula in crosstab

    This conditional formatting formula must return one of the following Color Constants: ' A number, currency amount, boolean, date, time, date-time, or string is expected here. Details: errorKind
    The above error is displayed on the the Business Objects Report Server when running my report.
    The XI server version information is as follows:
    BusinessObjects Enterprise XI Release 2
    Business Objects
    11.5.0.3135
    20060628
    Crystal Reports XI Release 2
    Business Objects
    11.5.0.31327
    20060628
    My IDE is Crystal Reports 2008.
    The error is being generated for the following conditional formatting formula which is in my crosstab:
    evaluateafter ({@concatAppTypeAppMethod});
    if CurrentRowIndex = 1 then
        color(0,153,153)   
    else if CurrentRowIndex = 2 then
        color(168,146,101)
    else if CurrentRowIndex = 3  then
        color(0,51,153)
    else if CurrentRowIndex = 4  then
        color(204,51,51)
    else
        color(153,153,153)
    This formula is applied via the Crosstab "Format Field>Font" tab.  In the report developer (Crystal 2008) the report runs without error.  When deployed to the server it fails with the above error.
    Heres the details of {@concatAppTypeAppMethod}:
    whileprintingrecords;
    "Designs filed " + {Command.APPLICATION_METHOD}
    The crosstab is structured as:
    Row = {@concatAppTypeAppMethod}
    Column = {@getMonth}
    Summary = Count of {@concatAppTypeAppMethod}
    Details for  {@getMonth}:
    right(totext(year({Command.ACN_COMPLETED_DATE}),"#"),2) + totext(month({Command.ACN_COMPLETED_DATE}),"0#")
    The above functions Row i.e. {@concatAppTypeAppMethod} and {@getMonth} use fields from the SQL command. 
    {@getMonth} parses the ACN_COMPLETED_DATE field, obtains the record month and year and concatenates these as a string which can be displayed as follows in the crosstab:
    May-08, Jun-08 etc.
    {@concatAppTypeAppMethod} parses the APPLICATION_METHOD field and obtains the application filing method i.e. Online or Internally and concatenates the pretext "Designs filed " to the filing method (also a string).
    I have tried various combinations of whilereadingrecords, whileprintingrecords and evaluateafter() with no success.  The problem occurs because the conditional formatting formula is being executed before the records being formatted are ready. 
    I believe this is a problem with the crystal reports software and/or XI server. 
    Please prove me wrong.

    Hi Raghavendra,
    Thanks for your prompt answer!  Can you confirm?  Is it because I'm using calculated members in the report and these are not support by the XI server specified in my error report above?
    If so, do you have any suggestions with regard to how I might be able to create a graph with the following attributes:
    Show summary (count) of records per month per application method (i.e. online or internal. this is a database field retruned by the SQL command).  In addition I need to add a series to the graph that shows the totals number of records per month irrespective of the relative application method (i.e. sum of online and internal) and finally I need to show the total number of online applications (i.e. application method = online) as a percentage of the total number of applications for the month.

  • The Condition value formula is not found in CRM ???

    Hello Al
    l
    We are working on CRM 7.0 , I canu2019t find the Condition Value Formula, Condition Base Formula and Condition u201Crequirementsu201D in the pricing procedures downloaded from the ECC also in the pricing procedures that are standard in the CRM
    I donu2019t know what is the reason for that
    Regards
    Jacopo Françoise

    the IPC should work to make them available

  • SD PRICING: How to identify the last call of a Condition Value Formula

    Hello  Experts.
    I'm working on a condition value formula, and because a Group Condition, I need to do a calculation in the last call of the formula. The formula is called 5 times and I couldn't identify any flag to diferentiate the last 3 calls.
    I could use a counter in a static variable per position, but I think there must be another way to identify the last call.
    Thanks in advance and best regards
    Matías

    Hi,
    Define a counter say w_ii type I in your routine.
    Whenever you enter the routine  use 'IMPORT' to get the last value of w_ii. If sy-subrc ne 0 its first time so increment the counter w_ii = w_ii + 1 & 'EXPORT' it. If sy-subrc = 0 check the value of w_ii to decide if it's the last time.If yes do whatever you want to do
    else increment w_ii i.e. w_ii = w_ii + 1 & 'EXPORT' it which in turn will be used during next 'IMPORT'.
    I hope this helps,
    Regards
    Raju chitale

  • IPC Condition value formula to Java

    Hi all,
             I need code the next abap statement for a condition value formula to java in overwriteConditionValue method:
                form FRM_KONDI_WERT_903.
      data: L_XKOMV like XKOMV occurs 0 with header line.
      data: L_KAWRT like XKOMV-KAWRT.
      data: L_KMEIN like XKOMV-KMEIN.
      L_XKOMV[] = XKOMV[].
      read table L_XKOMV with key KOAID = 'B'
                                  KHERK = 'A'
                                  KSTEU = 'A'.
                                 KINAK = 'Y'.
      L_KAWRT = L_XKOMV-KAWRT.
      L_KMEIN = L_XKOMV-KMEIN.
      if L_KAWRT ne 0.
        XKOMV-KBETR = KOMP-NETWR .
        XKOMV-KBETR = XKOMV-KBETR * 1000 / L_KAWRT.
        xkwert = XKOMV-KBETR * L_KAWRT / 1000.
       xkwert = xkwert / 10000.
      endif.
      XKOMV-KMEIN =  L_KMEIN.
      XKOMV-KAWRT =  L_KAWRT.
          But i don't know how translate "read table L_XKOMV with key KOAID = 'B'" to Java.
          Help me please!!

    Hi David,
    Here are some of the steps that may be of some help.
    1. Define the query pair (parameter and value)
    2. Set up the projection of the query result
    3. Call the db engine for the db instance
    4. Run the query and request the result set
    5. Confirm the results
    The sample here comes from the examples found in your IPC install directory:
    /ipc/doc/spe/UserExitsExamples.html#ex1
    The example uses the <u>addAttributeBindings</u> method of the <b>ItemsUserExit</b> to perform the following steps and then calls the <u>determineRelevantAttributesforValueFormula</u> of the <b>PricingUserExit</b> to collect these attributes.  Once available the <u>overwriteConditionValue</u> method is called.
    Here is what I believe you'll need:
    Make sure your user exit is importing the following class reference:
    package userexits;
    import com.sap.sxe.db.*;
    Code:
    // Declare the query pair array
       sys_query_pair[] queryPair = new sys_query_pair[3];
    // Declare the projection to filter the result set
       String[] projection1;
    //  Define the query pairs
        queryPair1[0] = new sys_query_pair("KOAID", "B");
        queryPair1[1] = new sys_query_pair("KOHERK", "A");
        queryPair1[2] = new sys_query_pair("KSTEU", "A");
    //  Define the fields we want to read from table as the projection
        projection1 = new String[]{"KAWRT,KMEIN"};
    //  This is the database access to table
        db _database = _engineUserExit.getDatabase();
        res resultSet = _database.db_read_table("XKOMV",
                                                        queryPair1,
                                                        projection1)
    //  Check whether database access was successful
        if (!res.db_empty_results_p(resultSet)) {
    //  If successful then assign field values
           l_kawrt = resultSet.db_get_row_element_string(0);
           l_mein  = resultSet.db_get_row_element_string(1);
        else {
           log_api.log_write_msg("SPE",
                                            "ItemUserExits",
                                             1,
                                            "Table Query of XKOMV Failed");
           return;

  • Conditions in formulas no longer work after upgrade?

    I had a spreedsheet with formulas using count.if before upgrading to Numbers 3.0 working nicely. But after the upgrade the condition return true no matter what I write. I am comparing numbers, with conditions like: "<30" from a column containing numbers, that is the result of another formular. This is true for both my Mac version and the iOS version. I am using iWork Numbers in the danish language.
    Any ideas?

    If you want to go through all the steps I took:
    1. Restart
    2. Soft reset (hold home and power until Apple logo appears)
    3. Reset keyboard dictionary
    4. Reset all settings
    5. Clear autofill
    Only after the last step did things start working.  Prior to that I couldn't make any changes I made to the keyboard shortcuts stick, though every now and then changes would take.  Sometimes trying to delete a shortcut would crash the settings app.  In all cases the shortcuts didn't work.

  • SAP REFX – Usage of (RECN - Condition Tab ) Formula : E1 – Percentage Share in a condition.

    Dear Experts,
    I would like have a clarification on the usage of Formula: E1 – (Percentage Share in a condition) for a contract type in Refx  - contract ( In conditions Tab ).
    Lets take the scenario as below for example :
    Whenever I am adding a condition    ZREN - Basic Rent : XXXXXX  Rs/ month.
    System has to pick a second condition ( Over head charges ) as default and it should be calculated 20% of the amount as overheads on BASIC RENT amount.
    This 20% should come as default ( Because user cant change this % for anything while creation of contract).
    So I have adopted the config changes as below.
    SPRO - Flexible Real Estate Management (RE-FX) -- Conditions and Flows -- Default Conditions -- Define Default Conditions – selected my condition group – added new entries- assigned a new condition type as my over heads –
    Unit price as – 20 %
    Formula: E1
    Formula Parameter: selected - BASIC RENT condition ( ZREN )
    Is there any other config to be done ( Like adding the Derivation rules - if need Pls Clarify) to fulfill my requirement, B cas after  doing above config my overhead charges condition is not flowing by default, even after manual insertion of Over head charges condition its not taking 20 % as default.( Its asking to enter manually).
    Kindly advise to get the same.
    Regards,
    Subbarao.Narne

    Hi Mr. Narnei,
    If both the conditions are added manually, the condition with E1 as the calculation formula, say ZE1- Perc Share can automatically pick up the value from ZREN - Basic Rent and do the calculation.
    For this you just need to specify the condition in the parameter field in the path: Flexible Real Estate Management (RE-FX) -> Conditions and Flows -> Condition Types and Condition Groups -> Define Condition Types. Also specified in the pictorial below.
    For populating default conditions at contract creation based of different parameters, you would need to implement the badi BADI_RECN_CONTRACT. You can also add additional validation such as, if ZREN - Basic Rent is added to the contract it is mandatory to add ZE1.
    Hope this helps.
    Best Regards,
    Hardik Sharma

  • Pricing: header condition with condition value formula

    Hi,
    can anyone helps us on the following topic:
    - is it possible to enter a conditon value formula for a header condition?
    We have created a formula, but it is only executed when we enter the condition on item level.
    Our condition settings are:
    Cond. class - A
    Calculat. type - G
    Group condition - X
    Header condition - X
    Item Condition - X
    thanks in advance!

    Hello,
    we have a breakpoint at the beginning of the formula.
    If we enter the condition at item level we reach the breakpoint otherwise (when entering on header level) not.
    The question now is, if this is due to configuration settings on condition type or within calculation procedure - or if it is just impossible to have a conditon value formula for a header condition.
    thanks

  • Condition Type Formula--G

    Hello All,
    What is the calculation type Formula used for? how is it used?
    plz explain with some examples?
    Thanks,
    Viren.

    Dear Viren,
    The fallowing scenerios you need to use Alternative calculation type.
    When the condition type need to calculate the value other than the standard procedure you need to maintain Alternative calculation type.
    Example :-1
    VAT Rounding
    Use
    When you present a customer in Slovakia with an invoice in a foreign currency, the system rounds down the koruna VAT amounts, but not in the foreign currency. When you carry out pricing in Sales and Distribution (SD), SAP R/3 automatically does this for you.
    Activities
    Customizing
    For each of the VAT condition types used in the pricing procedure, set the rounding rule to rounding down. You do so in Customizing for SD, by choosing Basic Functions --> Pricing --> Pricing Control --> Define Condition Types --> Maintain Condition Types. In the Rounding Rule field, enter B (Round Down).
    In the pricing procedure itself, assign a rounding rule to each VAT condition type. You do so in Customizing for SD, by choosing Basic Functions --> Pricing --> Pricing Control --> Define and Assign Pricing Procedures --> Maintain Pricing Procedures. In the VAT condition types, enter 174 in the AltCTy (Condition Formula for Alternative Calculation Type) field. This rounding rule instructs the system to round these amounts as described above.
    Example 2 :-
    Other Taxes
    Definition
    In certain exceptional circumstances it may be necessary to record alternatives to the standard calculation of taxes for an employee.
    The Other taxes (Infotype 0235) record may be used for any tax authority.
    Tax types
    All tax types except withholding tax are displayed and may be adjusted for the particular authority. You may either alter the calculation of the tax by changing the formula used, or exempt an employee entirely from a tax.
    Any change you make here will override the standard calculation of the tax.
    I hope it will help you,
    Regards,
    Murali.

  • Tax procedure condition based / formula based

    Hi,
    I have a query.
    1.Based on tax procedure how we can identify that the tax procedure is formula based or condition based.
    2.what are advantages over one another.
    3.Is their any other way we can find out tax procedure attached to po is formula based / condition based.
    4.What is sequence  to create procedure and maintain record for these two procedure.
    Thanks & Regards
    Atharva G.

    Hi Atharva,
    I will list out the differences and advamtages between the two
    TAX INJ procedure is formula based
    TAX INN procedure is condition based    
    In TAX INJ to define the tax rates we are using excise tax rate in J1ID AND tax code ( FTXP)
    In TAXINN nothing we are entering in tax code also , we are entering every duties in FV11( condition records)
    Amending the duty rates is very easy in case of TAXINN than TAXINJ since we are mentioning the tax duties in FV11 through validity periods, if the tax rate is changed from that date we can maintain the record for the new period in FV11
    IN TAXINN assign taxcode to company code is manadatory but its not manadatory in case of TAXINJ     
    Kindly get back to me, if you have any more clarifications.
    Balakrishna R.V
    Sonata Software Pvt Ltd.

  • If condition in Formula variable

    Hi forum,
    Can anybody please help me write the formula below in formula variable.
    *If A >=0
    then
    result = (A/B100365)
    Else
    result = (A/B100365-1)
    Thanks in advance for the efforts.
    Regards,

    (A>=0)(A/B100365)+(A/B100365-1)
    do a formula check.
    Khaja

  • Delivery block on Sales order using Condition Value Formula routine?

    Hi ABAP Experts,
    I want to place delivery block (LIFSK/LIFSP) on sales from Condition Value Forumla routine 09.
    I have a structure komp and xkomv.
    I don't think the field exist in either of the structures.
    How can possibly place block on the Sales if there is wide difference in both the prices.
    I know the standard SAP changes the status of sales order to incomplete and we have to do V.25 in order to process.
    But need specific delivery block 'ZZ' to identify it.
    Can you explain this??
    Thanks,
    Matt

    Helllo O ,
    i think u can enhance those structures ....for more info...check documentation in SPRO.
    regards
    Prabhu

  • Distinct records with conditional select formula

    Post Author: nelsonchris
    CA Forum: Data Connectivity and SQL
    Hello,
    I have a simple report pulling data from two tables. I want
    only distinct records. I am selecting records based on
    parameters; here is the select formula:
    ({?Service Name} = "*" or {selsvc.ServiceName} like
    {?Service Name})and
    ({?Program Name} = "*" or {selsvc.Selected Service Entry 
    Program Name} like {?Program Name}) and
    ({?Agency Name}  = "*" or {selsvc.Selected Service Entry 
    Agency Name} like {?Agency Name})
    The problem comes from the fact that Crystal will add the
    selsvc fields to the reports SQL select code, which has the
    effect of duplicating some records that do not have the same
    values for the selsvc fields. The select formula above is
    the only place in the report where values from the selsvc
    field are used, and as you can see they are only used when
    the user has submitted a matching parameter for them. I can
    not figure out how to get rid of the duplicates, please
    help!
    Thanks for your time,
    Chris

    Post Author: yangster
    CA Forum: Data Connectivity and SQL
    I don't follow why you are getting duplicates with your selectionare you getting duplicates without the selection criteria?if you are then they really are not duplicates and there could be issues with your joins between the 2 tables

  • Accessing Variant config characterisctics during CONDITION BASE formula

    Hi,
    I would like to access the characteristics values for a variant config during the SD pricing in the order. Since I don't have the batch at that point, how to I read from the variant itself? The document may not even be saved at that point yet.
    Any ideas?
    Thanks
    Leonardo

    Hi Leonardo,
    You can use reference characteristic to read data from the database table. To do pricing per the values of characteristic you can write object dependencies to set values in pricing. Note 935885 has information reference characteristics you can use. Please review help,sap.com for more information on how these can be set. If you give me an exact example for your requirement , I can guide you with the steps you can use.
    Thanks Amber

Maybe you are looking for