Negative numbers in Expression Builder

Hello,
I am trying to create the following expression in one of the columns I have in the Business Model Layer in Administration tool:
CASE
WHEN Column1 * 100.0 <= *300.0* THEN 0.0
ELSE Column1 * 100.0
END
This works fine, but when I change 300.0 to negative, it simply doesnt work.
CASE
WHEN Column1 *100.0 <= -300.0 THEN 0.0
ELSE Column1 * 100.0
END
When I click on OK, and open the expression again, it puts brackets around the number: -(300). I have tried using Cast( ... as integer) around the Column1 attribute, and -300. I have also tried using expressions like (200 - 500) to replace the -300, but that doesnt work either.
Am I missing something? I can get this to work in Answers, but not in the Administration Tool. Thank you!
João Moreira

I forgot to mention, im using 10g.
I have tried with 300 * -1. It works if I use the Greater Than , but not with Less Than:
CASE
WHEN Column1 *100.0 >= 300.0 * (-1) THEN 0.0
ELSE Column1 * 100.0
END
Column1
0
0
0
0
CASE
WHEN Column1 *100.0 <= 300.0 * (-1) THEN 0.0
ELSE Column1 * 100.0
END
Column1
40
-30
-345 <-this should be zero
-400 <-this should be zero

Similar Messages

  • Expression Builder: convert string to number

    Hi all,
    I'm having trouble building a field validation rule for bank account numbers.
    The numbers have 12 positions, so I cannot use a string or text number.
    The validation rule to be implemented is that the last two digits are calculated based on the first 10 (modulo 97).
    However, when I use the Mid function to pick the first characters, I am unable to do any calculations on it. Apparently, the string to number conversion doesn't work (it should work when I read the manual, as it says that when using an operator between two data types, the second type is converted to the first (cf. example of 1234+abcd (should result in 1234 as to the manual))). So I tried '1*Mid(...)' or '0+Mid(...)'. Syntactically the expression builder accepts it and I can save it. BUT when I change the particular value on the screen, it gives me an SSO error (not the Field Validation error message I entered).
    Why isn't there simply a function ToNumber (like ToChar)????? How could I workaround this?
    Any input very welcome!
    Frederik

    Apparently, I was a bit confused when typing the first sentence, it should be:
    The numbers have 12 positions, so I cannot use an integer or number data type, but have to use String.

  • How do I disallow negative numbers in a selected group of cells (i.e. only allow values greater than or equal to zero)?

    I have a table of calculated values in Numbers, and I want to disallow negative numbers in the entire table. Any numbers that would be negative I would like changed to/displayed as zeroes, that way future calculations that may be based on this cell use the value of 0 for the calculation rather than the negative value. I have seen ways of doing this to single cells at a time, but I am interested in applying it to a large selection of cells.
    There is the Conditional Format option when you bring up the inspector, but I cannot get a custom rule to work for me. I select "Greater than or equal to" and I enter 0 in the box, but nothing changes. Can anyone help with this?
    Thanks

    A step toward simplifying the application of MAX to the issue, Jerry.
    This part, though:
    Now apply your long, animal-modeling, expressions to this new, interposing, table rather than the original.
    may still leave several references to be change from the original data table to the new one.
    One way to get around that is to use the Duplicate ("DATA-1) as the new table for raw data, and the Original (DATA) as the interposing table, using the formula =MAX(DATA-1::A2) as above, starting in DATA::A2.
    This way, the long expressions could continue to reference the original table (with its content now modified).
    ALTERNATE process:
    Find/Replace could also be used to speed the process of reassigning the modeling expressions to the duplicate table, as suggested by Jerry. But some cautions apply here.
    Find/Replace can be limited to Formulas only, but not to Some formulas only.
    Find/Replace can be limited to the Current Sheet only, but this can't be combined with Formulas only.
    More on this later, when I've had a chance to check some possibilities.
    Regards,
    Barry

  • Negative numbers in Parentheses() in Interactive Reports in Apex 4.1

    Hi,
    I want to display the negative numbers in parentheses() in all the interactive reports in my application eg: (367,432,203.07).
    I tried using the PR format "999G999G999G999G990D00PR" in my number/date format option in 'Column Definition'. But it gives the negative number '-367432203.06895' like this '<367,432,203.07>', which is not my exact requirement.
    Is there any other number format/option to get negative numbers in parentheses in my reports.
    Can anyone please help me on this?

    divya wrote:
    I want to display the negative numbers in parentheses() in all the interactive reports in my application eg: (367,432,203.07).
    I tried using the PR format "999G999G999G999G990D00PR" in my number/date format option in 'Column Definition'. But it gives the negative number '-367432203.06895' like this '<367,432,203.07>', which is not my exact requirement.
    Is there any other number format/option to get negative numbers in parentheses in my reports.No. In 4.1 the only way to do this that preserves IR sort/aggregation/calculation functionality is to manipulate the values using a Dynamic Action/JavaScript after the page is rendered. This is not really satisfactory.
    In 4.2 I think it might be possible using a lot of extra columns, HTML Expressions, and CSS.

  • Expression Builder OBIEE 11g

    Trying to calculate the percentage, but its giving me null values. Please tell me what's wrong.
    Expression was built using expression builder in the RPD.
    IFNull(("column" / "column"), 0)*100
    When the column numbers are the same, it gives 100% like it should....
    When the column numbers are different, it gives a 0 value.
    Edited by: JuMae on Sep 10, 2012 12:02 PM

    Hey,
    Sorry for the late response. No for some reason it didn't work. It's not a pressing requirement, but it's still looming over my head. I was told maybe I need to cast it, what do you think?

  • Logical shift negative numbers

    So, I think i have found a bug in Labview.  I am using Labview 8.5
    I have a very very simple Vi Where i want to Right shift a negative number.  For example:
    -16 >> 2 = -4
    What i get is 16380.  If I mismatch the data types.  Meaning I right shift from a 16 integar and place the result into a 8 bit integar I get -4.  
    It would appear that the function is padding with leading zeros and not ones when handling negative numbers.   
    Is this an issue that has been fixed already?  Or am i using the function incorrectly?
    Attachments:
    Logical Shift bug.vi ‏7 KB

    Gruntboy,
         What I think you're looking for is an arithmetic shift function, while the function in Labview is a logical shift.  The difference is in the leading bit of the result when they shift a number to the right.  A logical shift right pads the numbers with '0's and an arithmetic shift right pads the numbers with their copies of their most significant bit.  This is very important when dealing with signed numbers, because the most significant bit (in standard two's complement notation) denotes whether or not a number is negative. 
         The number four (4) represented in six bits would be: 000100, and in two's complement negative four (-4) would be 111100.
    A logical shift right, which pads the numbers with a '0' on the left would be:
    000100 --> 000010  (4 --> 2)
    111100 --> 011110  (-4 --> 30)
    An arithmetic shift right, which pads the numbers with whatever their most significant bit is would be: 
    000100 --> 000010  (4 --> 2)
    111100 --> 111110  (-4 --> -2) 
    I don't see  an arithmetic shift function in Labview, but you could build one by converting the number to an array of booleans and shifting to your heart's content.
    When operating on signed numbers Arithmetic shift operations tend to be more useful, but I'm sure there would be quite a bit of confusion if the unsigned number 60 ("111110") gets right shifted and becomes 127! ("111111").
    Finally, there is "one" (heh I'm so punny) special case for arithmetic shifting.  Consider how right shifting (logical and arithmetic) 8 results in 4, then 2, then 1, then 0.  What about arithmetic right shifting of -8?  The results would be -4, then -2, then -1...... then -1, then -1, then -1, etc. 
    Worthwhile resources:
    Two's compliment notation for negative binary numbers: http://en.wikipedia.org/wiki/Two's_complement
    Logical shift explanation (w/ pictures!): http://en.wikipedia.org/wiki/Logical_shift
    Arithmetic shift explanation (w/ pictures!): http://en.wikipedia.org/wiki/Arithmetic_shift
    I hope this helps!
    Hugs,
    memoryleak 
    P.S. I noticed that you mentioned you were modeling number operations of an ASIC.  This book (ISBN: 978-0534378042) was used in the Intro to Digital Logic class I took way too long ago, and I remember it hitting very hard on binary, signs and bit operations.  Looks like a used copy can be had on Amazon for less than $40 
    Message Edited by memoryleak on 10-09-2009 11:00 AM

  • 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

  • Is anyone having trouble using parenthesis to show negative numbers in excel after upgrading to Yosemite?

    Since upgrading to Yosemite, I can no longer reflect negative numbers with parenthesis using excel.  All of my existing spreadsheets also no longer show parenthesis, creating formatting problems.  Is anyone else experiencing this and is there a solution?

    I suggest you post your question to Microsofts own forums for their Mac software as it's their product you're having issues with
    http://answers.microsoft.com/en-us/mac

  • Logical SQL about Expression Builder

    Dear all
    I am Michel.
    When I was always trouble,
    everyone will go to support this Forum, I am glad.
    I want to fix Logical SQL about Expression Builder of Oracle BI 11.1.1.3.
    In detail, Business each year, fiscal year you want to make is to display
    the beginning of the fiscal year of April 1, always, the data,
    "OUTPUT_DATE" from April until March the following year.
    Currently being output error is as follows.
    :[nQSError: 22020] Function Subtring ( argument 1) does not support non-text types. (HY000)
    I want to fix logical SQL is as follows.
    case when substring("app_support"."TABLE_NAME"."OUTPUT_DATE" from 4 for 5)
    in ('04','05','06','07','08','09','10','11','12')
    then Cast
         Concat
    Substring(
                   Cast(
                        "app_support"."TABLE_NAME"."OUTPUT_DATE" AS char
              FROM 4 for 8
         '04-01'
    AS DATE
    when substring("app_support"."TABLE_NAME"."OUTPUT_DATE" from 4 for 5)
    in ('01','02','03')
    then timestampadd(SQL_TSI_YEAR,-1,
         Cast
         Concat
              Substring(
                   Cast(
                       "app_support"."TABLE_NAME"."OUTPUT_DATE" AS char
                   FROM 4 for 8
              '04-01'
    AS DATE
    For reference, logical SQL follows,
    there is no error, and it is operating normally.
    Cast
         Concat(
              Substring(
                   Cast(
                        "app_support"."TABLE_NAME"."OUTPUT_DATE" AS char
              FROM 0 for 5
         '-01')
    AS DATE
    I will grad to reply message.
    Thanks and regards.

    Dear Fame and all
    Hello.Thanks you for reply.
    Hi,
    You Missed END key word in the statement.Sorry,I mistake copy & paste only.
    So,The problem is still not resolved.
    The following shows, that the error has been corrected in the first message.
    Dear all
    I am Michel.
    When I was always trouble,
    everyone will go to support this Forum, I am glad.
    I want to fix Logical SQL about Expression Builder of Oracle BI 11.1.1.3.
    In detail, Business each year, fiscal year you want to make is to display
    the beginning of the fiscal year of April 1, always, the data,
    "OUTPUT_DATE" from April until March the following year.
    Currently being output error is as follows.
    :[nQSError: 22020] Function Subtring ( argument 1) does not support non-text types. (HY000)
    I want to fix logical SQL is as follows.
    case when substring("app_support"."TABLE_NAME"."OUTPUT_DATE" from 4 for 5)
    in ('04','05','06','07','08','09','10','11','12')
    then Cast
    Concat
    Substring(
    Cast(
    "app_support"."TABLE_NAME"."OUTPUT_DATE" AS char
    FROM 4 for 8
    '04-01'
    AS DATE
    when substring("app_support"."TABLE_NAME"."OUTPUT_DATE" from 4 for 5)
    in ('01','02','03')
    then timestampadd(SQL_TSI_YEAR,-1,
    Cast
    Concat
    Substring(
    Cast(
        "app_support"."TABLE_NAME"."OUTPUT_DATE" AS char
    FROM 4 for 8
    '04-01'
    AS DATE
    end
    For reference, logical SQL follows,
    there is no error, and it is operating normally.
    Cast
    Concat(
    Substring(
    Cast(
    "app_support"."TABLE_NAME"."OUTPUT_DATE" AS char
    FROM 0 for 5
    '-01')
    AS DATE
    I will grad to reply message.
    Thanks and regards.

  • Using Decode in Expression Builder...

    Hi everybody,
    I want to use the DECODE function of SQL in an Expression Builder....
    Of course this function does not exist in any of the transformation categories(arithmetic,character,e.t.c.) in the expression builder.
    I have read in the OWB on-line help that in the Expression Builder there should be an 'Others' drop - down list in order to select any of the available SQL clauses - one of them is 'decode'...
    The problem is that this drop - down list in the Expression Builder is disabled.....
    How can I use this function anyway..????
    Instead of using ... in the Expression Builder...
    decode(<column_name>,'1','val_one','2','val_two') what can I use to do the same....???
    As regards the problem that the drop-down list is disabled , what may be the cause..???
    I use Microsoft XP machine , Oracle 10g (v.10.2) and OWB v.10.1.0.4
    The documentation says....
    "This allows you to deploy the DECODE functionality in all operating modes (setbased, rowbased, etc.) and transparently across Oracle database releases (8.1, 9.0 and 9.2)."
    The above means that the cause is the incompatibility..????
    Thanks , a lot
    Simon

    I am using OWB 9.2.0.8 and I can't reproduce the problem you are having with 10.1, but did you try just typing it into the expression?
    Or, better yet, use CASE. The syntax is easier to read. I think OWB translates DECODEs to CASE when the SQL is generated.
    (Case <column_name>
       When '1' Then 'val_one'
       When '2' Then 'val_two'
    End)

  • How to use SQL OVER and PARTITION BY in OBIEE Expression Builder??

    Hi there,
    I want to create a new logical coulmn with the following SQL query.
    SUM(Inventory Detail.Qty) OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C,Inventory Detail.D,MyDATE )/SUM(Inventory Detail.Qty) OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C )
    How to use the OVER and PARTITION BY in OBIEE Expression Builder??
    Thanks in Advance

    hi bipin,
    We cant use by in Expression builder(rpd) .But use the same formula like this in Fx of answers
    SUM(Inventory Detail.Qty) OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C,Inventory Detail.D,MyDATE )/SUM(Inventory Detail.Qty) >OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C )SUM(Inventory Detail.Qty by Detail,ITEM,Mydate)/SUM(qty by detail,item)
    First check the numerator whether it was giving correct results or not then go with denominator
    compare the results with sql that u have
    Let me know if that does work
    thanks,
    saichand.v
    Edited by: Saichand Varanasi on Jul 27, 2010 9:27 PM
    Edited by: Saichand Varanasi on Jul 27, 2010 9:28 PM

  • Negative numbers in export to excel

    Hi,
    We have two servers, one (X) without SP1 and the other (Y) with SP1.
    When I make export to excel in X, the negative numbers sometimes saved as @ or the actual negative number (e.g. -42), in both cases it is saved as text.
    The positive numbers are saved as numbers.
    We saw that SAP fixed it in SP1, we tried it on Y, we got that the negative numbers always show (e.g. -42), but all the numbers, positive and negative are saved as text.
    We need to see all the actual numbers(without @), and to be saved as numbers (so we can make calculations on them).
    Does anyone have any idea?
    Thanks.

    I am on SP1 and noticed that sometimes they are saved as numbers and some are texts:
    So I am not sure of any logic or what is going on.
    Maybe as a work around you could format everything to numbers so you can do the calculation?

  • Checking for empty tags using expression builder for XPATH

    I am creating several filters in a mediator for several parallel paths. I am trying to route the mediator to the correct DB adapter based on what tags are empty in the incoming XML. The XML has 1 required tag and 3 optional. So for the expression, I am using the expression builder to load the tag name then putting either [text()] or [not(text())] immediately after each tag with an "and" in between for the 3 optional elements. The problem I am having is they always return false. For example, if I enter a value for an optional tag and put [text()] after it, it evaluates to false. What is the correct way to check if an element has text or not?
    Thanks in advance!

    Hi,
    Its not recognizing the getVariableData func... instead try this:
    string-length(xpath)>0
    ex: string-length($in.body/imp1:manoj/imp1:C1)>0
    It works... Happy deploying ... :)

  • How to use TRUNC function with dates in Expression Builder in OBIEE.

    Hi There,
    How to use TRUNC function with dates in Expression Builder in OBIEE.
    TRUNC (SYSDATE, 'MM') returns '07/01/2010' where sysdate is '07/15/2010' in SQL. I need to use the same thing in expression builder in BMM layer logical column.
    Thanks in advance

    use this instead:
    TIMESTAMPADD(SQL_TSI_DAY, ( DAYOFMONTH(CURRENT_DATE) * -1) + 1, CURRENT_DATE)

  • Using case statement in OWB expression builder

    Hi All,
    We are using OWB version 10.2.0.1.0. While using the below case statement We are getting the validation message as 'The expression is not properly formed'.
    Case statement used in expression builder:
    case when (INGRP1.CHARGETYPE in ('O','F') or INGRP1.TARIFF_GROUP in ('SMSINT','MMSINT')or ( INGRP1.CALL_TYPE = '002' and INGRP1.TARIFF_GROUP = 'MTV'))
    then
    (select call_zone_reltn_key from call_zone_reltn where
    call_zone_cd=substr(case
                   when substr( INGRP1.B_SUBNO,1,2)='00'
                   then
                   substr( INGRP1.B_SUBNO,3)
                   else substr( INGRP1.B_SUBNO,1)
                   end,1,length(call_zone_cd))and rownum=1)
    else -1
    end
    Kindly help me out in fixing this error or suggest any alternate way to use the above query in OWB expression builder.
    Thanks,
    Kabilan

    946887 wrote:
    Hi All,
    We are using OWB version 10.2.0.1.0. While using the below case statement We are getting the validation message as 'The expression is not properly formed'.
    Did you try to deploy the mapping ? Some time the expression validator gives wrong error messege.
    Try to deploy the mapping and see if you are still getting this issue
    Case statement used in expression builder:
    case when (INGRP1.CHARGETYPE in ('O','F') or INGRP1.TARIFF_GROUP in ('SMSINT','MMSINT')or ( INGRP1.CALL_TYPE = '002' and INGRP1.TARIFF_GROUP = 'MTV'))
    then
    (select call_zone_reltn_key from call_zone_reltn where
    call_zone_cd=substr(case
                   when substr( INGRP1.B_SUBNO,1,2)='00'
                   then
                   substr( INGRP1.B_SUBNO,3)
                   else substr( INGRP1.B_SUBNO,1)
                   end,1,length(call_zone_cd))and rownum=1)
    else -1
    end
    Kindly help me out in fixing this error or suggest any alternate way to use the above query in OWB expression builder.
    Thanks,
    Kabilan

Maybe you are looking for

  • Runtime Error in ALV Totaling.

    Dear Friends i am getting run time error in ALV while pressing sum button. my alv code as follows   FIELDCATALOG-FIELDNAME   = 'DMBTR'.   FIELDCATALOG-SELTEXT_M   = 'Amount'.   FIELDCATALOG-COL_POS     = 1. FIELDCATALOG-ref_fieldname = 'WAERS'. FIELD

  • Using Oracle Forms

    Ok I'm a beginner at this! I plan to use Oracle to create a medical data base for patients. However, This is the most complicated database I've seen and the best. So, how do I use create form for use on my personal computer first before trying to use

  • Auth against trsuted domain - 500 Internal Server Error Invalid index.(1413

    Hi all,         we are publishing a SAP portal via ISA 2006. <br /><br /> I have eventually managed to get single sign on working all the way through for company.local users, however we also have a domain where all our customer accounts sit - extcust

  • N85- keeps connecting itself to the Internet

    Hello! My phone (N85) keeps connecting itself to the internet every minute or so. This is driving me crazy cause I don't have a data plan. So I had to check my phone every minute and disconnected the Internet. Now I'm back home and it keeps connectin

  • Where to get WAS ABAP+J2EE 6.0

    Hi      In the installation guide for XI its written that the pre requisite for XI 3.0 installation is one should have WAS ABAP_J2EE 6.40 installation. Where should I get this software to download. It is possible to use WAS 6.40 J2EE (MAXDB one) only