Java simple calculation involving double

*public static void main(String[] args) {*
System.out.println("Output "+300.025d100.0);*
The above code is returning me 30002.499999999996 though I was expecting 30002.5

import java.text.DecimalFormat;
import java.text.NumberFormat;
public class Test {
NumberFormat f = new DecimalFormat("0.0");
System.out.println("Output "+new Float(f.format(300.025d*100.0)));
}

Similar Messages

  • Simple calculation involving  KOMV-KBETR giving issues

    Hello Experts,
    I have a pricing routine in which I am doing some calculation on a field typed on KOMV-KBETR. The calculation is similar to the code  shown below. But this simple calculation is not giving correct results. For example, the correct result from the sample code below should have been 180.00, but the result I am getting is 18000.00. Please help to resolve this. Thanks in advance
    Also, if you try to execute the below code in a custom program, you will get the correct result. But the issue is happening in a pricing routiine.
    TABLES: komv.
    DATA:  ws_value LIKE komv-kbetr VALUE '200.00',
                 g_value TYPE bsgrd value '90.00'.
    IF sy-subrc EQ 0.
      ws_value = g_value * ws_value / 100.
    ENDIF.
    Regards
    Arun.

    - How did you fill KOMV (are you in an exit, a specific program, do you use a FM like PRICING_GET_CONDITIONS ?)
    - Is KOMV-WAERS currency key filled (?)
    Nevertheless - from [Predefined ABAP Types|http://help.sap.com/saphelp_wp/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/frameset.htm]
    it is a good idea to set the program attribute Fixed point arithmetic.Otherwise, type P numbers are treated as integers.
    You can convert from currency to decimal field using FM for BAPI like BAPI_CURRENCY_CONV_TO_EXTERNAL and BAPI_CURRENCY_CONV_TO_INTERNAL. (or old FM like CURRENCY_AMOUNT_SAP_TO_DISPLAY)
    Regards,
    Raymond

  • Simple calculator to use log, successor, predecessor ?

    Hello. I have this simple calculator program, and I am having trouble with the log, successor (if 8 entered returns 9), predecessor (if 8 entered returns 7). The log gets this error:
    Calculator.java:113: log(double) in java.lang.Math cannot be applied to (int,int)
                   result = (int)Math.log(result, stringToInteger(ioField.getText()));
    I did the same thing with power, and it seems to work so I'm a little confused about that.
    If anyone can help me out it would be greatly appreciated, and thanks in advance!
    Here's the code (commented out code is what I need help with):
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Calculator extends JFrame implements ActionListener
         public static final int WIDTH = 400;
         public static final int HEIGHT = 200;
         public static final int NUMBER_OF_DIGITS = 30;
         private JTextField ioField;
         private int result = 0;
         public Calculator()
              setSize(WIDTH, HEIGHT);
              setTitle("GUI Calculator");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setLayout(new BorderLayout());
              JPanel textPanel = new JPanel();
              textPanel.setLayout(new FlowLayout());
              ioField = new JTextField("Enter numbers here.", NUMBER_OF_DIGITS);
              ioField.setBackground(Color.WHITE);
              textPanel.add(ioField);
              add(textPanel, BorderLayout.NORTH);
              JPanel buttonPanel = new JPanel();
              buttonPanel.setBackground(Color.BLUE);
              buttonPanel.setLayout(new GridLayout(5, 2));
              JButton addButton = new JButton("+");
              addButton.addActionListener(this);
              buttonPanel.add(addButton);
              JButton subButton = new JButton("-");
              subButton.addActionListener(this);
              buttonPanel.add(subButton);
              JButton multButton = new JButton("*");
              multButton.addActionListener(this);
              buttonPanel.add(multButton);
              JButton divButton = new JButton("/");
              divButton.addActionListener(this);
              buttonPanel.add(divButton);
              JButton expButton = new JButton("^");
              expButton.addActionListener(this);
              buttonPanel.add(expButton);
              JButton logButton = new JButton("v");
              logButton.addActionListener(this);
              buttonPanel.add(logButton);
              JButton sucButton = new JButton("s");
              sucButton.addActionListener(this);
              buttonPanel.add(sucButton);
              JButton preButton = new JButton("p");
              preButton.addActionListener(this);
              buttonPanel.add(preButton);
              JButton clearButton = new JButton("C");
              clearButton.addActionListener(this);
              buttonPanel.add(clearButton);
              add(buttonPanel, BorderLayout.CENTER);
         public void actionPerformed(ActionEvent e)
              try
                   assumingCorrectNumberFormats(e);
              catch(NumberFormatException e2)
                   ioField.setText("Error - Reenter number.");
         public void assumingCorrectNumberFormats(ActionEvent e)
              String actionCommand = e.getActionCommand();
              if(actionCommand.equals("+"))
                   result = result + stringToInteger(ioField.getText());
                   ioField.setText(Integer.toString(result));
              else if(actionCommand.equals("-"))
                   result = result - stringToInteger(ioField.getText());
                   ioField.setText(Integer.toString(result));
              else if(actionCommand.equals("*"))
                   result = result * stringToInteger(ioField.getText());
                   ioField.setText(Integer.toString(result));
              else if(actionCommand.equals("/"))
                   result = result / stringToInteger(ioField.getText());
                   ioField.setText(Integer.toString(result));
              else if(actionCommand.equals("^"))
                   result = (int)Math.pow(result, stringToInteger(ioField.getText()));
                   ioField.setText(Integer.toString(result));
    /*          else if(actionCommand.equals("v"))
                   result = (int)Math.log(result, stringToInteger(ioField.getText()));
                   ioField.setText(Integer.toString(result));
              else if(actionCommand.equals("s"))
                   result = result + 1;
              else if(actionCommand.equals("p"))
                   result = result - 1;
    */          else if(actionCommand.equals("C"))
                   result = 0;
                   ioField.setText("0");
              else
                   ioField.setText("Unexpected error.");
         public static int stringToInteger(String stringObject)
              return Integer.parseInt(stringObject.trim());
         public static void main(String[] args)
              Calculator gui = new Calculator();
              gui.setVisible(true);
    }

    A 'double' is not the same as an 'int' and they can't fit the one value-type into the memory of the other.
    Although this is a logical math problem, simple for us, we have better memory than a computer.
    An integer maps a certain amount of memory to fix its maximum value, when you cast, you must cast into a type that is the same or smaller in terms of memory byte size.
    Just like you can't cast some objects as others, you can't cast a double as an int.
    The error is telling you that the result of a method call is incompatiable with the argument of another method call.
    The fault lies at Calculator.java source file at line 113 in the file. This is where you call the method log() which requires an argument of type 'double' which is located in Math class log method where the two arguments are 'int' and 'int'.
    However, in your call, you inflect the reference 'result' as the product of the method call in which the 1st argument is also 'result'
    That in itself is bad design. It's like saying "Joe is the product of Mike (who uses Joe)."
    Memory-wise, this could cause possible leaks.

  • Need help with starting a simple calculator

    I have this simple calculator I just started on, and I'm having just a few problems. First of all, I don't know how to append text to a textfield. Maybe I would have to create a string buffere or something. Then, when the user clicks one of the buttons, the compiler goes crazy, and nothing is displayed.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Calculator extends JFrame implements ActionListener
         JButton[] btnNums;
         JButton btnBack;
         JButton btnClear;
         JButton btnCalculate;
         String[] strNames;
         JTextField txtDisplay;
         public Calculator()
              Container content = getContentPane();
              setSize(210,250);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              /*  construct a JPanel and the textfield that
               *  will show the inputed values and outputed
               *  results
              JPanel jpDisplay = new JPanel();
              jpDisplay.setLayout(new BorderLayout());
              txtDisplay = new JTextField(15);
              txtDisplay.setHorizontalAlignment(JTextField.RIGHT);
              jpDisplay.add(txtDisplay);
              /*  contstruct a JPanel that will contain a back
               *  button and a clear button.
              JPanel jpRow2 = new JPanel();
              btnBack = new JButton("Backspace");
              btnClear = new JButton("Clear");
              btnClear.addActionListener(this);
              jpRow2.add(btnBack);
              jpRow2.add(btnClear);
              /*  construct a string array with all the names of the
               *  buttons, then in a for loop create the new buttons
               *  and add their name and an actionListener to them.
              String[] strNames = {"7","8", "9","/", "4", "5", "6","*", "1", "2", "3","+", "0", "+/-", ".", "-"};
              btnNums = new JButton[16];
              JPanel jpButtons = new JPanel();
              jpButtons.setLayout(new GridLayout(4,4));
                for (int i = 0; i < 16; i++)
                     btnNums[i] = new JButton(strNames);
                   btnNums[i].addActionListener(this);
                   jpButtons.add(btnNums[i]);
              /* construct the final JPanel and add a
              * calculate button to it.
              JPanel jpLastRow = new JPanel();
              btnCalculate = new JButton("Calculate");
              btnCalculate.addActionListener(this);
              jpLastRow.add(btnCalculate);
              /* set the contentPane and create the layout
              * add the panels to the container
              setContentPane(content);
              setLayout(new FlowLayout());
              setResizable(false);
              content.add(jpDisplay, BorderLayout.NORTH);
              content.add(jpRow2);
              content.add(jpButtons);
              content.add(jpLastRow);
              setTitle("Mini Calculator");
              setVisible(true);
         public void actionPerformed(ActionEvent ae)
              for (int i =0; i < 16; i++)
                   if (ae.getSource() == btnNums[i])
                        txtDisplay.setText(strNames[i]);
         public static void main(String[] args)
              Calculator calc = new Calculator();

    First of all, I don't
    know how to append text to a textfield.
    textField.setText( textField.getText() + TEXT_YOU_WANT_TO_APPEND );
    Then,
    when the user clicks one of the buttons, the compiler
    goes crazy, and nothing is displayed.No, the compiler doesn't go crazy, the compiler has done it's job by then. However, you do get a NullPointerException, and the stacktrace tells you that the problem is on the following line:
    txtDisplay.setText(strNames);
    It turns out that strNames is null. I leave it to you to find out why. ;-)

  • Simple calculator, but ...

    Hi !
    I'm looking for some simple calculator (+,-,*,/) implemented in java using session bean, but unfortunetly I can't find any. Already I've come accross on many examples but without these mentioned beans.
    Please, if you have any working link, or even code - I would be very grateful.

    and what would you learn by downloading some code someone else wrote and submitting it to your teacher as your own?

  • Simple calculations not working in acrobat 9

    I have text form fields made in Acrobat 9 from a previously made pdf, where I need a simple calculation, but I cannot get it to work.
    The form is not for submission, only for personal tracking, so I don't even need validation.
    FieldA (a number they enter) x a number I have entered in the calculation = FieldB
    FieldB x FieldC (a number they enter) = FieldD In FieldB I have a simple javascript Calculation in the form field: FieldA * .115, which should automatically calculate answer into FieldB, when tabbed.
    In FieldD I have a Calculation in the form field: FieldB * FieldC, which should automatically calculate answer into FieldD. All fields are set as numbers.
    I have left the Trigger Action as Mouse Up.
    I don't need to validate, as this is personal use, and is not being submitted.
    I have all fields in the correct tab order.
    I have reader enabled the form. When I open the form in Reader, I can enter the numbers, but no calculations are being performed. It reads 0 in FieldB and FieldD. Any assistance would be greatly appreciated.

    Hello Everyone,
    I use the following VBS code, but to tell the truth, I don't know if it works or not. The main idea was to enable commenting from Adobe Reader. But after execution code, saving document and reopening it in Reader, commenting is still 'Not Allowed'. Is showAnnotToolsWhenNoCollab really capable to allow this and there is only error in my code? Or is the functionality different and this way can never be used for what I want?
    There is another issue that application is not closed on Exit, but is still shown.
    scriptPath = "C:\Acrobat\"
    Set gApp = CreateObject("AcroExch.App")  
    Set pdDoc = CreateObject("AcroExch.PDDoc")
    sampleFilePath = scriptPath & "AR_test_orig.pdf"
    pdDoc.Open sampleFilePath
    pdDoc.OpenAVDoc "myFile"
    gApp.Show
    Set formApp = CreateObject("AFormAut.App")
    'formApp.Fields.ExecuteThisJavascript "app.alert(""hello"");"
    formApp.Fields.ExecuteThisJavascript "Collab.showAnnotToolsWhenNoCollab = true;"
    Set formApp = Nothing
    pdDoc.Save 1, scriptPath & "AR_test.pdf"
    'pdDoc.Close
    gApp.CloseAllDocs
    gApp.Exit
    Set pdDoc = Nothing
    Set gApp = Nothing
    Thanks for any ideas.
    Jan
    PS: I use Acrobat 9.0 Pro

  • Simple calculations in Universe not working for XI 3.0

    Simple calculations in Universe using key figures are not working in XI 3.0(without any Fix Pack)
    Below is the steps I followed.
    1. Using key figure [Jan] I am trying to round the values by deviding it by 1000.
    <EXPRESSION>@Select([Jan])/1000</EXPRESSION>
    This gives me a null cell value.
    2. I tried addition then
    <EXPRESSION>@Select([Jan])+1000</EXPRESSION> result was all the cell values changed to 1000.
    3. Finally without calculation I tried
    <EXPRESSION>@Select[Jan]</EXPRESSION> this also resulted null value
    But without EXPRESSION tag if I try @Select[Jan] it works fine.
    Am I missing anything in above expressions.
    As of now I am creating variable in report to incorporate the rounding.
    Thanks
    Raghu

    It was my mistake while writing the question. Path I have used is correct one only @Select(Key Figures/.
    If i use the above alone, I am able to se the data. But if I use in betwen <EXPRESSION> then it gives null value.
    Note: Pls dont confuse with flower bracket i used it just to avoid coverting it to a html link and also the backslash it was not showing in preview
    I have followed that pdf and created calculation in universe.
    Edited by: Raghavendra Barekere on Feb 6, 2009 6:42 AM

  • 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

  • Has anyone seen a simple calculator pod that will work in Acrobat Connect Pro?

    I need a simple calculator to total up responses from participants in web meetings. Does anyone know of one that can work as a pod where everyone will see the numbers that are pushed and the calculation display?

    If this one works with you: http://connect.wezupport.se/p39142940/
    I've attatched so you can download it from here - cheers

  • Process sampled data and perform simple calculation to by pass Matlab?

    I have files that contain large number current samples (like 300,000 for example). I need them to performing simple calculations (for example to calculate energy).
    Before, I used Matlab to load all those samples into array and to do all calculations there.
    However... that process is kind of slow. What can I use to simply this and replace Matlab by some script?
    Can I use perl or php to perform this operation on set of sample files to spit out final calculation values into new file?
    Last edited by kdar (2012-05-11 13:21:05)

    I'm surprised no one has suggested numpy and scipy, which are modules for python 2. They have syntax that's similar to mattlab, they're very fast, and python is useful in other circumstances and easy to learn.
    I did something similar for spectral data. Here's an example of what I did in python:
    #!/usr/bin/env python
    #This program goes through rayleigh line data and finde the mean shift
    #in nanometers and the standard deviation
    import sys, os
    import numpy as np
    import scipy as sp
    import scipy.optimize as op
    import time
    ray = []
    filenames = []
    line = 633
    def rs(wavelength,laser):
    return ((float(1)/laser)-(float(1)/wavelength))*(10**7)
    def main(argv): #Goes through a file and finds the peak position of the rayleigh line
    f = np.loadtxt(argv).transpose() #opens the file
    maxi = np.amax(f[1]) #Finds the value of hte peak of the rayleigh line
    intensity = [f[1,i] for i in range(len(f[1]))] #extrants the array into a list
    indi = intensity.index(maxi) #Finds the index of the rayleigh line
    ray.append(f[0,indi])
    filenames.append(str(argv))
    # Goes through each file named in the CLI call and applies the main function to it
    for filename in sys.argv[1:]:
    main(filename)
    # Use numpy for some basic calculations
    mean = np.mean(ray)
    StandardDeviation = np.std(ray)
    median = np.median(ray)
    variance = np.var(ray)
    ramanshift = [rs(ray[i],line) for i in range(len(ray))]
    rsmean = np.mean(ramanshift)
    rsSD = np.std(ramanshift)
    rsmedian = np.median(ramanshift)
    rsvariance = np.var(ramanshift)
    tname = str(time.asctime())
    # Write all calculations to a file
    output = open('rayleigh_'+tname+'.dat','w')
    output.write('#The files used for this compilation are:\n')
    for i in range(len(filenames)):
    output.write('#'+filenames[i]+'\n')
    output.write('The wavelengths of the Rayleigh line are (in nm):\n')
    for i in range(len(ray)):
    output.write(str(ray[i])+'\n')
    output.write('The raman shifts of the rayleigh line for '+str(line)+'nm are (in rel. cm^(-1):\n')
    for i in range(len(ray)):
    output.write(str(ramanshift[i])+'\n')
    output.write('Mean = '+str(mean)+'nm, or '+str(rsmean)+' rel. cm^(-1)\n')
    output.write('Standard Deviation = '+str(StandardDeviation)+' nm, or '+str(rsSD)+' rel. cm^(-1)\n')
    output.write('Median = '+str(median)+'nm or, '+str(rsmedian)+' rel. cm^(-1)\n')
    output.write('Variance = '+str(variance)+'nm or, '+str(rsvariance)+' rel. cm^(-1)\n')
    output.close()
    Last edited by Yurlungur (2012-05-13 21:14:54)

  • 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.

  • Flash rookie needs help with error messages when making simple calculator in AS3.

    I am trying to make a simple calculator I have been following this guide:
    http://www.youtube.com/watch?v=5k3h37YKZJI
    this is my code.
    var Hnum:String;
    var PCnum:String;
    var calc:Number = 25;
    var Total:String;
    num1.restrict = "0-9";
    num2.restrict = "0-9";
    Est_btn.addEventListener(MouseEvent.CLICK, calculate);
    function calculate(event:MouseEvent):void{
        Hnum = num1.txt;
        PCnum = num2.txt;
        Total = parseInt(Hnum) * calc;
        Total.toString();
        Total_txt.text = String(Total);
    I am getting these 3 errors:
    Scene 1, Layer 'Actions', Frame 1, Line 14
    1067: Implicit coercion of a value of type flash.text:TextField to an unrelated type String.
    Scene 1, Layer 'Actions', Frame 1, Line 15
    1067: Implicit coercion of a value of type flash.text:TextField to an unrelated type String.
    Scene 1, Layer 'Actions', Frame 1, Line 16
    1067: Implicit coercion of a value of type Number to an unrelated type String.
    I have two input text boxs named num1 and num2 and then one dynamic text box named Total_txt.
    This should be so simple I really don't know what im doing wrong?
    Any help would be really appreciated.
    MrB

    If you look at the tutorial I think you will see that you are using "txt"  where "text" is required.  "text" is a property of a textfield, identifying the text that the textfield holds.  I don't know if you are doing something where the num1 object contains another object named txt, but I think my first sentence catches the problem.

  • Web Dynpro Application For developing a simple calculator

    Dear Experts,
    I am trying to develop a simple calculator application in abap web dynpro .
    but i am not able to enable the buttons (1 to 9) . that is what i want is like how it happens in a normal calculator if we press 1 , then in the screen, 1 comes and if 11 then twice we press 1. Like wise i want if the button 1 is enabled then in the input field it should take 1 and if 11 then it should take 11. Kindly give some suggestions to develop this application.
    Regards
    Swarnadeepta

    Hi Swarnadeepta,
    I developed a calculator in web dynpro...please go through the following code. I have made a few changes with respect to modularization but the basic concept is still the same.
    Method to Enter Data on the screen
    METHOD enter_data .
      DATA lv_input TYPE i.
      DATA lv_flag TYPE c.
    ***Read input in the screen 
    wd_this->get_input(
        IMPORTING
          ev_input = lv_input                       " integer
    ***See whether flag is set. If yes save the present value in global attribute gv_previous.
      wd_this->get_flag(
        IMPORTING
          ev_flag = lv_flag                        " wdy_boolean
      IF lv_flag = 'X'.
        wd_this->gv_previous = lv_input.
        lv_input = 0.
      ENDIF.
    ***Modify screen input
      IF lv_input IS INITIAL.
        lv_input = iv_number.
      ELSE.
        lv_input = lv_input * 10 + iv_number.
      ENDIF.
    ***Set the new value of input field
      wd_this->set_input(
        iv_input = lv_input                          " integer
    ***Reset the flag
      wd_this->set_flag(
        iv_flag = ''                           " wdy_boolean
    ENDMETHOD.
    Use the above method on button click
    method ONACTIONONE .
      wd_this->enter_data(
        iv_number = 1                        " integer
    endmethod.
    Method to Register Operations
    method ENTER_OPERATION .
      wd_this->set_flag(
        iv_flag = 'X'                           " wdy_boolean
      wd_this->set_operation(
        iv_operation = iv_operation                      " string
    endmethod.
    Use of above method in operations button
    method ONACTIONADD .
      wd_this->enter_operation(
        iv_operation = 'ADD'                     " string
    endmethod.
    Method to calculate
    method ONACTIONEQL .
    DATA lv_operation TYPE string.
    DATA lv_input TYPE i.
    ***Read screen input 
    wd_this->get_input(
         IMPORTING
           ev_input = lv_input                        " integer
    ***read operation requested
      wd_this->get_operation(
        IMPORTING
          ev_operation = lv_operation                   " string
    CASE lv_operation.
    WHEN 'ADD'.
    lv_input = wd_this->gv_previous + lv_input.
    WHEN 'SUB'.
    lv_input = wd_this->gv_previous - lv_input.
    WHEN 'MUL'.
    lv_input = wd_this->gv_previous * lv_input.
    WHEN 'DIV'.
    lv_input = wd_this->gv_previous / lv_input.
    WHEN OTHERS.
    ENDCASE.
    ***Set the new value of input field
      wd_this->set_input(
        iv_input = lv_input                         " integer
    ***Clear the operation attribute
      wd_this->set_operation(
        iv_operation = ''                     " string
    endmethod.
    Getter Methods example for attribute INPUT
    method GET_INPUT .
      DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA ls_context TYPE wd_this->element_context.
      DATA lv_input TYPE wd_this->element_context-input.
    get element via lead selection
      lo_el_context = wd_context->get_element( ).
    @TODO handle not set lead selection
      IF lo_el_context IS INITIAL.
      ENDIF.
    get single attribute
      lo_el_context->get_attribute(
        EXPORTING
          name =  `INPUT`
        IMPORTING
          value = lv_input ).
    EV_INPUT = lv_input.
    endmethod.
    Setter Methods example for attribute INPUT
    method SET_INPUT .
      DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA ls_context TYPE wd_this->element_context.
      DATA lv_input TYPE wd_this->element_context-input.
    get element via lead selection
      lo_el_context = wd_context->get_element( ).
    @TODO handle not set lead selection
      IF lo_el_context IS INITIAL.
      ENDIF.
    @TODO fill attribute
    lv_input = iv_input.
    set single attribute
      lo_el_context->set_attribute(
        name =  `INPUT`
        value = lv_input ).
    endmethod.
    Hope this will be helpful. Let me know if you have any doubt.
    Its working fine for me.
    Regards,
    Sayan

  • How to create a simple calculated measure ?

    Hello,
    I'm having difficulties creating a very simple calculated measure within OBIEE administrator. Let's say I have a dimension "product" with attribute "product price" and a measure "sales count". I'm trying to define in the "Business Model" layer the calculated measure "total sales". In order to do that I defined it as as a Logical Column with expression "product price" * "sales count".
    However OBIEE doesn't compute what I'm expecting, it does in fact a cartesian product of the products and the grand total sales, which doesn't make sense. To alleviate that I tried to define the measure as associated to the Product level, then I get the computations right but the sales by product are not summed into a grand total.
    Anyway this seems like a very basic thing to do but I've not been able to find any documentation about it; the internal "Help" documentation is extremely limited. Is there another source of documentation that I'm not aware of ?
    Thanks for your help,
    Chris

    Hi there again,
    I'm coming back to you regarding the calculated measure above. As advised, I defined it using physical columns and am - almost - able to get the correct results. However I notice that the measure is not correctly aggregated over the "product" dimension. More specifically what happens is that the products are organized into a level-based hierarchy; only the leaf elements have an attibute "price"; the upper nodes in the hierarchy group different products together with different prices.
    The "total price" measure for such a node should be the sum of "product price" * "sales count" for all underneath nodes in the hierarchy, which is the way it is done for instance in AWM. However with the measure defined as above, I only get NULL values for upper nodes, due to the fact that "product price" is NULL for those levels and thus yields a NULL result.
    I've tried to circumvent the problem by associating the measure to the leaf level of the "product" hierarchy in the Properties -> Levels tab, however this doesn't seem to do what I want, it only forces the computation to happen at the lowest level of the hierarchy. What I would like is for the measure to aggregate to upper levels just as it would were it defined directly in AWM.
    Do you know how to do that ?
    Thanks for your help!
    Chris

  • 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

Maybe you are looking for

  • Adobe Digital Editions Download

    How can I download Adobe Digital Editions on any of my Palms. I have Z22, T|X and Centro. I can download library books to the Adobe Digital Editions on my computer but can't figure out how to get this onto my palm. Instructions say you have to regist

  • 13in. 2008 trackpad click not working

    The physical click on my trackpad is not working. Cleaned it thoroughly, tried removing the battery (bloating) and that did not work. Any thoughts? Things I shoud try? Thank you.

  • Unfriended Game Center user still in games

    I recently added a wrong user on Game Center and deleted them. However, they still show up in my apps as a frienf. I tried restarting but it doesn't seem to work. The user is not in my friends list anymore but when I go into an app and click on the p

  • Syntax Error when generate print program in HRFORMS

    Dear All, I created form for payslip using HRFORMS, the name form is ZPS_TPI_01. When I activate the form, the error raised: Generated print program contains a syntax error Diagnosis   Generated print program /PYXXFO/ZPS_TPI_01_PRNT conains a syntax

  • My JMF can play .rm and .rmvb vedio

    Hellio. Althouth Java document have not say JMF support rm and rmvb code but JMF also can play them. At first, we need a code software, I use StormCodec which include Media Player Classic �CRealMedia Codec �C QuickTime Codec and so on( Here is offici