If/Else/Then statement in Bex

Hi all,
I want to create some conditional logic in Bex formula. The logic I need is:
IF (KeyFigA exists) THEN (use KeyFigA) ELSE IF (KeyFigB exists) THEN (use KeyFigB) ELSE (use KeyFigC)
I am a bit confused on the operators I need to use...Can anyone help?
Thanks
CM

Hi,
( KFA <> 0 ) * KFA + (KFA == 0 ) * (KFB <> 0 ) * KFB + ( KFA == 0 ) * ( KFB == 0 ) * KFC
Just as Bob said, however, you need to use the <> symbols for .NE..  You can also select the symbols in the Boolean Logic section.
Brian
I think I know why Bob added the .NE., even though I can see them in my edit screen, they are not showing up in the message after I save it.
Edited by: Brian Anthony on Oct 20, 2008 4:39 PM

Similar Messages

  • If-then statement in formula node

    **Note - The attached file shows the current block diagram.
    I have a formula node inside a for loop. Inside the formula node I am trying to program the if-then statement:
    If T1<2.0E-5 OR T1>5.5E-4 THEN GOTO 3
    U7=U7+V
    I have 4 items I need help with:
    (1) Is 'II' the correct operator for 'OR'?
    (2) Is 'goto' an acceptable operator within LabVIEW?
    (3) 'U7' is building a 1D array. How do I need to define it? Is it simply 'int U7'? Also, I will add an output value named 'U7' on the formula node wall with an indicator wired to it from outside the for loop.
    (4) Is my use of the equal sign appropriate or do I need to use '=='?
    Thanks for the help.
    Philip
    Attachments:
    if-then_in_FN.jpg ‏18 KB

    Thanks for the help. I went ahead and rewrote the program so I could omit the 'goto's. Another problem that I am having is that I want 2 statements for 1 assignment:
    if (T1>=.002004 && T1<=.002584)
    B1=U
    A1=V;
    I want to assign both B1 and A1 values when the above condition is true. I tried a comma between the U and A1 but it doesn't work as well. Should I define A1 and B1 separately? Or would this create problems?
    if (T1>=.002004 && T1<=.002584)
    B1=U;
    if (T1>=.002004 && T1<=.002584)
    A1=V;
    Thanks,
    Philip

  • "If, Then" Statements Driving Selection

    I am creating a price list/order form and need some help with "If, Then" statements and how their result drives a price selection.
    I have a product that is priced differently based on both how many is purchased and how many colors it has. My variables are (a) one, two, three or four colors, and (b) 10 to 500 pieces in six tiers (10-24, 25-49, 50-99, 100-249, 250-499, 500+).
    I want to autopopulate a price field based on the color number and the quantity, making the pricing foolproof and the total order amount automatically calculated.
    Here's my situation:
      - Field A is Number of Colors (let's say 1-color)
      - Field B is Quantity (let's say it's 23, putting us in the 10-24 tier pricing)
      - Field C is Unit Price (1-color @ 23 qty would be $76.63 each)
      - Field D is Total Price (23 x $76.63)
    My statement would look like the following, but I don't know how to structure this in the form fields or where to put the quantity or pricing table for the software to calculate B or C:
    If A is 1-color, and B is 23, then C is $76.63.
    My Field D calculation is pretty straight-forward (Field C x Field D) if I can figure out a way to determine Field C's value.
    Help!

    Have a look at these tutorials:
    http://acrobatusers.com/tutorials/conditional-execution
    http://acrobatusers.com/tutorials/how-to-do-not-so-simple-form-calculations
    If you still need help afterwards, post here again.

  • DISCOVERER 3.1, IF,THEN STATEMENT

    Dear All,
    I am not an experienced Discoverer user. Please forgive my ignorance.
    I would like to create a column that will "fill in" certain text based on the contents of other columns.
    I have been partially successful by using the DECODE function, but I have only been able to base my result on one column.
    What I need to do is create text statements that will vary based on the contents of 3 different columns. For example IF Fruit=** AND Color=*** AND Date Picked = *** then Statement= MY STATEMENT.
    FRUIT COLOR DATE PICKED STATEMENT
    APPLE RED 30<SYSDATE BAD RED APPLE
    APPLE RED SYSDATE O.K. RED APPLE
    APPLE GREEN SYSDATE BAKING APPLE
    PEACH PINK >SYSDATE GOOD FOR PIES
    Any and all help would be greatly appreciated!
    Thanks
    nancy
    [email protected] or [email protected]

    Dear Andrew,
    Thanks so much for taking the time to reply. I will try this.
    nancy
    Hi Nancy,
    I am not an experienced Discoverer user, but I know SQL. So here is a SQL solution, there might be Discoverer specific ways of doing this I do not know about.
    OK, First try breaking your problem down into parts.
    Outermost: DECODE(fruit,'APPLE', apple_only_section ,
    fruit,'PEACH', peach_only_section ,
    other_fruit_section)
    apple_only_section: DECODE( color , 'RED', apple_red_section ,
    color , 'GREEN', apple_green_section ,
    other_apple_section )
    // Here is where things get 'tricky' to try to determine date ranges.
    apple_red_section: DECODE ( greatest( trunc(sysdate)-30,date_picked) ,
    trunc(sysdate)-30) , 'BAD RED APPLE' ) ,
    'GOOD RED APPLE' )
    The 'greatest' statement above is key to doing date-ranges in a column,
    And you should think about whether the dates should be truncated to remove the time component (as I do for sysdate above).
    And once you have the sections like 'apple_red_section' that you know work, running independently, you start embedding them together to form the higher level statements.
    You end up with hard to understand gobbledegook, but it does work.
    The decode statement is tricky even for a programmer, so work in stages and get each part working before you try to combine them. Better yet get a programmer to write exactly what you want.
    Andrew

  • How to know if a UDF form is opened else then using a TRY CATCH ?

    I'm looking for any way to find out if the UDF form is visible
    else then trying to open it in a try catch and if it's not sending a key.  This if very ugly, slow and not really my kind.
    I tried to iterate through all the forms in SBO_Application.Forms but it's not there.  All I see is the main form
    I just need to make sure the UDF form is visible when Inventory form is loaded so I can put a value in one of the UDF
    If there's a better way I'm buying it

    Hi Marc,
    Rather than putting your data in the UDF in the UDF side form, you can add a control to the main form (during the load event of the form) and bind this to the UDF through the DBDataSource that is already available on the main form. This means that you don't need to worry about whether the UDF form is open or not because you can always read or write to your UDF data from the main form.
    Alternatively, the UDF form TypeEx property is always the same as the main form but with a minus sign in front. Therefore, if you know the TypeEx and FormTypeCount of the main form then you can use the GetForm method of the Application object to get the UDF form.
    oForm = _sboApp.Forms.GetForm("-" + oMainForm.TypeEx, oMainForm.TypeCount);
    You'd still need a try/catch around this and if it raises an error then activate the 6913 menu to open the UDF form.
    Kind Regards,
    Owen

  • I tried to open my Illustrator CS6 today and got the following error message, "To open Adobe Illustrator CS6 you need to install the legacy Java SE runtime". The window then states, "Click More info...to visit the legacy Java SE 6 download website."  I do

    Help. I tried to open my Illustrator CS6 today and got the following error message, "To open Adobe Illustrator CS6 you need to install the legacy Java SE runtime". The window then states, "Click More info...to visit the legacy Java SE 6 download website."  I do click on the More Info... button, but the webpage is blank. Please help.
    Thanks,
    Leo

    Leo,
    Depending on your OS, you should be able to use;
    Win:
    http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419 409.html
    Mac:
    http://support.apple.com/kb/DL1572
    Some have found that the page may turn up blank to start with, so it may be necessary to reload the page.
    Others have found that it may depend on browser. Specifically, a switch from Safari has solved it in one case.

  • Can I write in the layout  in any Key figure something else then number ?

    Hi
    (sem - bps)
    Can I write in the layout  in any Key figure something else then number ?
    Let say I want to right in the key figure number with CHAR (the letters a-z)
    Can I do so ?
    Can a key figure  has char other then number ?

    no i can't , because the user want to assign a characteristic ,for example (the layout) :
    0employye  0amount 0project
    P1211111   1000   #
    after the user will assign :
    0employye  0amount 0project
    P1211111   1000   ea-5819
    can the user assign 0project ?
    the current solution i mange to build was :
    a variable with 2 characteristic 0employee & 0project
    and with user exit i move the values to Variable
    ,and in the fox i use substr to split the variable ,
    the code is :
    FUNCTION Z_REFERNCE_RELATION_EMPL_ITER.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(I_AREA) TYPE  UPC_Y_AREA
    *"     REFERENCE(I_VARIABLE) TYPE  UPC_Y_VARIABLE
    *"     REFERENCE(I_CHANM) TYPE  UPC_Y_CHANM
    *"     REFERENCE(ITO_CHANM) TYPE  UPC_YTO_CHA
    *"  EXPORTING
    *"     REFERENCE(ETO_CHARSEL) TYPE  UPC_YTO_CHARSEL
    CONSTANTS:
      l_source_var TYPE upc_y_variable VALUE 'YPABONUS',
      l_source_area TYPE upc_y_area VALUE 'PAPFMAIN',
      l_use_restricted_values TYPE boole-boole VALUE 'X',
      l_buffer_call TYPE boole-boole VALUE 'X'.
    DATA:
      l_subrc LIKE sy-subrc,
      ls_return LIKE bapiret2,
      l_type LIKE upc_var-vartype,
      lto_varsel_all TYPE upc_yto_charsel,
      lto_varsel TYPE upc_yto_charsel,
      lto_var TYPE upc_yto_charsel,
      lto_chanm TYPE upc_yto_cha.
    * Xth_data os type 'YTH_DATA' (see SE11) .
    TABLES : upc_var_cha_act.
      DATA : wa  TYPE  upc_var_cha_act.
      DATA : my_it2  type table of upc_var_cha_sel,
             my_it3  type table of upc_var_cha_sel,
              wa_1 like line of my_it2,
              wa_3 like line of my_it3,
              wa_2 like line of eto_charsel.
    SELECT  *
       into corresponding fields of table my_it2
      FROM upc_var_cha_sel
      WHERE area EQ 'PAPFMAIN' AND
            var  EQ 'YPABONUS' AND
            varuser EQ sy-uname AND
            chanm EQ '0EMPLOYEE' .
    sort my_it2 by seqno.
    loop at my_it2 into wa_1 .
    clear wa_2.
    move-corresponding wa_1 to wa_2.
    append wa_2 to  eto_charsel.
    endloop.

  • Quicktime 10.0 will not play apple trailers from site. I have Mac OS X 10.6.8 - site directs me to download - then states I have it already - all software updated.  What do I do?

    Quicktime 10.0 will not play apple trailers from site. I have Mac OS X 10.6.8 - site directs me to download - then states I have it already - all software updated.  What do I do?

    JessBennet wrote:
    ... I already clicked on the Apple symbol on the top left part of my screen and clicked "Software Update'' but it says I am up to date, which clearly is not right)
    It is Correct for your Current OS = Leopard = 10.5.8
    The first step in Upgrading... is to Snow Leopard = OS X 10.6.x
    It is Not available as a download...
    Do this first...
    Check that your Mac meets the System Requirements for Snow Leopard...
    Snow Leopard Tech Specs
    http://support.apple.com/kb/SP575
    If so Contact Apple in your Country to Purchase a Snow Leopard Disc...
    http://support.apple.com/kb/HE57
    In the US...
    1-800-MY-APPLE or 1-800-676-2775
    After the Successful Install, run Software Update to get the latest updates for Snow Leopard.
    Be sure to make a Backup of your Current System Before Upgrading...

  • Writing an if-then statement

    I would like to write an if-then statement that would hide an element (image of a pause button) when the main timeline is stopped. I have a play forward button that when pressed will switch to a pause button. The same happens for the play reverse button. This way the buttons are like toggles...press once it plays and press again and it stops. I have this working fine, but there are several stop triggers throughout the timeline, and when the animation is stopped my pause/play button will still be in the pause button mode, thus a user will not be able to restart the animation. There are too many of these stop triggers to make it practical to add a hide command to each to hide the pause button (thus making the play button underneath accessable), so what I would love is if I could write a statement that would hide both pause buttons whenever the timeline is not running.
    I need to know the correct way to write the code and where to put it.
    Thanks in advance,
    Greg

    Hi Joel...
    you can view the test site here http://cyclesofyah.com/slider-test_screen-swap-test/
    and you can download the files here http://cyclesofyah.com/chrono/cycles_test.rar
    you won't see much happen until you click on the gear icon. While the timeline is running you can type any number on your keyboard, and it will take you to a stop trigger.
    Thanks

  • Why when I use Brush Tool on a layer mask, I must click on somewhere else then I am able to see my effects of my previous brush on my mask

    Why when I use Brush Tool on a layer mask, I must click on somewhere else then I am able to see my effects of my previous brush on my mask.
    If I don't click click on somewhere else, I cannot even see my current brush effects
    This kind of problem really slow down my work flow. So if you guy know the solution of my problem, please let me know.
    Thanks

    Update your graphics driver/ turn off GPU usage in the performance prefs. You have an issue with hardware-based transparency handling most likely. Otherwise you could have an issue with your input device, but since you have not provided any system info, we can't really know anything.
    Mylenium

  • Scanning photo and does scan then states ;Non writable will not save?????

    scanning photo and does scan then states ;Non writable will not save?????

    If you're having trouble making changes to files that are inside your home folder (represented by a house icon in the sidebar of a Finder window), or if you can't get changes to the settings of an application to stick, then please see below.
    Back up all data.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    I've tested these instructions only with the Safari web browser. If you use another browser, they may not work as described.
    Step 1
    If you have more than one user, and the one in question is not an administrator, then go to Step 2.
    Triple-click anywhere in the following line on this page to select it:
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR..; sudo chown -R $UID:staff ~ $_; sudo chmod -R u+rwX ~ $_; chmod -R -N ~ $_; } 2>&-
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    You'll be prompted for your login password. Nothing will be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command may take a few minutes to run, or perhaps longer if you have literally millions of files in your home folder. Wait for a new line ending in a dollar sign ($) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1, if it frightens you, or if it doesn't solve the problem.
    Boot into Recovery. When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password dialog will open. You’re not going to reset a password.
    In the dialog, select the startup volume ("Macintosh HD," unless you gave it a different name) if it's not already selected.
    Select your username from the menu labeled Select the user account if it's not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • IF THEN ELSE STATEMENT IN BeX Query designer

    Hi,
    I want to write a query as follows:
    IF <Value a> is available THEN <Value a> ELSE <Value b>
    I have written it as follows:
    (X>0)X+(X<=0)Y
    The problem with this equation is,  in case X = 0(number Zero) then Y is not getting displayed. But In case X =NULL (or no values) then Y displayed. This is leading to inconsistency in final result. Please help in rectifying the formula incase it is incorrect or is it because of some program bug in BeX?
    Regards
    Madhav

    This works for me...dont understand y its not working with u!!
    it is simple:
    (X<>0)X+(X==0)Y
    If X is 0, then  0X + 1Y = Y
    else
    1X + 0Y = X.
    What result you are getting in both cases?
    as you thing,X value is may not be 0 in your case. It may be 0.00004...something like that...Set Decimal Places to 5 or 6 to X.
    Message was edited by:
            Muralidhar C

  • IF ELSE Statement in BEx Query based on the results

    Hi experts,
    I want to realize the following IF/ELSE statement in a BEx Query in respect to the result values
    If the result of KF1 equals 0, than set the KF2 to 0, Else (KF1 NE 0) show the value of KF2
    Background: I want to report the order backlog. In the example above we have an incoming order value of 23.700,80 EUR in periode 12.2013 and an turnover of 22.370,80 EUR in periode 01.2014. The order backlog in ST (KF1) is 1 ST (12.2013) - 1 ST (01.2014) = 0 ST. The order backlog in EUR (KF2) is 23.700,80 EUR (12.2013) - 22.370,80 EUR (01.2014) = 1.330 EUR. The Order and Invoice is finished, but we have an positive order backlog in EUR (reason: less turnover as incoming order).
    For this case I want to realize the IF/Else statement to check if the oder backlog in ST = 0, if yes, than set the order backlog in EUR also to 0.
    Any best practices?
    Many thanks and best regards,
    Michael

    Hi Suman,
    thanks aigain for your reply!
    I have tried your proposal before you have posted it.
    In my special case the following if/else statement works successfully:
    CKF = calculated key figure
    Formula1 = (CKF1 == 0) * 0 + (CKF1 <> 0) * CKF2
    In my case the CKF2 is the result value from "Incoming Order value" - "Turnover"
    So I had to define a separate Formula (1:1 equals to CKF2) and then I was able to set "*CKF2" in the statement.
    The statement CKF2 = (CKF1 == 0) * 0 + CKF2 is not possible (because it´s not possible to calculate from CKF2 itself).
    Now it works
    Best regards,
    Michael

  • IF...ELSE.. STATEMENT in BEx Query Designer

    Hi,
    Why there is no IF, ELSE function in BEx Query Designer?
    Assuming I need to write the following logic, how can it be accomplished?
    IF (A=0 OR B=0)
        THEN 0
    ELSE IF ( B/A <0)
        THEN '       *'
    ELSE
        B/A * 100
    i.e.
    if A or B is equal to 0, then display the value of 0
    else if B is negative (as A is either 0 or positive), then display the following text: '         *'
    otherwise, display the value of  B/A * 100
    Thanks!

    Hi,
    You can achieve this by creating a new formula.
    You have to use the boolean operations and mathematical functions. But we cannot display *. u have to display some value for that.
    Khaja

  • IF ELSE statement in BEX

    Hi all,
    I need to write a formula in a query using  IF ELSE statements. Here is my senario
    I need to write a IF ELSE statement to calculate a KF i.e., % variance of This year with last year sales (TY%LY) .Following are the conditions.
    IF LY<0 then TY % LY should be (TY-LY)/LY * (-100)
    IF LY>0 then TY% LY should be (TY-LY)/LY * (100)
    IF LY =0 then TY%LY should be 100
    IF LY=NULL (i.e., if store is closed last year we donu2019t pull record so LY will be empty) then TY%LY should be 100
    IF TY=0 or NULL then TY%LY should be -100
    So I tried writing as follow but getting errors
    (LY<0)(TY-LY)/LY(-100) + (NOT(LY<=0))((TY-LY)/LY)100  + (LY==0)100 + NODIM(LY)100 + (TY==0)(-100) + NODIM(TY)(-100)
    But it is giving errors. Can you please suggest me how to write that formula without effecting the current performance of the query.
    Thanks in Advance,
    Preethi

    Hi Preethi,
    I think that you can accomplish the desired results using the following formulas:
    KEY FIGURE = NOT(F1=0) * F5 + (F1=0) * -100
    F1 = NOERR(TY + 0)
    F2 = NOERR(LY + 0)
    F3 = NOERR( (F1-F2) / F2 ) * -100
    F4 = F3 * -1
    F5 = (F2<0) * F3 + (F2>0) * F4 + (F2=0) * 100
    I hope it helps you.
    Regards,
    Maximiliano

Maybe you are looking for

  • Error message in A/R invoice

    Hi when trying to add A/R invoice ,(excise item) error occured: cannot create standalone AP/AR invoice & AP/AR credit memo with exciseable item[message-140080010-18] pls give solution to this problem

  • Error message from ABAP to portal

    Hi I need to write error message from ABAP to BW portal. If I write as usual: message E001(ZBW). Then I get a dump in portal. Does anyone know how to post error message in this case? Thanks.

  • Can't import mov files into Final Cut Pro

    I can't seem to import some .mov files into FCP.  The codecs showing in "info" for the files are DV/DVCPRO - NTSC, Linear PCM, Timecode.  I have other files which I can import into FCP and they show the exact same codecs in their info page.  I have n

  • Selection-screen problem:need to go back to selectionscreen not source code

    Hello experts, Please help me on my dillema. I have 2 reports, zreport1 and zreport2. Now, zreport1 submits values via selection-screen to zreport2. Now here is the problem, when I press 'BACK' on the selection-screen of zreport2(rememeber we used su

  • Best way to load balance VPNs

    I have two ASA 5540s that I would like to configure for VPN load balancing. I had been looking at the Active / Standby configurations, but am curious if doing this I can truly get VPN load balancing or if this means all VPNs on the active unit and th