Showing Postive Values as negative and negative values as negative itself

Hi Experts,
I want to bring using a formula the value in negative always how this can be done pls advise.
For example
{Field 1 - Field 2 } e.g - = 1 here the value 1 is coming as postive and sometimes the same
{Field 1 - Field 2 } e.g - = -2 here the value -2 is coming as negative
Now I want that there should be some formula that in the above scenerio the Positives are made as negative and negative values stays as negative only.
Please advise how this can be achieved.
Regards,
Venky

Hi Venky, 
You can add to your formula like: 
If {Field 1 - Field 2 } > 0 Then
    ({Field 1 - Field 2 }) * -1
Else {Field 1 - Field 2 };

Similar Messages

  • Negative  values in red and Positive values in black CONDITIONAL FORMATTING

    Hi ... Everyone
    I have to show Negative values in red and Positive values in black in one of my report.
    i tried these conditions
    1. <?if:GAIN<0.00?><?attribute@inlines:color;'red'?><?end if?>
    but it shows negative values only in red ,positive values in black are missing
    2. <?if:GAIN<0.00?><?attribute@incontext:color;'red'?><?end if?><?if:GAIN>0.00?><?attribute@incontext:color;'black'?><?end if?>
    This gives the exact result what i wanted ...but the problem is i have five tables in my report ... so the above condition only allow changes in ONE TABLE ONLY. :(
    Plzzzz anyone who can help me to sort out my problem or else SUGGEST ANOTHER WORKING CONDITION
    Regards
    Subham Mittal

    Subham,
    This should not be difficult and moreover the BI Publisher Desktop installation comes with a set of examples:
    Start -> Programs -> BI Publisher Desktop -> Samples -> RTF Templates -> Advanced -> Conditional
    There you can find two templates with the exact same situation like yours, highlighting either the foreground color or background color.
    regards
    Jorge

  • Wat should be data type for  negative and decimal values (eg: -1.2222)

    What should be data type for  negative and decimal values (eg: -1.2222)

    Hi
    U can use the data type DEC while creating the DOMAIN and in the domain u  have sign check box at the left corner of the screen, click that check box , u can assign negative values for the field which refers this domain.
    REWARD IF HELPFULL
    Anees.

  • BEx Analyzer - Aggregation of Negative and Positive Values

    Hello Gurus,
    I have a key figure 0Subtotal1. This KF contains both negative and positive figures.
    For eg; +10, -20, -30.
    In Query Analyzer, I need the column total as 60 and not
    -40.
    Can I use a formula and use the ABS function...
    Any clue....
    thanks in advance.

    hi BW,
    u can make -ve sign as positive in the query.
    Go to query properties in the query designer, then click on display tab->there u will find in the number format block settings for the display of -ve numbers....u can change them to positive there...
    reward if it helps,
    ajay

  • StackedBarChart stacked bar corrupted when add negative and positive value.

    When StackedBarChart series have (positive & negative) data stacked bar corrupted and loss data.
    I have a chart with data stacked on (-,+)Y-Axis.
    - With JfreeChart all this go rigth and data appear perfectly on each bar without loss.
    - But when using javafx StackedBar Chart , when bar series have (positive & negative) data stacked bar corrupted and loss data.
    Stackoverflow link : http://stackoverflow.com/questions/15410153/javafx-stackedbar-chart-issue .

    As stated in your StackOverflow post, you should file this as a bug on Jira.
    But I'd also point out that stacked bar charts with negative values are not a good idea. In a stacked bar chart, the highest point of the stack should represent the total of the individual bars. You lose this property if there are negative values, and the chart becomes misleading. (I'd bet that the cause of the bug is that the code assumes this property at some point.)

  • Validation of JTextField to accept negative and positive values

    Hi,
    I have a question. I have a jTable populated with the fieldname
    in the first column and datatype in the second column.
    I would like to place a JTextField component in the frame
    depending on the data type. So, if a row is selected in the table, the
    datatype of that fieldname is retrieved and depending on that data type
    I want a JTextField to be displayed.
    Now, if the data type is of Integer type, I want the JTextfield to
    accepts Integers only(positive). I have created a class that extends JTextfield.
    But, I want the text field to accept negative integers also. Can anyone please guide me ?

    Hi,
    I wrote an extension of JTable that provides better rendering and editing support for:
    Color
    Font
    Locale
    Integer
    int
    Long
    long
    Short
    short
    Byte
    byte
    BigInteger
    Double
    double
    Float
    float
    BigDecimal
    and some more
    To allow only positive values for the type integer you could use:
    JXTable myTable = new JXTable(...);
    myTable.setDefaultEditor(Integer.class, new IntegerCellEditor(0, Integer.MAX_VALUE, <some locale>));The number editors are based on JFormattedTextField.
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JXTable.html
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/IntegerCellEditor.html
    Homepage:
    http://www.softsmithy.org
    Download:
    http://sourceforge.net/project/showfiles.php?group_id=64833
    Source:
    http://sourceforge.net/cvs/?group_id=64833
    For more information about the number fields have a look at he following thread:
    http://forum.java.sun.com/thread.jspa?threadID=718662
    -Puce

  • Null value of fax and Null value of email is not reflecting in SRM

    Hi
    If you change the Vendor fax and email to null value in SAP(transaction XK02 in communication for address) and replicate the vendor in SRM 5.0 with transaction BBPUPDVD, still in manage business partners BBPMAININT as vendor I am able to see old fax number and email id  instead of null value in Contact for Business Partner area.
    Where as if we change vendor fax and email to new fax and email , after replication we wre able to see new fax and email id in manage business partners transaction as vendor.
    Regards
    Dayal

    solved!

  • How to import values from txt and pass values to variables

    I need to export some variables from Indesign and import them in Illustrator.  I can export a txt file from InDesign but I don't know how to import and pass the values to variables in Illustrator.
    Can someone help?

    Well from you ID script Im presuming that you are simply writing a few lines of info to a plain text file like so…
    writeFile('SomeData');
    writeFile('AnotherData');
    writeFile('LastData');
    function writeFile(info) {
         try     {
              var log = File('~/Desktop/ID_Data.txt');
              log.open('a');
              log.write(info + '\r');
              log.close()
         catch (e) {
              alert(e);
    So you would just read this back where or when ever you need to use it in your Illustrator script…
    var log = File('~/Desktop/ID_Data.txt');
    log.open('r');
    var a = log.readln();
    var b = log.readln();
    var c = log.readln();
    log.close();
    alert(a);

  • GeoRaster querying returns negative and invalid cell coordinates

    Hi!
    I'm using Oracle 10.2.0.1 and loading raster data into GeoRaster - loading all works but when querying cell coordinates I get negative and unexpected values. Here is my process:
    -- Create GeoRaster table
    DROP TABLE tm;
    CREATE TABLE tm (id NUMBER, description VARCHAR2(50), image SDO_GEORASTER);
    -- Create trigger to keep metadata up to date
    EXECUTE sdo_geor_utl.createDMLTrigger('TM', 'IMAGE');
    -- Create raster data table
    DROP TABLE tm_rdt;
    CREATE TABLE tm_rdt OF SDO_RASTER
    (PRIMARY KEY (rasterID, pyramidLevel, bandBlockNumber, rowBlockNumber, columnBlockNumber))
    TABLESPACE tbsp
    NOLOGGING LOB(rasterBlock)
    STORE AS lobseg (TABLESPACE tbsp CHUNK 8192 CACHE READS NOLOGGING PCTVERSION 0 );
    -- Grant privs on file locations
    exec dbms_java.grant_permission( 'PUBLIC', 'SYS:java.io.FilePermission', 'D:\Users\tm.tif','read,write' );
    exec dbms_java.grant_permission( 'TEST', 'SYS:java.io.FilePermission', 'D:\Users\tm.tif','read,write' );
    exec dbms_java.grant_permission( 'MDSYS', 'SYS:java.io.FilePermission', 'D:\Users\tm.tif','read,write' );
    exec dbms_java.grant_permission( 'PUBLIC', 'SYS:java.io.FilePermission', 'D:\Users\tm.tfw','read,write' );
    exec dbms_java.grant_permission( 'TEST', 'SYS:java.io.FilePermission', 'D:\Users\tm.tfw','read,write' );
    exec dbms_java.grant_permission( 'MDSYS', 'SYS:java.io.FilePermission', 'D:\Users\tm.tfw','read,write' );
    -- Initialise GeoRaster object and import image
    DECLARE
    l_gr SDO_GEORASTER;
    BEGIN      
    -- Initialise GeoRaster objects
    INSERT INTO tm (id, description, image)
    VALUES (1, 'TM', sdo_geor.init('TM_RDT'));
    -- Import the images
    SELECT image INTO l_gr FROM tm WHERE id = 1 FOR UPDATE;
    SDO_GEOR.IMPORTFROM(l_gr, 'spatialExtent=true', 'TIFF', 'file', 'D:\Users\tm.tif', 'WORLDFILE', 'file', 'D:\Users\tm.tfw,3035');
    UPDATE tm SET image = l_gr WHERE id = 1;
    COMMIT;
    END;
    DECLARE
    gr sdo_georaster;
    BEGIN
    SELECT image INTO gr FROM tm WHERE id = 1 FOR UPDATE;
    sdo_geor.setModelSRID(gr, 3035);
    gr.spatialExtent := sdo_geor.generateSpatialExtent(gr);
    UPDATE tm SET image = gr WHERE id = 1;
    COMMIT;
    END;
    The raster file was originally a .MAP file which I converted to a .TIF file via ArcCatalog 9.2.
    I created a World File whose contents are:
    5000
    0
    0
    -5000
    -1697500
    2697500
    The .MAP file and .TIF file have the following Spatial Reference (Oracle SID 3035):
    PROJCS["PCS_Lambert_Azimuthal_Equal_Area",GEOGCS["GCS_User_Defined",DATUM["D_User_Defined",SPHEROID["User_Defined_Spheroid",6378388.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",9.0],PARAMETER["Latitude_Of_Origin",48.0],UNIT["Meter",1.0]
    In the Raster file:
    Columns, Rows = 680, 810
    Number of Bands = 1
    Cellsize = 5000,5000
    Extent Top = 2700000
    Extent Left = -1700000
    Extent Right = 1700000
    Extent Bottom = -1350000
    Origin Location = Upper Left
    So, loaded the raster into Oracle all ok; but when I try and find the cell coord for a real-world coord in WGS84 (location of a point in Iceland), it returns invalid cell coords:
    SELECT     sdo_geor.getCellCoordinate(t.image, 0, SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-19.4833, 64.6833, 0), NULL, NULL))
    FROM      tm t;
    Returns: SDO_NUMBER_ARRAY(-443, 930) which isn't a true cell coord in my raster??
    Also, if I test out to get the corners of the raster:
    SELECT sdo_geor.getCellCoordinate(image, 0, sdo_geometry(2001, 3035, sdo_point_type(1700000,2700000,null), null,null)) FROM tm WHERE id=1;
    Should return the top right corner at (680,0), it actually returns: SDO_NUMBER_ARRAY(0, 680) - the other way round?!?!
    I'm slowing going mad on this, so any ideas/thoughts would be greatly appreciated!!!

    Hi,
    I just did some test. The results you got actually was right. The point (-19.4833, 64.6833, 0) you give is in 8307. After it is transformed into coordinate system 3035, the system your georaster in. We get the model coordinates (2954416.89, 4914665.16, 0). The model coordinate of your up-left corner cell of your georaster is (-1697500, 2697500), so the cell coordinates of the give point is col = int((2954416.89 - (-1697500))/5000) = int(930.38) = 930, and row = int((4914665.16 - 2697500)/(-5000)) = int(-443.43) = -430. That is what you got. The point you give is outside of your georaster on the top.
    SQL> select sdo_cs.transform(
    sdo_geometry(2001, 8307, SDO_POINT_TYPE(-19.4833, 64.6833, 0), null,null),
    3035) from dual; 2 3
    SDO_CS.TRANSFORM(SDO_GEOMETRY(2001,8307,SDO_POINT_TYPE(-19.4833,64.6833,0),NULL,
    SDO_GEOMETRY(2001, 3035, SDO_POINT_TYPE(2954416.89, 4914665.16, 0), NULL, NULL)
    For point (1700000,2700000,null), it is at the top-right corner. Its cell coordinates should be (0,680). Be noticed, the cell coordinates has order of ROW, COLUMN.
    Please let me know if you have further question.

  • Query Designer in BI - How to cumulate value and get the Max and Min value.

    I want to create a report with  query designe of BI 7r. is it possible. the data from the cube will be
    Year ,           Exposed Quantity
    1999 ,             200
    2000 ,            100
    2001 ,            -100
    2002 ,             300
    2003 ,           - 200
    2004 ,             100
    2005 ,            -200
    Calculation should be - Refer the cumulative value field
    Year  ,          Exposure Quantity ,   Cumulative value
    1999  ,            200   ,                             200
    2000  ,            100  ,                              300
    2001  ,           -100 ,                               200
    2002  ,            300  ,                              500
    2003  ,          - 200  ,                              300
    2004  ,            100  ,                              400
    2005  ,           -200  ,                              -200
    An the out put of the report  should be Max value ie 500 and Min Value -200.
    My question is that is it possible to do in the front end ie in the Query Designer (BI 7) If so how.
    Edited by: Parakadavil Chacko Mathew on Oct 8, 2009 3:52 AM

    Hi there,
    Create 4 column,
    1st will show regular values for the key figure,
    2nd will show Cumulative value, in Query Designer, Just right click on the this 2nd key figure properties, calculation tab there you can check on Cumulated option, and define the calculation direction as Calculate along the Column.
    3rd will show Minimum value , Just right click on the this 2nd key figure properties, calculation tab calculate single valuea as minimum.
    4th will show Minimum value , Just right click on the this 2nd key figure properties, calculation tab calculate single valuea as Maximum.
    Regards,
    Rajdeep Rane.

  • Can we zoom and use value pairs for the axis?

    Hi!
    I am utilizing visual C++ 6.0 and Component works for my current project where we are displaying some electrical faults on the CWGraph class in log scale. The X Axis is in duration format, i.e. ms, sec, min, day etc. and I am utilizing value pairs to properly display the labels values in the X axis. I set the major and minor unit interval values to zero and added value pairs for the X axis values 1 ms, 10ms, 100 ms ...1 day, etc. ( I looked at the answers to the previously posted questions for this!!). Hence I can show the values in log scale for the x axis succesfully. However, after adding the value paires, the two axis zoom option, track mode = ZoomrectXY doesnot work and I cannot zoom when I display the graph. If t
    he value pairs are removed and use normal scaling, the zooming comes back. Is there a workaround to this problem.
    I would greatly appreciate your help!!
    Asaf

    Bilal,
    Since I am using my custom x axis labels as value pairs, I need to check the auto-scaling false, otherwise the log values for the x axis and value pair labels mix and do not look good on the graph. Below are the settings I used for graph:
    Axes->X Axis->Scale Style->Auto Scale: Unchecked
    Axes->X Axis->Scale Style->Minimum : 0
    Axes->X Axis->Scale Style->Maximum : 1e+009
    Axes->X Axis->Scale Style->Log : Checked
    Axes->X Axis->Scale Style->Inverted : Unchecked
    Axes->Y Axis->Scale Style->Auto Scale: Checked
    Axes->Y Axis->Scale Style->Log : Unchecked
    Axes->Y Axis->Scale Style->Inverted : Checked
    Ticks->X Axis->Tick Spacing->Major : 0
    Ticks->X Axis->Tick Spacing->Minor : 0
    Ticks->X Axis->Tick Spacing->Base : 0 ( All grayed out)
    Ticks
    ->Y Axis->Tick Spacing : Automatic
    The other settings are assigned default values.
    Hence, as I mentioned before the X Axis values are assigned as 1 sec, 10 sec, 1min, 10 min, 1 h ..etc.
    and all on log scale. I need to utilize value pairs for this I think. Since I do not want the auto scale values, I uncheck it. You mentioned by unchecking auto scale, one will not be able to zoom. If so, is there another approach to display the graph as I want and zoom at the same time?
    Thanks,
    Asaf

  • Min and MAx Value in a SELECT Statement

    Hi,
    I have a scenario where I am Selecting the values BETWEEN MIN and MAX values:
    SELECT * FROM ABC WHERE CODE BETWEEN MIN(CODE) AND MAX(CODE)
    ITS GETTING Error as:ORA-00934: group function is not allowed here
    Any help will be needful for me.

    select substr(no,1,3)||to_char(substr(no,4,1)+1) "first missing number"
    from
    with t as
    (select 'ABC1' no from dual
    union select 'ABC2' from dual
    union select 'ABC3' from dual
    union select 'ABC5' from dual
    union select 'ABC6' from dual
    union select 'ABC8' from dual
    select no, lead(no,1,0) over (order by no) next_no from t
    where substr(next_no,4,1) - substr(no,4,1) > 1
    and rownum = 1;

  • How to know that a method has been called and returning value of a method

    Hi, everyone! I have two questions. One is about making judgment about whether a method has been called or not; another one is about how to return "String value+newline character+String value" with a return statement.
    Here are the two original problems that I tried to solve.
    Write a class definition of a class named 'Value' with the following:
    a boolean instance variable named 'modified', initialized to false
    an integer instance variable named 'val'
    a constructor accepting a single paramter whose value is assigned to the instance variable 'val'
    a method 'getVal' that returns the current value of the instance variable 'val'
    a method 'setVal' that accepts a single parameter, assigns its value to 'val', and sets the 'modified' instance variable to true, and
    a boolean method, 'wasModified' that returns true if setVal was ever called.
    And I wrote my code this way:
    public class Value
    boolean modified=false;
    int val;
    public Value(int x)
    {val=x;}
      public int getVal()
      {return val;}
       public void setVal(int y)
        val = y;
        modified = true;
         public boolean wasModified()
          if(val==y&&modified==true)
          return true;
    }I tried to let the "wasModified" method know that the "setVal" has been called by writing:
    if(val==y&&modified==true)
    or
    if(x.setVal(y))
    I supposed that only when the "setVal" is called, the "modified" variable will be true(it's false by default) and val=y, don't either of this two conditions can prove that the method "setVal" has been called?
    I also have some questions about the feedback I got
    class Value is public, should be declared in a file named Value.java
    public class Value
    cannot find symbol
    symbol  : variable y
    location: class Value
    if(val==y&&modified==true)
    *^*
    *2 errors*
    I gave the class a name Value, doesn't that mean the class has been declared in a file named Value.java*?
    I have declared the variable y, why the compiler cann't find it? is it because y has been out of scale?
    The other problem is:
    Write a class named  Book containing:
    Two instance variables named  title and  author of type String.
    A constructor that accepts two String parameters. The value of the first is used to initialize the value of  title and the value of the second is used to initialize  author .
    A method named  toString that accepts no parameters.  toString returns a String consisting of the value of  title , followed by a newline character, followed by the value of  author .
    And this is my response:
    public class Book
    String title;
    String author;
      public Book(String x, String y)
       { title=x; author=y; }
       public String toString()
       {return title;
        return author;
    }I want to know that is it ok to have two return statements in a single method? Because when I add the return author; to the method toString, the compiler returns a complain which says it's an unreachable statement.
    Thank you very much!

    Lets take this slow and easy. First of all, you need to learn how to format your code for readability. Read and take to heart
    {color:0000ff}http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html{color}
    Now as to your first exercise, most of it is OK but not this:   public boolean wasModified()
          if (val == y && modified == true)
                return true;
    y being a parmeter to the setValue method exists only within the scope of that method. And why would you want to test that anyways? If modified evaluates to true, that's all you need to know that the value has been modified. So you could have   public boolean wasModified()
          if (modified == true)
                return true;
       }But even that is unnecessarily verbose, as the if condition evaluates to true, and the same is returned. So in the final analysis, all you need is   public boolean wasModified()
          return modified;
       }And a public class has to be declared in a file named for the class, yes.
    As for your second assignment, NO you cannot "return" two variables fom a method. return means just that: when the return statement is encountered, control returns to the calling routine. That's why the compiler is complaining that the statement following the (first) return statement is unreachable.
    Do you know how to string Strings together? (it's called concatenation.) And how to represent a newline in a String literal?
    db

  • Wrong Month Ago and QTD values

    Hello all!
    I am using OBIEE 10.1.3.4 on Windows XP Professional SP3 with Oracle 10g. I have two fact tables (Sales, Bookings) and three dimension (Time, Geography, Product) in my schema. I used Time series functions to find Month Ago and quarter to date values for Bookings and Opportunity values. However only some values matches with previous month in Month Ago column and some do not. A snapshot is attached
    !http://i50.tinypic.com/2dioxn6.jpg!
    Similarly, QTD is not working
    !http://i47.tinypic.com/2hevs6w.jpg!
    Any ideas on this one?
    Thanks.

    hi,
    try one last thing....
    i will give you 2 choises...
    so,
    you made a bussines column with the ago function.ok?ok.make an other one,which leads the previus one the "ago" column.meaning you will have 2 columns....try your measures with the new one...
    the other solution is with msum...try this code...
    you have let;s say 3 columns.
    1=month=moth_clm
    2=your value one=measure
    3=has the code below=mesaure_ago
    case when month_vlm = '2009/01' then 0 else ("measure"- (MSUM ("measure",2) )) end
    this code returns the value from the previus record....
    so you will have
    month_clm----measure-----measure_ago
    2009/01-------10000000-----0000000000
    2009/02--------20000000-----10000000
    2009/03--------549290--------200000000
    hope i helped...
    http://greekoraclebi.blogspot.com/

  • OSB 11g: Conditional Branch value will not accept string Value

    OSB 11g 11.1.1.3.0 (OSB11_MAIN_GENERIC_100418.1323885)
    When I edit a message flow and create a conditional branch I:
    1. Enter an Xpath expression
    2. Name the variable containing the XPath expression
    3. Select an operator (=)
    4. Enter a string value for Value: 'true'
    5. Give the label a name (isMember)
    6. Save my work
    7. When I go back into the branch the 'true' value is gone and the Value field is blank.
    If I enter a number it saves fine - only when I enter text with single quotes
    is this a known bug?

    Thank you, however I still think this is a bug because:
    1. Version 10g training materials has this example as a lab exercise and says in particular 'make sure to place single quotes around the text string: 'true')
    2. The documentation for 11g says to enter a value but does not say it cannot be a 'string'
    3. If I don't enter any value for the value field, when I click Save it indicates an error -the field cannot be empty. When I place a numeric in the field(unquoted) I can save it and return to it and the numeric value is still there. If I enter a 'quoted string' I can save it but when I return to it, it is gone
    4. If I enter the same information using the eclipse IDE I can see the 'quoted string' is saved and when I view it (not edit but view) in the web IDE (sbconsole) I can see the 'quoted string'. If I edit it the string disappears.
    I will continue to test. While you may be correct and the intent is to accept only numerics, that does not make sense to me. Why not allow simple and fast conditional branching based on text string values in a message? I know I can use other mechanisms to achieve the same goal: a routing table would work also.
    My point was the behavior of the UI implies a bug.
    Edited by: jo**** on Nov 21, 2010 8:44 AM

Maybe you are looking for