Displaying negative numbers under certain conditions

I have a Crystal Report which I am developing and need to display positive numbers as negative, but only under certain conditions.  I did not see anything on this type of questions so I decided to join and post it up myself.  This is a transfer report so if the location number entered in the parameter list is the SHIPPING location, I need to display retail, cost, and totals as negative.  Here is the formula which I came up with for ext cost, but it is returning all zeros.  I cannot seperate the to and from locations in the parameters because this report needs to display both in and out of that location.
if totext({?loc}) = totext({Command.SHIP_FROM}) then ({Command.EXT_COST}*-1)
Any suggestions?  Appreciate the help!

Hi Jon,
If it returns zeroes, then it means that this part of the code fails:
totext({?loc}) = totext({Command.SHIP_FROM})
Do you have records where the value entered in the 'loc' prompt matches with records in the SHIP_FROM column on the report?
See if this helps:
if totext({?loc},0,"") = totext({Command.SHIP_FROM},0,"") then ({Command.EXT_COST}*-1)
-Abhilash

Similar Messages

  • Displaying negative numbers in brackets in Excel output

    Hello all.
    I have an RTF template...I tired displaying negative numbers in brackets like : (123.80) in Excel output
    But, this is working in PDF and not in Excel.
    Please let me know the way to dsiplay the numbers in brackets.

    varma wrote:
    Negative numbers in bracket
    add a conditional statement like below.
    <?if: NUMBER_TO_CHECK < 0?> <?concat('(',NUMBER_TO_CHECK,')')?><?end if?>
    <?if: NUMBER_TO_CHECK > 0?> <?NUMBER_TO_CHECK?><?end if?>
    are you using the same template for PDF and EXCEL ?
    if so, it has to be handled little differently.
    Place this line in the beginning of the rtf
    <?param@begin:_xf;''?>
    add this condition on number column for Excel output
    <?if:$_xf='excel' and NUMBER_TO_CHECK < 0?> <?concat('(',NUMBER_TO_CHECK,')')?><?end if?>
    Try the above one it should work.
    Have a Nice dayThis didnt work.
    Say that I have element named 'market'
    I placed this condiion <?param@begin:_xf;''?> at the beginningof RTF
    Replaced the number field with this condition: <?if:$_xf='excel' and market< 0?> <?concat('(',market,')')?><?end if?>
    This is giving me a blank output in place of the number.
    >

  • Skip product allocation under certain conditions

    Hi everyone. We are trying to use EXIT_SAPLQUOT_001 which is supposed to be running prior to product allocation, so we can set up parameter E_AFLAG so that this functionality is skipped under certain conditions.
    Exit documentation says:
    User Exit: SD Product Allocation, Enhanced Checks
    Functionality
    The user exit is called up before reviewing the confirmed quantities against discrete allocations (from 3.0F).
    Before this happens, the availibilty check is carried out if this is switched on in Customizing (ATP or against pre-planning). The results of this are transferred to product allocation.
    You can carry out the following tasks with this function module:
    1. You can switch off or miss out product allocation (E_AFLAG). This can be general or depending on characteristic values. Other values to help make this decision can be imported from the order coding memory.
    However, the exit doesn't seem to be triggered during sales order processing. It takes us straight into the product allocation screen, ignoring the breakpoint and the skipping instruction.
    Any ideas? Anybody is using this exit for this purpose? We run product allocation without running ATP. Could this be the problem?
    Thanks!

    sounds like this the problem.
    as I understand,
    if running ATP, EXIT_SAPLQUOT_001 is hit, based on your logic, prod alloc is skipped.
    elseif ATP is turned off, EXIT_SAPLQUOT_001 is skipped, by default prd alloc is executed.
    try setup break points on prod. alloc to see if you could have alternative flag to control...
    go to debug mode and check call stacks to find another place to set break point.

  • Wi-Fi Connection Time Displays Negative Numbers

    Using an AEBS with the latest firmware 7.6.2 and OS X 10.7.2.  The Wi-Fi connection time appears to randomly start displaying negative numbers. It then counts down (up?) to zero and then displays positive numbers. Anyone else seen this?
    Regards.

    I have the same problem (Macbook 2008, 10.6.8 airport extreme 7.6). Has there been a fix? How do I report this bug, which seems to be affecting older machines as well? It's somewhat amusing, but is starting to become annoying.
    Melinda

  • Display Negative numbers

    Hi,
    I am using JDeveloper 11.1.1.5
    One of an ADF page is expected to display negative number and also follow the number format pattern as shown below. I am not able to display negative numbers. Can anyone help here please?
    Below is my code snippet.
    VO.xml ::
         <ViewAttribute
         Name="TotalDue"
         IsUpdateable="false"
         IsPersistent="false"
         PrecisionRule="true"
         Precision="15"
         Scale="2"
         Type="java.math.BigDecimal"
         ColumnType="NUMBER"
         AliasName="NET_DUE_INVESTOR"
         Expression="NET_DUE_INVESTOR"
         SQLType="NUMERIC">
         <DesignTime>
         <Attr Name="_DisplaySize" Value="22"/>
         </DesignTime>
         <Properties>
         <SchemaBasedProperties>
              <LABEL
              ResId="NET_DUE_TOFROM_INVESTOR"/>
              <FMT_FORMATTER
              ResId="com.ahmsi.isams.liquidation.model.vo.Liquidation332FormView.TotalDue_FMT_FORMATTER"/>
              <FMT_FORMAT
              ResId="com.ahmsi.isams.liquidation.model.vo.Liquidation332FormView.TotalDue_FMT_FORMAT"/>
         </SchemaBasedProperties>
         </Properties>
         </ViewAttribute>
    ModelBundleProperties ::
         TotalDue_FMT_FORMATTER=oracle.jbo.format.DefaultNumberFormatter
         TotalDue_FMT_FORMAT=\#,\#\#\#,\#\#\#,\#\#\#,\#\#0.00;(\#,\#\#\#,\#\#\#,\#\#\#,\#\#0.00)
    myjsfpage.jsf ::
         <af:outputText value="#{bindings.TotalDue.inputValue}"
              id="ot5141" inlineStyle="font-weight:bold;">
         <af:convertNumber groupingUsed="false"
                   pattern="#{bindings.TotalDue.format}"/>
         </af:outputText>

    Got it correct now. I changed the pattern as below. Also added a nowrap=true on the output text
    ModelBundleProperties ::
    TotalDue_FMT_FORMATTER=oracle.jbo.format.DefaultNumberFormatter
    TotalDue_FMT_FORMAT=\#,\#\#\#,\#\#\#,\#\#\#,\#\#0.00;-\#,\#\#\#,\#\#\#,\#\#\#,\#\#0.00
    Thank you all for your directions.
    Thanks,
    Prashant

  • Monitor fades out under certain conditions

    Hello all,
    This seems more of a hardware issue than anything however I hope to gain some insight by posting about this problem here. Whenever I'm being presented with a screen that has little or no text (i.e.: login screen at CLI) my monitor will fade out to black. If enough text starts to fill the screen, it will fade back in. It happens consistently under these conditions. My video setup is a nVidia GeForce 8800GT and an ASUS VH238H LED Monitor. Also mind you this is a fresh install of Arch. Has anyone else had faced this issue? Any input would be greatly appreciated.

    Is it DPMS https://wiki.archlinux.org/index.php/Di … _Signaling ?
    It will kick in after 10 minutes of inactivity e.g. when you don't move your mouse or press any key - is this the condition you're experiencing?

  • My WiFi signal is displaying negative numbers instead of signal strength.

    Recently my Ipod 3rd gen. has been getting real weird with the wifi. first, it would always lose signal whenever i would do anything, like watch videos or open an app that required wifi. if i moved a couple feet it'd start to connect again. Then it started displaying a "-87" where the wifi signal would be. and the number would either increase or decresase, until i tried doing something that requird wifi. at first it would only come on whenever i restarted my ipod and itd quickly lose signal. ive restorede my ipod 3 times today, dumped everything. ive tried jailbreaking it to see if itd refresh files or anything. im not sure what to do anymore. ive looked for hours online and cant seem to find anyone with this problem. Any suggestions or ideas? without me buying a new one. i don't have a warranty..
    Message was edited by: jbiggie1130

    Interesting. The -87 refers to signal strength in db, which I believe are decibels. The lower the number, the stronger the signal.
    However, iPods don't display these numbers unless you have jailbroken the device or are using an app like WiFinder (since removed from the App Store).
    And since you have jailbroken the device we can't, by the terms of service of this site, offer you any advice other than to refer you to help article on WiFi: http://support.apple.com/kb/TS1398

  • The down arrow of the msctls_updown32 control can fail to display under certain conditions using certain Windows Desktop themes

    I have a very odd issue with the msctls_updow32 control. Depending on the type of window or window heirarchy, when I click the up arrow with the autobuddy being an edit control, the down arrow disappears off the down button. I have to move the mouse back
    over the down button to get it to display. At first I figured it was something in my OnCtlColor code. But I found that the updown control is never passed to OnCtlColor. I get the window class of each input and it never shows up. Nor does it's window handle
    get passed in. Turning off OnCtlColor code and going default doesn't help. What I have found that helps is to turn off WIndows 7 Aero desktop and turn on Windows Classic desktop (Windows 7 Basic has the issue too). I also found that applying a skin to my app
    avoids the issue. Using spy I finally found what appears to be a connection to EM_SETSEL. When that message is sent and processed, the arrow has disappeared. I finally gave up and created my own subclass of a CEdit control (MFC) and called SubclassDlgItem.
    Then I implemented WindowProc and trapped the EM_SETSEL. Then I had to call UpdateWindow on the spin control and finally get the rectangle of the edit (buddy) and spin control and use that in a call to the parent (dialog) window's RedrawWindow.
     So there appears to be an issue with the updown control paired with an edit control that shows up depending on what desktop theme I am using. And to top it off, the window heirarchy seems to matter too (or perhaps the styles of the parent make a difference
    as I found the issue doesn't show up on every window that may contain such a configuration). Consider this a heads up regarding the issue! One other note, changing to any of the "High contrast" Windows 7 desktops also avoids the issue. So Aero and
    Basic seem to be the key.
    R.D. Holland

    Fails on Win 8.1 too. As with Win 7, changing the desktop display to one of the high contrast ones avoids the problem. My work-around is below. I have a video showing the problem. It also shows the display being changed to high contrast and how the problem
    goes away. If only I could figure out how to use this web page to upload the zip file containing the video ...
    LRESULT Myedit::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
    LRESULT lr = CEdit::WindowProc( message, wParam, lParam );
    if( message == EM_SETSEL )
    CDialog* pParent = (CDialog*) GetParent();
    if( pParent )
    CSpinButtonCtrl* pSpin = (CSpinButtonCtrl*)pParent->GetDlgItem(IDC_SMALL_PARTS_SPIN);
    if (pSpin)
    CRect rectSpin;
    pSpin->GetWindowRect( &rectSpin );
    CRect rectEdit;
    GetWindowRect( &rectEdit );
    CRect both;
    both.UnionRect( &rectSpin, &rectEdit );
    pParent->ScreenToClient( &both );
    //pParent->InvalidateRect( &both );
    //pParent->Invalidate();
    //pSpin->Invalidate();
    pSpin->UpdateWindow();// skip this and the problem remains.
    pParent->RedrawWindow(&both);// skip this and the problem remains.
    return lr;
    R.D. Holland

  • Reference t osegments and displaying under certain condition

    I'm trying to understand how conditions are working for DMEE tree. According to this [condition and argument description|http://help.sap.com/saphelp_47x200/helpdata/en/aa/62683864b47345e10000009b38f8cf/frameset.htm] I can't understand how these conditions are working when I'm dealing with reference id.
    Lets imagine following example:
    1) We have two levels
    All tree has following structure:
    ROOT
    |- SEGM_GROUP_1, level 1, reference id REF_1
    |--- ELEMENT_1_1, ouput for this node is "out_1_1"
    |--- ELEMENT_1_2 output for this node is "out_1_2"
    |--- SEGM_GROUP_2, level 2, reference id REF_2
    |------ ELEMENT_2_1 output for this node is "out_2_1"
    |------ ELEMENT_2_2 output for this node is "out_2_2"
    |------ ELEMENT_2_3 outputs loop number e.g. 'loop no. 1"
    How to set up conditions, using reference id to achieve following output?
    out_1_1
    out_2_1 loop no. 1
    out_2_2 loop no. 1
    out_2_1  loop no. 2
    out_2_2 loop no. 2
    out_1_2
    What is interesting me is case when I put in condition reference id e.g. REF_1. What should I put in arg1-1? What is then a meaning of this value? Is it level? Is it number of occurrences? Is it something else?

    This question is expired

  • "Moo" = Right fan repeatedly spinning up and down under certain conditions

    I am pretty certain I have figured out what is causing the "moo". Here is my theory based on a couple of weeks of experimentation...
    It is the right fan starting up and stopping. Again..and again...and again. It does this in response to temperature changes. But the threshold is too sensitive so what happens is an increase in temperature triggers the fan, the fan winds up and in so doing after a couple of seconds this immediately drops the temperature below the threshold and so the fan winds down. The temperature now builds and after a couple of seconds the fan spins up again. It will keep doing this until either activity falls so that the temperature stays below threshold or continuos activity ensures the temperature stays high enough to keep the fan on at low speed (when it is generally quiet unless there is a heavy load).
    I will guess the cause is probably a faulty sensor, faulty fan or most likely faulty fan control logic since this is clearly happening with a lot of MBPs. If it is the latter then presumably they need only change the firmware controlling the fan to make it start slower and stay on longer.
    Why doesn't everyone hear it?
    a. Like most fan type noises they are only apparent in a quiet room - as most people work in rooms full of white noise they simply will not hear it even if it happens.
    b. Some people have better hearing and are more sensitive to noise.
    c. It needs the right set of hardware and sofware activities to trigger the problem...............
    In my particular case I typically have my 2.0ghz MBP connected to an external monitor, ethernet and external USB mouse on the right side of the MBP. When I am using the MBP standalone (ie without more heat being generated) the noise does not occur as often, presumably because when idling less heat is generated.
    As you change what you are doing with the machine (not sure if its CPU or Video related changes that matter most) the noise will start or stop happening. Doing absolutely nothing typically means the noise does not happen so often, but then again it can be sitting doing nothing and it will start happening. Doing a bit means (say 10-30% CPU) means it will make a noise , doing a moderate amount (say above 40% CPU) means it does not happen because the temperature stays high and the fan stays on - generally being quiet at low speed. If you push the machine (say 80% CPU) then a louder fan noise is noticeable. I have also found that opening/closing the lid (when using an external monitor) makes a difference, the surface it is on makes a difference and the room temperature probably does as well.
    A good way to experience this is to start Garageband recording the noise when it happens since the additional load stops the noise. The spin up/down cycle will continue for 4 or 5 cycles as you record the noise but then the fan remains on very low speed as a new higher thermal equilibrium is achieved.
    For reference I am on my 2nd MBP (the first also had this problem but it was less noticeable) and have experienced most the other noises:
    a. Left Fan always runs on both machines
    b. Screen buzz when not on full brightness on 1st MBP not in on 2nd.
    c. CPU whine was not on 1st MPB but it is on the 2nd - but only at low level and only if running on battery power.
    I have a couple of other irritating problems:
    d. Screen dims after 2 minutes regardless of power setting etc.
    e. Fit of 1st MBP was great, 2nd not so good.
    Personally I find the fan spinup/down noise very very annoying, far more so than the left fan always being on. I really do need Apple to fix it, but I dont see the point of sending the machine in unless they recognize the problem and have a systemic solution since clearly this is common problem. Otherwise the chances are a tech will plug it in standalone in a noisy repair shop, hear nothing and either do nothing or never know if its fixed or not. So far no intelligent response from Applecare......If I can figure this Apple ought to be able to and get a fix.
    And no I would not recommend buying a MBP until this problem is fixed if you are at all sensitive to noise and work somewhere quiet - because it appears to be a gamble as to whether you will get a quiet MBP or not. That's a shame since otherwise its a very slick machine.

    I agree with u; however:
    -The left fan that's always on is the Hard Drive - listen to the hard drive to the left of the trackpad and you'll realize that it is coming from there.
    -My "moo" sound comes from my LEFT fan. So if it's a firmware issue, why would the side of the fan affected by the problem varry? this leads me to the worrying assumption that it is a hardware issue...If this is the case, who knows if apple will even cover it under warranty if it doesn't affect the performance of the system...

  • Remove duplicated entry under certain condition

    Good day!
    I have this report that displays Journal Entry Numbers and their corresponding Outgoing Payments Numbers (if they have). Tables involved are OVPM and OJDT. The problem is, there's this one Journal Entry number that two Outgoing Payments points at. One of the Outgoing Payments' Remarks is labeled 'Cancelled'. On the report, I wanted to remove the OVPM that has a Cancelled remark. Thank you.

    Use the select expert
    <> 'Cancelled'
    Ian

  • Results don't display negative numbers

    I have an application that accepts a 24 bit number and does some simple mathematical operations (see attached).  If number 3(a probe) receives a number lower than the constant that is being subtracted from it, which should result in a negative number, number 6(probe) displays a much larger, positive integer.
    I'm sure that I must be missing something simple somewhere.
    I thank you for your help in advance.
    Ron Deavers, CLD
    Attachments:
    NumberError.bmp ‏114 KB

    Thank you very much. I didn't realize the difference between unsigned integer and integer.
    Ron Deavers, CLD

  • RAW import looks odd under certain conditions

    Hi All,
    Every so often, when I import images from either my Canon EOS D30 or my Canon Powershot G3, I find that the colours in the decoded RAW image look very odd (these were generally pictures taken under extreme lighting conditions). I've attempted to fiddle with the colour temperature and tint to try and compensate but it still looks very wrong.
    However, if I convert these images using the utilities that were provided by Canon for Windoze then the colours seem to come up right - unfortunately I can't seem to find the same set of utilities for the Mac
    Does anyone have an idea of whether this is an issue with the RAW decode on the Mac or whether there is some additional setting that I need to fiddle to get it right?
    I have posted the original image produced by the Mac RAW decoder and the Canon decoder (under windoze) over here if anyone is interested in seeing the difference:
    http://www.flickr.com/photos/62993825@N00/
    BTW, I have the latest RAW decoder updates, latest aperture updates and Mac OS X updates.
    Cheers,
    Emil.

    Emil,
    I was able to bring both JPEGs into Aperture and get the color nearly identical by doing as you describe above -- moving the Tint slider to -150 -- but then selecting the magenta square in the Color adjustment panel and sliding the Hue slider towards red (to about 30) and sliding the Range slider all the way to the right (to 2.00).
    BTW, in addition to clicking the left arrow to go beyond their slider ranges in the number input boxes, you can also click on the number input box and when the cursor turns to an I-bar with triangles on either side, you can just click and drag the number to a value higher than the slider will allow.
    -Karen

  • Getting next line of resultset under certain conditions

    Hello,
    I have a resultset with a column of ascending numbers. Now I want to compare these numbers to a value. If one of the numbers matches exactly to the value then everything is fine and I can use number <= value as condition. If the value doesn't match exactly I want to get the next greater number in the result as well. A short example
    Nb in resultset
    41
    82
    123
    164
    205
    246
    Value to compare with = 200, I want to have
    41
    82
    123
    164
    205
    as result.
    Value to compare with = 164, I want to have
    41
    82
    123
    164
    Thanks for any advice.
    Regards Carsten

    This ought to do the trick:
    with sample_data as (select 41 num from dual union all
                         select 82 num from dual union all
                         select 123 num from dual union all
                         select 164 num from dual union all
                         select 205 num from dual union all
                         select 246 num from dual)
    --- end of mimicking your sample_data
    select num
    from   (select num,
                   row_number() over (partition by case when num < :p_num then 1 else 0 end order by num) rn
            from   sample_data)
    where  num < :p_num
    or     rn = 1
    order by num;eg:
    SQL> variable p_num number;
    SQL> exec :p_num := 200;
    PL/SQL procedure successfully completed.
    SQL> with sample_data as (select 41 num from dual union all
      2                       select 82 num from dual union all
      3                       select 123 num from dual union all
      4                       select 164 num from dual union all
      5                       select 205 num from dual union all
      6                       select 246 num from dual)
      7  select num
      8  from   (select num,
      9                 row_number() over (partition by case when num < :p_num then 1 else 0 end order by num) rn
    10          from   sample_data)
    11  where  num < :p_num
    12  or     rn = 1
    13  order by num;
           NUM
            41
            82
           123
           164
           205
    SQL> exec :p_num := 164;
    PL/SQL procedure successfully completed.
    SQL> with sample_data as (select 41 num from dual union all
      2                       select 82 num from dual union all
      3                       select 123 num from dual union all
      4                       select 164 num from dual union all
      5                       select 205 num from dual union all
      6                       select 246 num from dual)
      7  select num
      8  from   (select num,
      9                 row_number() over (partition by case when num < :p_num then 1 else 0 end order by num) rn
    10          from   sample_data)
    11  where  num < :p_num
    12  or     rn = 1
    13  order by num;
           NUM
            41
            82
           123
           164(if you're using this inside PL/SQL, then you'd change the :p_num to be the parameter passed into your stored procedure.)

  • Kernel Panic's under certain conditions

    Is there anyone else getting a Kernel Panic anytime iTunes is running concurrently with Adobe Photoshop CS2 and Adobe Bridge? Or am I the only lucky one? This is happening with enough frequency such that I am begining to wonder if this v10.4.7 thinks it is now part of the Microsoft family.
    Any input greatly appreciated. The latest Panic.Log below:
    panic.log:
    Description: Panic (system crashes) log
    Size: 18.07 KB
    Last Modified: 9/26/06 6:46 PM
    Location: /Library/Logs/panic.log
    Recent Contents: ...
    0x000A9914
    Proceeding back via exception chain:
    Exception state (sv=0x00F06500)
    previously dumped as "Latest" state. skipping...
    Exception state (sv=0x61483500)
    PC=0x9000B268; MSR=0x0000F030; DAR=0x3DC4EBE0; DSISR=0x42000000; LR=0x9000B1BC; R1=0xBFFFF370; XCP=0x00000030 (0xC00 - System call)
    Kernel version:
    Darwin Kernel Version 8.7.0: Fri May 26 15:20:53 PDT 2006; root:xnu-792.6.76.obj~1/RELEASE_PPC
    panic(cpu 1 caller 0xFFFF0004): 0x400 - Inst access
    Latest stack backtrace for cpu 1:
    Backtrace:
    0x00095718 0x00095C30 0x0002683C 0x000A8404 0x000ABD80
    Proceeding back via exception chain:
    Exception state (sv=0x00F06500)
    PC=0x00000010; MSR=0x40009030; DAR=0x3DC4EBE0; DSISR=0x40000000; LR=0x000A9914; R1=0x46E03E90; XCP=0x00000010 (0x400 - Inst access)
    Backtrace:
    0x000A9914
    Exception state (sv=0x61483500)
    PC=0x9000B268; MSR=0x0000F030; DAR=0x3DC4EBE0; DSISR=0x42000000; LR=0x9000B1BC; R1=0xBFFFF370; XCP=0x00000030 (0xC00 - System call)
    Kernel version:
    Darwin Kernel Version 8.7.0: Fri May 26 15:20:53 PDT 2006; root:xnu-792.6.76.obj~1/RELEASE_PPC

    LOL! Thanks. Been in IT for 23 years. I disabled the Widgets pursuant to the URL provided. E.g., I'm taking the least path of resistance first.
    Lyman
    3. Widgets
    Some poorly written widgets for Mac OS X 10.4 access memory in ways that the system was not designed to accept. One such widget that has since been updated to avoid kernel panics is Ministat. If you recently downloaded a widget, try disabling it to see if it makes a difference. To disable a widget under Mac OS X 10.4 and 10.4.1 you can use Widget Manager. With Mac OS X 10.4.2, Apple has created a special widget called Manage Widgets which can be activated by enabling the widget toolbar (hit the + with the circle around it in the bottom left corner).

Maybe you are looking for