Simple calculations of two columns (addition, subtraction, ...)

Hi,
I'm a job starter and working with Oralce Discoverer 10gR2 for the first time. I want to create a simple report. So I imported a view that looks like this:
create or replace view v_report_inventories_bc_group as
select a.the_date,
a.entity,
sum(a.histor_statutory_value) as histor_statutory_value
from t_r2_facts a
group by a.entity, a.the_date
now I've generated a cross tab that looks like this:
31.12.07 31.01.08 29.02.08 31.03.08
group 100 200 300 400
company1 70 150 200 300
company2 30 50 100 100
The problem is to show the simple difference between the last to months. Furthermore there are other calculations...
How should I achieve this?
Any advice would be very appreciate!
Regards,
Steffen

Hi,
If I'm understanding your question correctly...
When you brought this view into the Admin Edition it should have asked you if you wanted to use the Default Date Hierarchy. Assuming you did there should be a value called the_date Month under the items in this folder within Desktop/Plus. You would want to add that item in to the top portion of your crosstab and it will then break out the data by month.
To Subtract Column A from Column B you would create a calculation. The below link has a section called "How to create calculations" which should be of assistance.
Thanks,
Jeff
http://download.oracle.com/docs/html/B13915_04/calculations.htm#i1012748
Message was edited by:
Jeff Hohman

