LOGIC FUNCTION (BOOLEAN)

Dear Gurus,
I have to make a logic function for a Key Figure H (KFH)  in query designer as follows:
KFH = IF (KFA<KFB ; KFA-KFC ; KFB-KFD-KFC)
Does anybody know how can I solve it?
Many thanks in advance!

Hi,
Please verify that B-D-C is not zero.
the way it works is,
if A < B, 'KFA-KFC' will have a value of A-C & 'KFB-KFD-KFC' will have 0.
if A>=B, 'KFA-KFC' will have a value of 0 & 'KFB-KFD-KFC' will have a value of B-D-C.
Are you mentioning that in above 2 cases, 1st case works & 2nd case doesn't work?
if so, Please verify that A>=B is meeting the criteria & also B-D-C has a value of non zero.
Hope it helps,
Hari Immadi
http://immadi.com
SEM BW Analyst

Similar Messages

  • Logical function optimization taking SSE2 into consideration

    I need to optimize an extensive and time-critical bitwise logical function, so I want to represent it with minimum logical operations. SSE2 includes four bitwise logical instructions: AND, OR, XOR, AND NOT. If I connect wire A (UINT64) to the first input of an LV AND function, wire B (UINT64) to the input of an LV NOT function, and wire from the output of the LV NOT function to the second input of the LV AND function, how many SSE2 instructions will be used?
    A and (not B) = A and not B -- at least one instruction
    or
    A and (not B) = A and (1 and not B) -- at least two instructions
    What would be better to represent the function with: {AND, OR, XOR, NOT} or {AND, OR, XOR, AND NOT}, where AND NOT is built by means of two LV functions?

    altenbach wrote:
    gmiroshnichenko wrote:
    Yes, I get 18 UINT64 arrays on the input and return 2 UINT64 arrays.
    18 arrays (what size?) or an array with 18 U64 elements? Where is the reduction from 18 to 2 taking place? Where is the data coming from?
    For me it is hard to imagine that a few bitwise operations are the bottleneck in the overall operation. Most likely, their speed is insignificant compared to everything else. Good overall code desing is probably more important (inplaceness, avoiding data copies, etc.).
    In LabVIEW, there can be a significant difference between how you wire the primitives on the block diagram, and the compiled LabVIEW code. The LabVIEW compiler is quite sophisticated and your code alternative might even result in the same code under the hood.
    As I said, benchmarking is probably the only way to really tell. Also don't forget parallelization. Is this on a desktop or LabVIEW RT.
    There is the cyclic process:
    1) 2 arrays with 40 U64 elements are expanded to 18 similar arrays with "Rotate 1D Array", logical shifts, and applying bitmasks.
    2) The 18 arrays are reduced to the 2 arrays with bitwise logical operations.
    3) New arrays are assessed.
    The purpose of it is the enumeration of possibilities in the game for two players, and the program is an AI. (It is a contest of AIs. The game is a modification of "game of life".) Each cycle allows to model a change of the game board. The time for thinking is very short, and the goal is to test as many variants as possible.
    Thank you, I will try several ways of wiring. This is a desktop, and it will be possible to use parallelization in for loops.

  • How to trigger two Actions at a time in a break function(Boolean)

    Hi All
    I am using three sequential Blocks.First Block is to enter the data and send to second Block. When second sequential Block accepts it should sent to third Block. If Second Block rejects the form then I want to stop (Terminate) the process and I want to send the notification.
    I am using Pre-conditional block and checking check box in the second block to accept or reject the initial form. If I use Boolean function it automatically declare two functions one is Continue and another is Break. If I select break then I am not able to send any notification or any callable object as this break function will break the process at instant and it won’t allow any further actions.
    Thanks & Regards,
    Syed Nawaz.S

    I think you just need to use 2 sequential blocks. Seq Block 1 will contain your data input form. Seq Block 2 will contain 5 actions - 1st action is a Decision Dialog (that will have Continue and Break), 2nd Action is whatever needs to be done on Continue, 3rd Action is Terminate, 4th Action is Send Notification and 5th Action is Terminate. Set the target for Continue to Action #2 and target for Break is Action #4. Once 2 is executed it will execute Action #3 and the process will terminate. If the Break situation is executed, a notification will be sent and the process will terminate.
    Thanx,
    Mahesh

  • How to create new logical function codes for Subtype

    Hi all
      I'm developing an WF that must be started when the user makes any change in a employee position. The problem is that this change can be made by many transactions, I know that it´s possible to do it by PA30/PA40, and today it´s made here using PP01. The Functional Consultant said to me that the better way to map all possible trasactions which made that kind of changes in an employee data is by adding new "Logical Funcion codes" (or Activities) for our specif subinfotypes.
      The table that contains such information is T77FLC. How can I add that new activities for a subinfotype, by a costumizing or just adding new entries in this table?
    Thanks in Advance

    Josie,
    You can configure your own workflow events based on HR objects/infotypes/subtypes/update type/activity type combinations using transaction SWEHR3.  Look at SWEHR2 for the standard events to get some idea of what you need to enter in SWEHR3.
    The relationship between the infotype and the matching business object type is held in SWEHR1.
    Regards,
    Jocelyn

  • How to create new logical function codes for Subinfotype

    Hi all
    I'm developing an WF that must be started when the user makes any change in a employee position. The problem is that this change can be made by many transactions, I know that it´s possible to do it by PA30/PA40, and today it´s made here using PP01. The Functional Consultant said to me that the better way to map all possible trasactions which made that kind of changes in an employee data is by adding new "Logical Funcion codes" (or Activities) for our specif subinfotypes.
    The table that contains such information is T77FLC. How can I add that new activities for a subinfotype, by a costumizing or just adding new entries in this table?
    Thanks in Advance

    Josie,
    You can configure your own workflow events based on HR objects/infotypes/subtypes/update type/activity type combinations using transaction SWEHR3.  Look at SWEHR2 for the standard events to get some idea of what you need to enter in SWEHR3.
    The relationship between the infotype and the matching business object type is held in SWEHR1.
    Regards,
    Jocelyn

  • Logical Functions In Forms?

    We have a basic Excel form that we are converting to PDF since our users don't have Excel on their PCs. Anyway, it is a very simple form where the user enters data into three fields and then two calculations are automatically performed using Divsion. But when we put it into PDF, it keeps telling us one of the calculated fields is in the wrong format when one of the entry fields is empty. The calculated fields are set as Percentage. This is the formula in Excel? Can we transcribe it over to PDF? =IF(R)=0,0,(W/R)
    Or is there a better way to have it ignore empty fields?
    Thank you

    Yes you can test for a logical true or logical false value and control the execution of the code. It is even possible to set an object's property that has a true of false value with the result of a logical comparison. This can be done with a document level function for the division that can be used within the entire form and custom JavaScript calculation for a field.
    // document level function for use in entire form
    function Divide(nDividend, nDivisor) {
    // divide nDividend by nDivisor and return result
    return nDivisor == 0? 0 : nDividend / nDivisor;
    } // end Divide function
    // end of document level function
    // custom calculation script for a field
    // values to process
    var W = this.getField("W").value;
    var R = this.getField("R").value;
    // perform division
    event.value = Divide(W, R);
    // end of custom calculation script

  • Logic function disable items

    what is the logic of the array of the function enable disable items on a Menu ring in LabView 5.1

    I'm not sure if you're asking why there should be disabled items or how to disable selected items. Why is because there may be situations where menu items don't apply and you don't want a user to select them. As to how, if you have a menu ring with items a,b,c, and d. If you want to disable b, this is element 1 in the array of elements and to disable it, you create an array with 1 as the only element and wire this to the property node DisabledItems (LV 6 and up. Not sure about name if 5.1). On the Front Panel, you can simply select the item you want to disable and then right click to enable or disable it.

  • Access to the logic functions on the numeric part of a Logickeyboard

    I have connected a logic keyboard (the one with the coloured shortcuts) to my Mac Book Pro. However, the numeric part (with stop, play, record, etc) is not working. Logic does not respond on the input through that numeric part. The main part of the keyboard works well, including the shortcuts to for example the bin, the mixer
    Does anyone has experience with this problem?
    I mean, there isn't a numlock key on the keyboard. So how do you get access to the functions on the numeric part?

    Q1: yes i have tested it in word and then numbers appears
    Q2: the key commands are the simple ones
    Like the enter is play, the 0 is stop, the 2 is mixer
    What i'm looking for is the key (like shift or fn) that changes the functions of the numpad

  • How do you use a logic function to see if text is there?

    I have a column of Dates, and a column of Categories. I want to Numbers to be able to tell me whether a certain Category, in this case "Phone", appears in the Category column during the month of February.
    While playing with the IF and AND functions, aside from Errors, the only results I've come up with are "FALSE", when it clearly is in the category. I have checked everything over and can't find any error on my own part, aside from not understanding clearly how these functions work. Can someone clarify what I need to do to get the desired results?
    Thank you so much!

    Vangard wrote:
    Also, is there a way to specify its "existence" to a date range? What I am trying to do is have a separate table show whether or not I have paid the phone bill each month. So without a date range, it will display that I've paid it on every month. (Assuming I can get it to display the proper status in the first place.)
    What you're looking for is a "breakout table"
    These require an index column on the main table that marks the target rows with an identifier (a serial number) that's used by the LOOKUP function to retrieve other information from the marked rows.
    For the example, I've placed Date, category and amount in columns A, B and C of the main table, and used column E as the index column.
    On the Breakout table, the Category is in A1, dates are listed under it, and amounts in column B.
    Formulas:
    Table 1
    E2 and filled down the column:   =IF(B=$E$1,MAX($E$1:E1)+1,"")
    Table 2
    A2 and filled down the column:   =IF(ROW()-1>MAX(Table 1 :: $E),"",LOOKUP(ROW()-1,Table 1 :: $E,Table 1 :: $A))
    B2 and filled down the column:   =IF(ROW()-1>MAX(Table 1 :: $E),"",LOOKUP(ROW()-1,Table 1 :: $E,Table 1 :: $C))
    The IF part is used to blank cells where LOOKUP would be looking for a number greater than the maximum value in the index column. Because LOOKUP cannot be set to look for exact matches only, it would repeat the last found entry if this part of the formula were omitted.
    Note that the values (text) in the category column, and cell E1 of Table 1 must match exactly for the row to be included in the breakout table. (This may also be the reason for the 'missing' message you are getting from Yvan's formula.) The easiest way to accomplish this is to enter the category labels using a pop-up menu, and to use the same menu in E1.
    Extension: For a single breakout table with a choice of extracting any one of the categories, place a copy of the pop-up menu in cell A1 of Table 2, and replace the value in E1 of table 1 with the formula   =Table 2::A1
    Regards,
    Barry
    Descriptions of ROW, MAX and LOOKUP may be found in the iWork Formulas and Functions User Guide, which may be downloaded through the Help menu in Numbers.

  • How do I combine logical functions so Numbers will complete the entire operation and not stop as soon as it returns false?

    I'm trying to use the following formula, in which column A references a drop-down menu, and $K$13 is one of three different options possible for column A. The formula works if all the drop-down selections are the same, but as soon as one cell doesn't equal $K$13, the operation stops and none of the following cells are checked. I want all the cells to be checked so the destination cell will display any text from column R where column A = $K$13.
    =IF(A4=$K$13,IF(J4,CONCATENATE(R4," | ",),"")&IF(A5=$K$13,IF(J5,CONCATENATE(R5," | ",),"")&IF(A6=$K$13,IF(J6,CONCATENATE(R6," | ",),"")&IF(A7=$K$13,IF(J7,CONCATENATE(R7," | ",),"")&IF(A8=$K$13,IF(J8,CONCATENATE(R8," | ",),"")&IF(A9=$K$13,IF(J9,CONCATENATE(R9," | ",),"")&IF(A10=$K$13,IF(J10,CONCATENATE(R10," | ",),""),""),""),""),""),""),""),"")
    Can anyone help me? Thanks!

    You've set it up as a series of nested IF statements, rather than a series of independent IF statements. Here's a diagram of a similar three part formula:
    IF(test1,"T1"&IF(test2,"T2"&IF(test3,"T3",false3),false2),false1)
    IF test1 is FALSE, control passes directly to false1 and the program exits the formula, returning (in your case) a null string.
    IF test 1 is TRUE, then "T1"  is passed on to the next IF..
    IF test2 is FALSE, control passes directly to false2 (which in your case appends a null string) and the program exits the formula, returning "T1"
    IF test 2 is TRUE, then "T2" is appended to "T1", making the value now "T1T2" and that is passed on to the next IF.
    etc.
    You need to rewrite your formula so that it consists of a set of independent IF statements, each returning the text from the corresponding cell in column R and the three character string " | " if its test is TRUE, or a null string ( "" ) if its test is FALSE.
    The individual formulas can be placed in a concatenation string in a single cell (as you've attempted), but that makes for difficult reading and editing.
    Each of the IF statements is identical except for the cells whose value is being checked (A4 and J4 in the first) and the cell from which the 'if-true' value will be retrieved (R4 in the first). Because of this, my own choice would be to write the formula a single time, fill it down a column into rows 4 to 10, then use a simple concatenation formula to string those results together into a single cell.
    =IF(A4=$K$13,IF(J4,CONCATENATE(R4," | "),""),"")
    Assuming R4 contains the text "ABC", the formula will return:
    a null string if A4 contains a different value from K13.
    a null string if A4 contains the same value as K13 but J4 is empty. contains the number zero, or contains the Boolean value FALSE
    an error triangle if A4 contains the same value as K13 but J4 contains a value that is text (or formatted as text), a Duration, or a Date and Time value.
    the text string "ABC | " if A4 contains the same value as K13 and J4 contains a number that is not zero, or contains the Boolean value TRUE.
    Because the individual formulas will reference cells in their own row, the row part of those cell references may be removed.
    =IF(A=$K$13,IF(J,CONCATENATE(R," | "),""),"")
    Place the formula into row 4 of an available column (I'll assume Z for purposes of the second formula), then fill it down from Z4 to Z10.
    Then place this formula in the cell where you want to see the results:
    =Z4&Z5&Z6&Z7&Z8&Z9&Z10
    Regards,
    Barry

  • HOW TO MAKE A BOOLEAN FUNCTION IN LABVIEW5.0

    I want to use a boolean funtion but it does not exist in existing functions?so how can I do it?I final aim is how to make a VALVE boolean function and how to use it?please teach me,experts! Thank you very much!

    Hi,
    what do you mean by "boolean function"?
    For boolean operations you can use
    1. Case structure. It is located in Functions->Structures
    2. Boolean functions (such as AND, OR, NOT, etc.). They are located in Functions->Boolean
    3. Comparison functions (such as equal?, greater?, less?, etc.). They are located in Functions->Comparison
    You have to give more info about your problem.
    Good luck.
    Oleg Chutko.

  • Dynamic logic expression

    Hi Experts, 
    Iu2019m trying to build a routine with dynamic logical expressions but it's now working...
    Basically Iu2019m building a string with the expression, a and after the string it's completed Iu2019m calling a macro that consist in a if.
    if expression eq true
    return true value
    but the value returned by the macro it's always false, even when the logical expression it's true...
    i already tried the logical function BOOLC but apparently my version, ECC 6, doesnu2019t recognize it....
    Below goes the code, if anyone could help me Iu2019ll be appreciated.
    "Macro definition
    DEFINE check_condition.
    IF &1 EQ ABAP_TRUE.
        move 'X' to &2.
      endif.
    END-OF-DEFINITION.
    LOOP AT tab_regras."Rules
        CLEAR: str_cond, lv_result.
        LOOP AT dfies_tab WHERE fieldname CS 'ARGUMENTO'.
          CLEAR: lw_string, str_1, str_2, str_3.
          ASSIGN COMPONENT dfies_tab-fieldname OF STRUCTURE tab_regras TO <fs_field>.
          CHECK <fs_field> IS NOT INITIAL.
          SPLIT <fs_field> AT '/' INTO  str_1 str_2 str_3.
          ASSIGN (str_1) TO <fs_value1>.
    "     ASSIGN (str_2) TO <fs_value2>.
    "      ASSIGN (str_3) TO <fs_value3>.
          IF str_cond IS INITIAL..
            CONCATENATE <fs_value1> str_2 str_3 INTO str_cond SEPARATED BY space.
            CONTINUE.
          ENDIF.
          CONCATENATE str_cond 'and' <fs_value1> str_2 str_3 INTO str_cond SEPARATED BY space."string condition
        ENDLOOP.
        check_condition str_cond lv_result.
        CHECK lv_result EQ 'X'.
    Thanks in advance,
    Best Regards
    João Martins

    It would be helpful if you show us what is the example content of str_cond .
    Anyhow your check looks like you want to compare some condition with value X which abap_true denotes i.e.
    if field_1 = 10 and field_2 = 20 EQ 'X'. 
    endif.
    This doesn't make sense for me or maybe I am missing something which is hidden behid this str_cond . Your left hand side expression value must however be equal to right hand side value. So the conditon will only be true if
    if 'X' = 'X'.
    endif.
    Regards
    Marcin
    PS: please note that in ABAP there is no real boolean value, so you can't have condition like in JAVA or C
    if (true_condition)
    //do something
    you always have to compare two values (here abap_true which is X if fact).
    Edited by: Marcin Pciak on May 24, 2011 3:59 PM

  • How to convert string to decimal in data association function?

    In a BPM Script component, how in the Data Association can I use an expression to convert an argument from String to Decimal?  I have a Process argument named percentage which is a string.  I need to set the value of a data object called signed to either "Y" or "N" based on the percentage being greater than 0.4.  Something like this:
    (percentage > 0.4) ? "Y" : "N"
    The problem here is that percentage is a string, so must be converted to a decimal value before the compare will work.  I cannot find a function that allows that.  I need something like parseDecimal(percentage), but the Expression Builder does not offer that for a string using a Simple Expression.
    If it cannot be converted, is there another way to do this?

    Guessing you figured this out on your own, but if you wanted to use a Script activity one way to do what you want is when you're creating your data associations drag the "Expression" icon in the middle and double click the icon in the middle you just added:
    Get out of the Simple expression mode and into the XPath expression mode by clicking the dropdown in the upper left corner -> click "XPath Exp".
    In the Functions dropdown on the right, click "Conversion Functions" -> click "number" and then insert it into the expression.
    In the Variables list, select your string variable and insert it into the number function so that it looks something like this:  number(bpmn:getDataObject('myStringVariable'))
    Click OK
    Click your expression icon in the middle and drag it over your decimal variable.
    To have it evaluate and return a Boolean expression in your Script activity, add a Boolean process variable and add an XPath expression as described above except have the logic be this:  number(bpmn:getDataObject('myStringVariable')) > .4  (the "greater than" shown above is added to the expression by clicking "Logical Functions" from the functions dropdown).  Click OK and drag your expression icon over your Boolean variable.
    Dan

  • Doubts with certain standard functions!

    Hi Experts,
          1. What is the differece  in standard functions  - Boolean function : if and ifS.
          2.Sender: what and how value is populated in it!
    I believe Text equals can take text values like Jonny = Jony and not numeric,
        but is boolean equals only to 0 and 1. and what will be the difference majorly?
    Regards,
    Arnab.

    >
    Arnab Mondal wrote:
    > Hi Experts,
    >       1. What is the differece  in standard functions  - Boolean function : if and ifS.
    >       2.Sender: what and how value is populated in it!
    > I believe Text equals can take text values like Jonny = Jony and not numeric,
    >     but is boolean equals only to 0 and 1. and what will be the difference majorly?
    >
    >
    >  Regards,
    > Arnab.
    1. there is if without else and if with else in boolean
    2. Sender populates the value of sender system in runtime (only). The logic is as same as mapping runtime constants - http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/frameset.htm
    3. Dateafter is used to check if one date comes after another in a calendar. Eg you wanna check if 22011982 comes after 22011975, this function will return true. But what is your doubt here?
    4. Text equals expects string as input similarly other boolean and numeric.

  • Logical operators in Oracle select query

    Hello all,
    Can i use logical operators in oracle select queries?
    for 1 and 0 =0 ; 1 or 0 =0
    if i have two fileds in a table COL1 have a value of 1010 and COL2 have a value of 0001.
    Is there any way to use select col1 or col2 from table? where or is a logical operator?
    Regards,

    Hi,
    NB wrote:
    Hello all,
    Can i use logical operators in oracle select queries?Sure; Oracle has the logical operators AND, NOT and OR. All the comparison operators, including >, >=, = !=, EXISTS, IN, IS NULL, LIKE and REGEXP_LIKE are really logical operators, since they return logical values. You can use them in SELECT statements, and other places, too.
    for 1 and 0 =0 ; 1 or 0 =0
    if i have two fileds in a table COL1 have a value of 1010 and COL2 have a value of 0001.It's unclear what you want. Maybe you'd be interested in the BITAND function:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/functions014.htm#sthref1080
    BITAND is the only logical function that I know of. Many other functions, especially numberical fucntions such as MOD, have applications in logic.
    Is there any way to use select col1 or col2 from table? where or is a logical operator?Whenever you have a question, please post a little sample data (CREATE TABLE and INSERT statements), and also post the results you want from that data.
    Explain how you get those results from that data.
    Always say which version of Oracle you're using.

Maybe you are looking for