Similar Messages

  • Calculation on two columns in pivot table

    Hello all,
    I have a view:
    Dept Year Amount
    Accounting $500 2010
    Accounting $700 2011
    Engineering $100 2010
    Engineering $600 2011
    and etc
    pivot table:(data displayed side by side)
    Dept: 2010 2011
    Accounting $500 $700
    Engineering $100 $600
    Is there a way in pivot table to create additional column and do a calculation on that column? New column called 'Change' (actual calculation amount of 2010 minus amount of 2011 per each department). I see the feature which allows to duplicate the columns in pivot table. But this is it... no additional calculations.
    Thank you in advance,
    Sonya

    Deepak,
    My "YEAR_NO' is already in the column area. Once I created 'calculated column' and entered formula '2011'-'2010' I got what I needed.
    Thank you very much for the solution.
    Sonya
    In my view I also have column called EXPENSE. When, I added the 'calculated column' to 'YEAR_NO' with formula '2011'-'2010'. It created two calculated columns 1) after the EXPENSES and the other one after YEAR_NO. Is there a way to be specify to display the DIFFERENCE only once after the YEAR_NO??
    Edited by: user8461308 on Dec 20, 2011 7:44 AM

  • Results row calculation between two column result  in BEx Report.

    I want to use weighted average method between two keyfigure.
    for example consider the following secnario.
    CH        Kf1       Kf2
    A         10        5
    B          6        4
    C          3        2
    Result     19     b]4.21</b>
    how 4.21 is ((105)+(64)+(3*2))/total of Kf1(ie 19)
    ( A value(Kf1Kf2)+ B value (Kf1Kf2) + C Value (Kf1*Kf2))/total value (Kf1) = 4.21
    is it possible to achieve the above result for Kf2.
    With regards,
    Hari

    Hello,
    I cannot able to use Excel Macro functionality since it is a drill down report and report cells varies based upon the selection parameter.
    and also i can't  able to use Calculation, since this report contains lot of columns and if i use  the formula, one more result column i have to include in all key figures and also business users not able to understand the report....
    Is it possible to create a variable structure, for example user is executing for 10 days , the structure should display for only 10 days ans also i create structure for 31 days (ie one month)..
    With regards,
    Hari

  • Simple Calculations in BPS Web

    Hi,
    I am using the BPS web layouts (ALV Grid not the Excel Web Component). I would like to add a couple of very simple calculations (difference of columns/percentages etc). Is it possible to do this without using the Excel OWC ?
    Thanks
    Shailesh

    Hi
    the simplier way to achieve yor result is to use FOx formula to calculate your results at runtime .
    You should create a formula function and add FOX code to it .
    Check this link for examples
    http://help.sap.com/saphelp_nw04/helpdata/en/d3/8057f830a911d4b2be0050dadfb23f/frameset.htm
    Hope it helps
    Andr

  • Simple Addition/Subtraction in Manual Planning

    Hi Friends
    I want to know if we can do simple calculations as Addition or Subtraction dynamically in our Manual Layout (without creating a new Key figure and adding it into my transaction Cube)
    eg. I have Fields A and Field B in my Manual Layout and a want to display Field C (A-B) , which is the difference of A and B also in my Manual Layout.
    Pleaze reply asap
    Rishi

    Hi,
    in your query you can add a formula which returns A-B. Then user can see this in the planquery and you don't need to define a key figure for this. If you want to have this for many queries, you can created it once as a calculated key figure and add it in all your queries.
    regards
    D

  • How to do addition of two columns cells in Matrix.

    Hi All,
    I tried following code on LostFocus event of Mtrix. I want to do addition of two columns cells of matrix and addtion display in third column. I tried the following code but in this I am getting the column value and when i enterd any value in columns cells it disappear when i move to next column cells.
    Can anybody suggest me how to do it ?
    Dim i As Integer
                Dim v1, v2 As String
                matrix.Columns.Item("V_4").DataBind.SetBound(True, "", "matrixds")
                If pVal.ColUID = "V_4" Then
                    For i = 0 To matrix.RowCount - 1
                        v1 = matrix.Columns.Item("V_5").Cells.Item(i + 1).Specific.Value
                        v2 = matrix.Columns.Item("V_4").Cells.Item(i + 1).Specific.Value
                        Dim v3 As Integer = CInt(v1) + CInt(v2)
                        matrix.Columns.Item("V_3").Cells.Item(i + 1).Specific.Value = v3.ToString()
                    Next
                End If
    Thanks and Regards,

    Hi,
    u bind all the columns to the datasource in the matrix.then the value does not disappear.
    Change ur code as follows:
    Use the databind in formload
    matrix.Columns.Item("V_4").DataBind.SetBound(True, "", "matrixds1")
    matrix.Columns.Item("V_5").DataBind.SetBound(True, "", "matrixds2")
    matrix.Columns.Item("V_3").DataBind.SetBound(True, "", "matrixds3")
    Dim v1, v2 As sapbouicom.edittext
    If pVal.ColUID = "V_4" Then
    v1 = matrix.Columns.Item("V_5").Cells.Item(pVal.row).Specific
    v2 = matrix.Columns.Item("V_4").Cells.Item(pVal.row).Specific
    v3=  matrix.Columns.Item("V_3").Cells.Item(pVal.row).Specific
    v3.Value = v1 .Value + v2.Value
    End If
    Kind Regards
    Mohana

  • Simple calculator for viewing in cmd

    i am taking my first programming class and have started to feel overwhelmed. this is my assignment:
    To write a program that lets a user do simple math operations on two numbers
    ? To demonstrate using decision logic in a Java program.
    ? To become aware of error conditions when writing a program
    ? To continuing practicing working with two files in a Java program, one Java class
    and a tester
    Programming Requirements
    1. Get user input for the users? name and two integer numbers.
    2. Get the user input for a choice of math operation: addition, subtraction,
    multiplication.
    3. Output the user?s name and the result of the math operation on the two numbers
    that were input by the user.
    Output: The output should look similar to the following:
    What is your name?
    Java
    Enter a number:
    7
    Enter another number:
    3
    Choose a math operation: (A) addition, (S) subtraction, (M)
    multiplication
    M
    Hello Java! 7 * 3 = 21
    all i have so far is:
    * Calculator.java
    * Modified on July 14, 2008
    * This class has a method that accepts input from a user about their name, 2 integers, and mathematical
    * operation. it then calculates answer and outputs information to screen
    import java.util.Scanner; // This import is so that I can have access to the Scanner code.
    * @author sandra
    /** Creates a new instance of Calculator */
    public Calculator() {
    * @param args the command line arguments
    public static void main(String[] args) {
    //I am creating an object of type Scanner to help me get input from the user.
    Scanner inputScanner = new Scanner(System.in);
         // value for variables are listed below
    int firstNumber = 0; // initialize input to 0
    int secondNumber = 0:
    String inputName = "Doe"; //assigns an initial value for the string value inputName
    System.out.println("What is your name?");
    inputName = inputScanner.nextLine(); //Stores user input for later use
    System.out.println("Enter a number");
    int firstNumber = inputScanner.nextInt();
    myScanner.nextLine(); // Reading the return character from the previous integer input to get around bug...
    System.out.println("Enter another number");
    int secondNumber = inputScanner.nextIt();
    myScanner.nextLine(); // Reading the return character from the previous integer input to get around bug...
    System.out.println("Choose a math operation:");
    System.out.println("(1) Addition");
    System.out.println("(2) Subtraction");
    System.out.println("(3) Multiplication");
    // Store the user's response as an integer
    int operation = myScanner.nextInt();
    myScanner.nextLine(); // Reading the return character from the previous integer input to get around bug...
    if (operation == 1 )
    i know i'm probably on the wrong track. the if/else statements are frying my brain. PLEASE help. thanks

    Looks like you are on the right track to me. I give a little hint.
    if(....) {
        // what should you do if user enters 1?
    } else if(....) {
        // what should you do if user enters 2?
    } else if(....) {
        // what should you do if user enters 3?
    } else {
        // what should you do if user enters 42?
    System.out.println(....);Just work out what the dots are.

  • Using Auto Adjustable Fluid Grid Layout Divs to balance two columns

    I have a header band, two columns and then a footer band in the layout that I'm working on.I have Div on each side that is set to "Auto" for height so that the two column lengths appear to be the same size when they get to the footer band. That is how I envisioned it, in practice, "Auto" only seems to adjust to the text inside the respective divs.
    Something that"hould" be soesy has gotten me banging my head for four days. I thught I had a solution, using "nesting tags" but saw that was not supported.
    Any ideas?

    http://whatwouldwaltdo.businesscatalyst.com/fl0916.html
    Source code:
    <!doctype html>
    <!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
    <!--[if IE 7]>    <html class="ie7 oldie"> <![endif]-->
    <!--[if IE 8]>    <html class="ie8 oldie"> <![endif]-->
    <!--[if gt IE 8]><!-->
    <html class="">
    <!--<![endif]-->
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Untitled Document</title>
    <link href="boilerplate.css" rel="stylesheet" type="text/css">
    <link href="/FL916.css" rel="stylesheet" type="text/css">
    <link href="/stylesheets/FL.css" rel="stylesheet" type="text/css">
    <link href="/SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css">
    <!--
    To learn more about the conditional comments around the html tags at the top of the file:
    paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
    Do the following if you're using your customized build of modernizr (http://www.modernizr.com/):
    * insert the link to your js here
    * remove the link below to the html5shiv
    * add the "no-js" class to the html tags at the top
    * you can also remove the link to respond.min.js if you included the MQ Polyfill in your modernizr build
    -->
    <!--[if lt IE 9]>
    <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <script src="respond.min.js"></script>
    <script src="/SpryAssets/SpryAccordion.js" type="text/javascript"></script>
    </head>
    <body>
    <div class="gridContainer clearfix">
      <div id="bannertop"><img src="/images/Walt w CMS PIN.fw.png" alt="Walt Disney with Disneyland Cast Members (1966)"></div>
      <div id="ticker">This is the content for Layout Div Tag "ticker"</div>
    <div id="blocker">
      <div id="leftcolumn">This is the content for Layout Div Tag "leftcolumn"
          <div id="Accordion1" class="Accordion" tabindex="0">
            <div class="AccordionPanel">
              <div class="AccordionPanelTab">HOME</div>
              <div class="AccordionPanelContent">
              <img src="/images/graphics/pagetitles/toallwhocome.gif" alt="The opening line of Walt Disney's dedication speech at Disneyland, &quot;To all who come to this happy place, welcome ...&quot;" width="192" align="absmiddle">
              </div>
            </div>
            <div class="AccordionPanel">
              <div class="AccordionPanelTab">Pins</div>
              <div class="AccordionPanelContent">
                  <p>Ordering</p>
                  <p>Presenting a Pin</p>
                  <p>Collectors' Corner</p>
                  <p>Why a Pin?</p>
              </div>
            </div>
            <div class="AccordionPanel">
              <div class="AccordionPanelTab">Cast Members</div>
              <div class="AccordionPanelContent">
                  <p>Newest</p>
                  <p>Nominate Your Own</p>
                  <p>Alphabetical</p>
                  <p>By Company/Location</p>
                <p>By WWWD Pin</p>
                <p>Cast Members' Reactions</p>
              </div>
            </div>
            <div class="AccordionPanel">
                  <div class="AccordionPanelTab">Traditions</div>
                <div class="AccordionPanelContent">
                <p>Guests' Traditions</p>
                  <p>Share Your Traditions</p>
                </div>
              </div>
            <div class="AccordionPanel">
                  <div class="AccordionPanelTab">Adventures</div>
                  <div class="AccordionPanelContent">
                <p>Guests' Adventures</p>
                  <p>Share Your Adventures</p></div>
              </div>
            <div class="AccordionPanel">
                  <div class="AccordionPanelTab">City Hall</div>
                  <div class="AccordionPanelContent">
                <p>Waltisms</p>
                <p>The WWWD Story</p>
                  <p>About Us</p>
                  <p>That First Trip</p>
                  <p>About Us</p>
                  <p>Ordering</p>
                  <p>About Us</p>
                  <p>Ordering</p></div>
              </div>
        </div>
        <div id="social">This is the content for Layout Div Tag "social"</div>
        <div id="printer">This is the content for Layout Div Tag "printer"</div>
        <div id="banner"><img src="/images/graphics/reg sidebargraphic.gif" alt="White Mickey head with a circle of stars on a blue field"></div>
      </div>
      <div id="copy">This is the content for Layout Div Tag "copy"<br><br><P> <FONT SIZE="-1" COLOR="#CC0000">Copyright © 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003, 2002 Founder's
                Legacy Inc. </FONT><BR>
                <FONT SIZE="-1" COLOR="#CC0000">What Would Walt Do and WWWD are trademarks
                of Founder's Legacy, Inc.</FONT></P>
              <P><FONT COLOR="#000081" SIZE="-1">Founder's Legacy, Inc. is a member
                of the Disney Store.com Affiliate Network. As such we are authorized
                to display the Disney Store banner on any or all of our webpages.
                Founder's Legacy is also listed with The Disneyland Resort Press &
                Publicity Department, images used are with their permission.</FONT></P>
              <P><FONT COLOR="#000081" SIZE="-1">Founder's Legacy, Inc. is not part
                of The Walt Disney Company. The only other relationship between Founder's
                Legacy, Inc. and The Walt Disney Company is various members of the
                Founder's Legacy Inc.'s Board of Directors and/or their family are
                shareholders in The Walt Disney Company.</FONT><FONT SIZE="-1" COLOR="#CC0000"><BR>
                <BR>
                Additional disclosures for the benefit of insomniacs may be enjoyed
                in our <A HREF="/pages/insomniac.shtml">Insomniac's Delight
      Page & Privacy Policy</A></FONT> </P></div>
      </div>
    <div id="mission"><FONT
                 COLOR="#000081"><B>Our Mission Statement</B></FONT>
          <BLOCKQUOTE>
        <P><FONT color="#D50000" SIZE="+2"><em>To restore Magical Guest experiences through recognizing outstanding Cast Members.</em></FONT></P>
            </div>
    <div id="awards"><table width="100%" border="0" cellpadding="0">
      <tr>
        <TD VALIGN="middle" ALIGN="CENTER"><a href="http://LaughingPlace.com"><img src="/Assets/graphics/Affiliations/LPLogoHighest.gif" width="96" height="82" border="1" alt="LaughingPlace.com"></a></TD>
        <TD VALIGN="middle" ALIGN="CENTER"><img src="/Assets/graphics/Affiliations/seek-button01.gif" width="120" height="80"
                 border="0"></TD>
        <TD WIDTH="1" VALIGN="middle" ALIGN="CENTER"><a href="http://disney.go.com/investors/index.html"><img src="/Assets/graphics/Affiliations/shareholder.gif" width="106" height="48"
                 border="1"></a></TD>
        <TD VALIGN="middle" ALIGN="CENTER"> <img src="/Assets/graphics/Affiliations/safewave.gif" width="78" height="74"
                 border="1"></TD>
        <TD VALIGN="middle" ALIGN="CENTER"><a href="http://wdwig.com/"><img src="/Assets/graphics/Affiliations/125x125allearsnet.gif" width="120" height="120" border="0"></a></TD>
      </tr>
    </table></div>
    <div id="bigbottom"><P> <FONT SIZE="-1" COLOR="#CC0000">Copyright © 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003, 2002 Founder's
                Legacy Inc. </FONT><BR>
                <FONT SIZE="-1" COLOR="#CC0000">What Would Walt Do and WWWD are trademarks
                of Founder's Legacy, Inc.</FONT></P>
              <P><FONT COLOR="#000081" SIZE="-1">Founder's Legacy, Inc. is a member
                of the Disney Store.com Affiliate Network. As such we are authorized
                to display the Disney Store banner on any or all of our webpages.
                Founder's Legacy is also listed with The Disneyland Resort Press &
                Publicity Department, images used are with their permission.</FONT></P>
              <P><FONT COLOR="#000081" SIZE="-1">Founder's Legacy, Inc. is not part
                of The Walt Disney Company. The only other relationship between Founder's
                Legacy, Inc. and The Walt Disney Company is various members of the
                Founder's Legacy Inc.'s Board of Directors and/or their family are
                shareholders in The Walt Disney Company.</FONT><FONT SIZE="-1" COLOR="#CC0000"><BR>
                <BR>
                Additional disclosures for the benefit of insomniacs may be enjoyed
                in our <A HREF="/pages/insomniac.shtml">Insomniac's Delight
      Page & Privacy Policy</A></FONT> </P></div>
    </div>
    <script type="text/javascript">
    var Accordion1 = new Spry.Widget.Accordion("Accordion1");
    </script>
    </body>
    </html>
    Stylesheet:
    @charset "utf-8";
    /* Simple fluid media
       Note: Fluid media requires that you remove the media's height and width attributes from the HTML
       http://www.alistapart.com/articles/fluid-images/
    img, object, embed, video {
        max-width: 100%;
    /* IE 6 does not support max-width so default to width 100% */
    .ie6 img {
        width:100%;
        Dreamweaver Fluid Grid Properties
        dw-num-cols-mobile:        5;
        dw-num-cols-tablet:        8;
        dw-num-cols-desktop:    12;
        dw-gutter-percentage:    25;
        Inspiration from "Responsive Web Design" by Ethan Marcotte
        http://www.alistapart.com/articles/responsive-web-design
        and Golden Grid System by Joni Korpi
        http://goldengridsystem.com/
    /* Mobile Layout: 480px and below. */
    .gridContainer {
        margin-left: auto;
        margin-right: auto;
        width: 87.36%;
        padding-left: 1.82%;
        padding-right: 1.82%;
    #LayoutDiv1 {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #bannertop {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #ticker {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #blocker {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #leftcolumn {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #copy {
        clear: none;
        float: left;
        margin-left: 4.1666%;
        width: auto;
        display: block;
    #leftnav {
        clear: none;
        float: left;
        margin-left: 4.1666%;
        width: 100%;
        display: block;
    #social {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
        text-align: center;
        padding-top: 8px;
        padding-bottom: 8px;
        padding-left: 35px;
    #printer {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #banner {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #mission {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #awards {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #bigbottom {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    /* Tablet Layout: 481px to 768px. Inherits styles from: Mobile Layout. */
    @media only screen and (min-width: 481px) {
    .gridContainer {
        width: 90.675%;
        padding-left: 1.1625%;
        padding-right: 1.1625%;
    #LayoutDiv1 {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #bannertop {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #ticker {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #blocker {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #leftcolumn {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #copy {
        clear: none;
        float: left;
        width: 55%;
        display: block;
        margin: 0%;
    #leftnav {
        clear: none;
        float: left;
        margin-left: 2.5641%;
        width: 100%;
        display: block;
    #social {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #printer {
        clear: both;
        float: left;
        margin-left: 0;
        width: 35.8974%;
        display: block;
    #banner {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #mission {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #awards {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #bigbottom {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    /* Desktop Layout: 769px to a max of 1232px.  Inherits styles from: Mobile Layout and Tablet Layout. */
    @media only screen and (min-width: 769px) {
    .gridContainer {
        width: 88.5%;
        max-width: 1232px;
        padding-left: 0.75%;
        padding-right: 0.75%;
        margin: auto;
    #LayoutDiv1 {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #bannertop {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #ticker {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #blocker {
        clear: both;
        float: left;
        margin-left: 0;
        width: 74.5762%;
        display: block;
        border-top-width: thick;
        border-right-width: thick;
        border-bottom-width: thick;
        border-left-width: thick;
        border-top-style: none;
        border-right-style: ridge;
        border-bottom-style: none;
        border-left-style: none;
        border-top-color: #C10B0F;
        border-right-color: #C10B0F;
        border-bottom-color: #C10B0F;
        border-left-color: #C10B0F;
    #leftcolumn {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #copy {
        clear: none;
        float: left;
        margin-left: 1.6949%;
        width: 100%;
        display: block;
    #leftnav {
        clear: none;
        float: left;
        margin-left: 1.6949%;
        width: 100%;
        display: block;
    #social {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #printer {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #banner {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #mission {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #awards {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #bigbottom {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;

  • Java program to perform binary addition,subtraction and modulus.

    i am a newbie to java and require ur urgent help plzzzz.
    i wanna perform binary addition,subtraction and modulus operation between two numbers of 512 bit without using java functions i.e by simple logics of control statements.i need to convert two 512 bit numbers passed as string into binary form, and then perform addition,subtraction and modulus operations on these two binary numbers and finally dipaly the result in decimal format.
    i think we may use full adder binary logic in this!!!
    please send me the java coding for these three operations as urgent as possible on my email.
    i would be highly obliged.
    thanks.
    sheetal.

    i have managed to make this code myself but i wanna learn the basics...so plz help me guyz...
    this is the code:
    package bytearrayopeations;
    import java.math.BigInteger;
    * @author sheetalb
    public class binaryadding {
    public static void main(String[] args) {
    BigInteger a = new BigInteger("123456");
    BigInteger b = new BigInteger("5121");
    String bb1 = a.toString(2);
    String bb2 = b.toString(2);
    String ss1 = null;
    String ss2 = null;
    String result = "";
    String carry="0";
    System.out.println("first value=" +bb1);
    System.out.println("second value=" +bb2);
    int k=bb1.length();
    int h=bb2.length();
    System.out.println("length 1="+ k);
    System.out.println("length 2=" +h);
    int p=h-k;
    //System.out.println("difference=" +p);
    int q=k-h;
    //System.out.println("difference 2=" +q);
    if(h==k)
    else if(h>k)
    for(int i=0;i<p;i++)
    bb1="0"+bb1;
    System.out.println("new value of first=" +bb1);   
    else if(h<k)
    for(int i=0;i<q;i++)
    bb2="0"+bb2;
    System.out.println("new value of second=" +bb2);
    StringBuffer sb1=new StringBuffer(bb1);
         StringBuffer sb2=new StringBuffer(bb2);
    bb1=sb1.reverse().toString();
         bb2=sb2.reverse().toString();
    //System.out.println("rev. buffer1=" +bb1);
    //System.out.println("rev. buffer2=" +bb2);
    for(int i=0;i<bb1.length();i++)
    ss1=bb1.substring(i,i+1);
    ss2=bb2.substring(i,i+1);
    System.out.println("value1=" + ss1 + " " + "value2=" + ss2);
    if (ss1.equals("0") && ss2.equals("0"))
    if (carry.equals("0"))
    result+="0";
    else
    result+="1";
    else if (ss1.equals("1") && ss2.equals("1"))
    if (carry.equals("0"))
    result+="0";
              carry="1";
              else
                   result+="1";
                   carry="1";
    else if (ss1.equals("0") && ss2.equals("1"))
    if (carry.equals("0"))
         result+="1";
                   carry="0";
                        else
                        result+="0";
    carry="1";
    else if (ss1.equals("1") && ss2.equals("0"))
    if (carry.equals("0"))
    result+="1";
    carry="0";
                   else
    result+="0";
    carry="1";
    System.out.println("sum=" result " " + "carry" + carry);
    result+=carry;
    StringBuffer sb3=new StringBuffer(result);
    result=sb3.reverse().toString();
    System.out.println("result is " +result); 
    System.out.println("Binary = "+ result + ", Decimal = "+Integer.parseInt(result,2));
    plz reply nw...

  • Add a simple calcul to a table with Personalize menu

    Hi
    is it possible to add a column (Message Styled Text) that will do a simple calculation ((score +50 *10000) /quote total) in an existing table (Personalize "Supplier Summary Table")
    thanks

    Thank you Bernd, but that is only part of the solution.  For example, I do set the Page Layout to 1-page-continuous.  MOST of the time it keeps this setting, but some documents either override that setting, or perhaps it reverts back to a default (maybe with version upgrades?).  The other part is that I always want the menu-bar and toolbar to show up.  Some documents hide these when they open.  I realize that I can hit [F8] and/or [F9] to toggle these, but there are additional settings.  I also want to always have the selection tools available, etc.  Bottom Line: I just want a collection of settings that I can call up with a single, simple shortcut or button, so I don't have to perform multiple steps just to get the tool back to my standard configuration whenever something changes it.

  • If any function like greatest or least for addition,subtraction and multi?

    if any function like greatest or least for addition,subtraction and multi?
    there are two columns 'a' and 'b'...i have to add the values in column wise
    a b add
    10 30 -->40
    20 40 -->60
    IS there any function?

    Hi,
    794244 wrote:
    if any function like greatest or least for addition,subtraction and multi?
    there are two columns 'a' and 'b'...i have to add the values in column wise
    a b add
    10 30 -->40
    20 40 -->60
    IS there any function?Do you mean something like
    FUNCTION_X (a, b, c, d, ...)that would return the sum of all those numbers?
    No, not that I know of. If there were, it would be harder to use than
    a + b + c + d + ...The first is a comma-delimited list of columns, with a function name and parentheses.
    The second is a +-sign delimited list, with nothing else needed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Simple Calculator Question

    I am trying to learn ActionScript 3 and have been going
    through books trying to piece together knowledge.
    Today I thought I had figured some things out and attempted
    to put together a simple addition, subtraction, multiplication and
    division calculator using variables and a function but I cannot
    seem to get it to work.
    I think it is in the way the function is looking at the
    variables when it tries to perform the mathNum function.
    All the variables are standard variables except the variable
    "operator", that is suppose to hold the operator from the form on
    the stage.... i.e. *, +, - , or / , I have tried all the different
    data types and it just doesn't seem to work
    All it is suppose to do is take 2 numbers that are input on
    the stage, let the user input a operator type and then push a
    calculate button and it displays the answer.
    I have attached the code.... Thank you in advance for
    looking.
    var operNum1:Number = 0;
    var operNum2:Number = 0;
    var operator:Object = * ;
    var sum:Number = 0;
    result_btn.addEventListener(MouseEvent.CLICK, onClick);
    function onClick(e:MouseEvent):void
    operNum1 = Number(oper1_txt.text);
    operNum2 = Number(oper2_txt.text);
    operator = Object(operator_txt.text);
    var sum = mathNum(operNum1,operator, operNum2);
    sum_txt.text = sum;
    function mathNum(operNum1,operator,operNum2):Number
    return (operNum1 + operator + operNum2);
    Thanks again for any help.
    Mike

    I'm new to Actionscript, but experienced with OOP. There are
    a number of errors in this code.
    1) I don't believe you can assign the * character as an
    object, that will just give you a syntax error or undefined
    property.
    2) in mathNum, you're mixing data types. the "+" operator
    adds numbers or concatenates strings. You can't add an operator to
    numbers and expect actionscript to know what you mean by that.
    3) in mathNum, you haven't defined the types for the
    arguments either.
    The only way I know of to do what you want is to either check
    a string for the chosen operator and use a case statement, or maybe
    use an eval statement (if actionscript has it, I don't know). Maybe
    a more experienced as person could direct you further.
    good luck.
    lou

  • Creating a simple calculator

    Hi all. I realize this might fall into the dumb question category, but I can't find any tutorials or walkthroughs on it.
    I want to make a simple calculator. The user inputs the variables and that changes the values displayed.
    I have all of the formulas as a table in Excel. I imported the data source (Excel), created a gallery and connected the various input and text boxes to the corresponding column labels in Excel.
    But when you change the values in the text input box the other fields don't change. It's almost like Siena forgot the formulas and is just displaying the text.
    Any help or directions to a tutorial would be greatly appreciated.
    Thanks!

    Hi,
    When importing data from Excel, Siena retains the values not the initial formula. So you will need to create these formula using Siena expressions.
    As a simple example, let's assume you want to add the values of two input visuals and display the result in a lablel, the text expression of that label would be:
    label: InputText1!Text+InputText2!Text
    Olivier

  • Count first two columns

    Hello,
    I have a count requirement that i havent been able to solve by searching sdn.  Maybe someone can help.
    I have a query built on a multiprovider that points to two basic cubes.  The basic cubes do not contain a count key figure.  The first two columns of my query are characteristics.  My requirement is to count the occurences of the combination of the first two column (characteristics).  I am looking for a way to do this in the query so i do not have to reload the cubes as they have large volumes of data.  All the suggestions i have been able to find on sdn seem to be only for counting a single characteristic.  Is there a way to count the combination of two?
    Regards,
    TMS

    Hi Create a count using the formula or calculated ket figure for the count unique id like client id for your infocube.
    so you will have a count for each row now. place this count object in your column.
    now select the two char or the group whatever you want a count in your row.
    select query properties and select the display tab and make sure the option - hide repeated key values is selected (normally by default it is selected). Then select each of the char in rows and in free char and set the option under display tab result rows - always suppress.
    Execute the query now. you will get the list of char and their count. sort the count by descending to get the most duplicate entries by their highest number on top in the count coulmn.
    you can also ignore the rows which donot have a duplicate i.e count more than 1 by creating a new condintion on the count key figure > 1 and restricting the condition  by only the group of char you have given in the column. so that you can also do a drill down by free char in your query and it will only show the duplicates group.
    Hope it helps.
    regards,
    Siva

  • Binary addition,subtraction and modulus...plz help urgent

    plz help me on this query...
    i need to pass two 512 bit number as string,then convert them to binary and
    then perform binary addition,subtraction,modulus operations on those two numbers.finally convert result to integer.
    i designed a code which doesnt work correct.it is:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package bytearrayopeations;
    import java.math.BigInteger;   
    * @author sheetalb
    public class binaryadding {
        public static void main(String[] args) {
            BigInteger a = new BigInteger("123456");
            BigInteger b = new BigInteger("5121");
            String bb1 = a.toString(2);
            String bb2 = b.toString(2);
            String ss1 = null;
            String ss2 = null;
            String result = "";
            String carry="0";
            System.out.println("first value=" +bb1);
            System.out.println("second value=" +bb2);
            int k=bb1.length();
            int h=bb2.length();
            System.out.println("length 1="+ k);
            System.out.println("length 2=" +h);
            int p=h-k;
            //System.out.println("difference=" +p);
            int q=k-h;
            //System.out.println("difference 2=" +q);
            if(h==k)
           else if(h>k)
                for(int i=0;i<p;i++)
                    bb1="0"+bb1;
                System.out.println("new value of first=" +bb1);   
        else if(h<k)
            for(int i=0;i<q;i++)
                bb2="0"+bb2;
            System.out.println("new value of second=" +bb2);
            StringBuffer sb1=new StringBuffer(bb1);
         StringBuffer sb2=new StringBuffer(bb2);
            bb1=sb1.reverse().toString();
         bb2=sb2.reverse().toString();
            //System.out.println("rev. buffer1=" +bb1);
            //System.out.println("rev. buffer2=" +bb2);
            for(int i=0;i<bb1.length();i++)
                ss1=bb1.substring(i,i+1);
                ss2=bb2.substring(i,i+1);
              System.out.println("value1=" + ss1 + "    " + "value2=" + ss2);
              if (ss1.equals("0") && ss2.equals("0")) 
                 if (carry.equals("0")) 
                     result+="0";
                        else
                            result+="1";
               else if (ss1.equals("1") && ss2.equals("1"))
                if (carry.equals("0")) 
                    result+="0";
              carry="1";
              else
                   result+="1";
                   carry="1";
        else if (ss1.equals("0") && ss2.equals("1"))
                     if (carry.equals("0")) 
                         result+="1";
                   carry="0";
                        else
                          result+="0";
                                    carry="1";
               else if (ss1.equals("1") && ss2.equals("0"))
                     if (carry.equals("0")) 
                        result+="1";
                        carry="0";
                   else
                                result+="0";
                                carry="1";
           System.out.println("sum=" +result + "         " + "carry" + carry);
                        result+=carry;
                        StringBuffer sb3=new StringBuffer(result);
                        result=sb3.reverse().toString();
                    System.out.println("result is " +result); 
                  System.out.println("Binary = "+ result + ", Decimal = "+Integer.parseInt(result,2));
    }plz provide me or email me if possible java coding for all three operations as soon.
    [email protected]

    One thread is enough. Continue here:[http://forums.sun.com/thread.jspa?threadID=5373720&messageID=10643157#10643157]

Maybe you are looking for