Help with calculated dimension member

I am trying to create a (custom) dimension member using a simple calculation (subtraction e.g. member1 - member2) in AWM 9.2.0.4 following the example given in the Oracle OLAP DML Reference 10g (using DML). I could not find any articles relating to this for 9i. Although the custom member is easily added to the dimension, I could not populate it with the specified calculation.
I need to enable the analytic workspace for OLAP API and BI Beans. Can anyone help?

Hi,
Use the formula, I have tested by creating Months column with choice, Year column as numeric and Calculated column as DateTime returned.
=DATE(Year,IF([Months]="January", 1,IF([Months]="February",2,IF([Months]="March",3,IF([Months]="April",4,IF([Months]="May",5,IF([Months]="June",6,IF([Months]="July",7,IF([Months]="August",8,IF([Months]="September",9,IF([Months]="October",10,IF([Months]="November",11,12))))))))))),1)
Before applying the formula few things need to be noted.
DATE(YEAR, MONTH,DAY) will accepts three parameters all should be type numeric(integer).
Create the Year column of type numeric
Create the calculated column of type "DateTime" to return as date
Please mark it answered, if your problem resolved or helpful.

Similar Messages

  • How to tag attribute member with standard dimension member in EIS

    hi,
    would any one please help me how to tag attribute member with standard dimension member in EIS
    THANK U IN ADVANCE

    In your OLAP model, view columns for the base dimension table. Go into the column properties and for the columns that have Attribute values highlight them and click the Attribute button.
    Go into Metadata Model and those fields will be available to drag into your outline as attribute members.
    Once in the outline, go into the properties of the attribute and assign the level of the base dimension they associate with.

  • SSRS with calculated dimension members SSAS

    Hello everybody,
    I have an interesting scenario involving a SSRS report with a matrix connected to a SSAS cube containing calculated dimension members.
    One of the parameters is "Reference Week".  Based on that parameter, I need the measures for the previous 5 weeks.
    So I created an anchor dimension "Analysis Weeks" with the members "Week -1" to "Week -5".
    Everything is working fine.  The only problem is the names of the columns on the report.  
    Currently I have "Current Week", "Week -1", etc. as column names, I'd like to show the real dates.
    For example, if I choose "2014-02-15" as the reference week, I want the first column to show "2014-02-15" instead of "Current Week". The second would show "2014-02-08" instead of "Week -1", etc.
    I tried to get the current column position in the matrix, which I could use the with @ReferenceWeek parameter, but I can't access that property.
    Any suggestion?
    Thanks

    If I understand correctly, your column group is on "Analysis Weeks", is that right? If so just get the value of that field and use it to get the dates.
    =DateAdd("d",-1*CInt(Right(Fields!AnalysisWeeks.Value,1))*7,Fields!ReferenceWeek.Value)
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • Why to open Block only with Dense dimension Member ???

    Hi All,
    I want to understand the logic behind opening the block with dense member. Generally we open the block with member of dense dimension by fixing the sparse members
    e.g. below considering C1, P1,Working,Actual are members of sparse dimension customer, product, Version, Scenario.
    Fix(C1,P1,Working,Actual)
    Jan
    IF(Some condition)
    Calculation on Account Member
    ENDIF
    Now if i change the code as below making Jan in FIX and opening the block with Actual. How it will affect the performance. The Number of iterations in total number of datacells will be same in bothe cases above and below then why to give priority to dense dimension member for opening the block.
    Fix(C1,P1,Working,Jan)
    Actual
    IF(Some condition)
    Calculation on Account Member
    ENDIF
    ENDFIX
    I know the logic behind keeping sparse dimension member in FIX but here i think keeping 'Actual' member for opening the block is also a type of fix which will tell the code to do the calculation only for blocks of 'Actual'.
    In 1st case i have fixed the number of blocks containing members C1,P1,Working,Actual and by keeping Jan for opening block means Jan is also fixed for the particular application means code will not run for feb march etc.
    Means code will run for C1->P1->Working>Actual->Jan
    In 2nd case also i have fixed C1,P1,Working,Jan and by keeping Actual for opening block means Actual is also fixed for the particular application means code will not run for other members of Scenarion dimension.
    Means code will run for C1->P1->Working>Jan->Actual
    Then what is the difference??? Why it will effect performance???

    when using an IF statement in a calc script you have to specify a member to associate it with for the calc member block. This is like temporarily assigning it to that member as a formula in the outline. In most cases calculations on dense dimensions can work faster as the block is in memory. Remember that a block statement can have multiple calculation statements in it. When this occurs, having the calculations on a dense member can speed it up as it may not have to swap blocks to do the calculation.
    Also consider that if a sparse combination of members does not exist, the block will not exist and there will be no attempt to do the calculations. If a sparse member is on the calc member block, it will cycle through all of the sparse members looking to do the calculation.

  • Having issues with calculated dimension

    Hi,
    I just downloaded1.15 version of desktop Lumira and was trying to create a calculated dimension from and existing (but hidden) dimesion but Lumira just keeps spinning when I hit save in the formula editor.
    My formula is if {RDTE} > "04/223/2014" and {RDTE} < "05/13/2014" then "P05" else "NA".
    My diemnsion is a character set (ABC) but i also tried the same by converting to Date dimension with the same outcome.
    Anyone else has similar experience. I find the help document lacking in details. Any insights much appreciated...RND

    Hi Rumy
    Not that there should be any excuse for why saving would spin (that is an issue in itself that should be investigated), I recently had to do a similar date comparison and I used the following formula.
    if DateDiffInDays({Deal End Date}, {Deal Plan End Date}) > 0
    then "Delayed"
    else "Closed"
    I have not had a chance to compare if the results would work the same if I compared the two days as you did. Just wanted to share this in case it might be useful.

  • Need help with calculator project for an assignment...

    Hi all, I please need help with my calculator project that I have to do for an assignment.
    Here is the project's specifications that I need to do"
    """Create a console calculator applicaion that:
    * Takes one command line argument: your name and surname. When the
    program starts, display the date and time with a welcome message for the
    user.
    * Display all the available options to the user. Your calculator must include
    the arithmetic operations as well as at least five scientific operations of the
    Math class.
    -Your program must also have the ability to round a number and
    truncate it.
    -When you multiply by 2, you should not use the '*' operator to perform the
    operation.
    -Your program must also be able to reverse the sign of a number.
    * Include sufficient error checking in your program to ensure that the user
    only enters valid input. Make use of the String; Character, and other
    wrapper classes to help you.
    * Your program must be able to do conversions between decimal, octal and
    hex numbers.
    * Make use of a menu. You should give the user the option to end the
    program when entering a certain option.
    * When the program exits, display a message for the user, stating the
    current time, and calculate and display how long the user used your
    program.
    * Make use of helper classes where possible.
    * Use the SDK to run your program."""
    When the program starts, it asks the user for his/her name and surname. I got the program to ask the user again and again for his/her name and surname
    when he/she doesn't insert anything or just press 'enter', but if the user enters a number for the name and surname part, the program continues.
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??
    Here is the programs code that I've written so far:
    {code}
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class Project {
         private static String nameSurname = "";     
         private static String num1 = null;
         private static String num2 = null;
         private static String choice1 = null;
         private static double answer = 0;
         private static String more;
         public double Add() {
              answer = (Double.parseDouble(num1) + Double.parseDouble(num2));
              return answer;
         public double Subtract() {
              answer = (Double.parseDouble(num1) - Double.parseDouble(num2));
              return answer;
         public double Multiply() {
              answer = (Double.parseDouble(num1) * Double.parseDouble(num2));
              return answer;
         public double Divide() {
              answer = (Double.parseDouble(num1) / Double.parseDouble(num2));
              return answer;
         public double Modulus() {
              answer = (Double.parseDouble(num1) % Double.parseDouble(num2));
              return answer;
         public double maximumValue() {
              answer = (Math.max(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double minimumValue() {
              answer = (Math.min(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double absoluteNumber1() {
              answer = (Math.abs(Double.parseDouble(num1)));
              return answer;
         public double absoluteNumber2() {
              answer = (Math.abs(Double.parseDouble(num2)));
              return answer;
         public double Squareroot1() {
              answer = (Math.sqrt(Double.parseDouble(num1)));
              return answer;
         public double Squareroot2() {
              answer = (Math.sqrt(Double.parseDouble(num2)));
              return answer;
         public static String octalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
    String octal1 = Integer.toOctalString(iNum1);
    return octal1;
         public static String octalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String octal2 = Integer.toOctalString(iNum2);
              return octal2;
         public static String hexadecimalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
              String hex1 = Integer.toHexString(iNum1);
              return hex1;
         public static String hexadecimalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String hex2 = Integer.toHexString(iNum2);
              return hex2;
         public double Round1() {
              answer = Math.round(Double.parseDouble(num1));
              return answer;
         public double Round2() {
              answer = Math.round(Double.parseDouble(num2));
              return answer;
              SimpleDateFormat format1 = new SimpleDateFormat("EEEE, dd MMMM yyyy");
         Date now = new Date();
         SimpleDateFormat format2 = new SimpleDateFormat("hh:mm a");
         static Date timeIn = new Date();
         public static long programRuntime() {
              Date timeInD = timeIn;
              long timeOutD = System.currentTimeMillis();
              long msec = timeOutD - timeInD.getTime();
              float timeHours = msec / 1000;
                   return (long) timeHours;
         DecimalFormat decimals = new DecimalFormat("#0.00");
         public String insertNameAndSurname() throws IOException{
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        while (nameSurname == null || nameSurname.length() == 0) {
                             for (int i = 0; i < nameSurname.length(); i++) {
                             if ((nameSurname.charAt(i) > 'a') && (nameSurname.charAt(i) < 'Z')){
                                       inputCorrect = true;
                        else{
                        inputCorrect = false;
                        break;
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your name and surname: ");
                             nameSurname = inStream.readLine();
                             inputCorrect = true;
                        }catch (IOException ex) {
                             System.out.println("You did not enter your name and surname, " + nameSurname + " is not a name, please enter your name and surname :");
                             inputCorrect = false;
                        System.out.println("\nA warm welcome " + nameSurname + " ,todays date is: " + format1.format(now));
                        System.out.println("and the time is now exactly " + format2.format(timeIn) + ".");
                        return nameSurname;
              public String inputNumber1() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter a number you want to do a calculation with and hit <ENTER>: ");
                             num1 = br.readLine();
                             double number1 = Double.parseDouble(num1);
                             System.out.println("\nThe number you have entered is: " + number1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("\nYou did not enter a valid number: " + "\""+ num1 + "\" is not a number!!");
                             inputCorrect = false;
                        return num1;
         public String calculatorChoice() throws IOException {
              System.out.println("Please select an option of what you would like to do with this number from the menu below and hit <ENTER>: ");
              System.out.println("\n*********************************************");
              System.out.println("---------------------------------------------");
              System.out.println("Please select an option from the list below: ");
              System.out.println("---------------------------------------------");
              System.out.println("1 - Add");
              System.out.println("2 - Subtract");
              System.out.println("3 - Multiply");
              System.out.println("4 - Divide (remainder included)");
              System.out.println("5 - Maximum and minimum value of two numbers");
              System.out.println("6 - Squareroot");
              System.out.println("7 - Absolute value of numbers");
              System.out.println("8 - Octal and Hexadecimal equivalent of numbers");
              System.out.println("9 - Round numbers");
              System.out.println("0 - Exit program");
              System.out.println("**********************************************");
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your option and hit <ENTER>: ");
                             choice1 = inStream.readLine();
                             int c1 = Integer.parseInt(choice1);
                             System.out.println("\nYou have entered choice number: " + c1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid choice number: " + "\""+ choice1 + "\" is not in the list!!");
                             inputCorrect = false;
                        return choice1;
         public String inputNumber2() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br2 = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter another number you want to do the calculation with and hit <ENTER>: ");
                             num2 = br2.readLine();
                             double n2 = Double.parseDouble(num2);
                             System.out.println("\nThe second number you have entered is: " + n2);
                             System.out.println("\nYour numbers are: " + num1 + " and " + num2);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid number: " + "\""+ num2 + "\" is not a number!!");
                             inputCorrect = false;
                        return num2;
         public int Calculator() {
              int choice2 = (int) Double.parseDouble(choice1);
              switch (choice2) {
                        case 1 :
                             Add();
                             System.out.print("The answer of " + num1 + " + " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 2 :
                             Subtract();
                             System.out.print("The answer of " + num1 + " - " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 3 :
                             Multiply();
                             System.out.print("The answer of " + num1 + " * " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 4 :
                             Divide();
                             System.out.print("The answer of " + num1 + " / " + num2 + " is: " + decimals.format(answer));
                             Modulus();
                             System.out.print(" and the remainder is " + decimals.format(answer));
                             break;
                        case 5 :
                             maximumValue();
                             System.out.println("The maximum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             minimumValue();
                             System.out.println("The minimum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 6 :
                             Squareroot1();
                             System.out.println("The squareroot of value " + num1 + " is: " + decimals.format(answer));
                             Squareroot2();
                             System.out.println("The squareroot of value " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 7 :
                             absoluteNumber1();
                             System.out.println("The absolute number of " + num1 + " is: " + decimals.format(answer));
                             absoluteNumber2();
                             System.out.println("The absolute number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 8 :
                             octalEquivalent1();
                             System.out.println("The octal equivalent of " + num1 + " is: " + octalEquivalent1());
                             octalEquivalent2();
                             System.out.println("The octal equivalent of " + num2 + " is: " + octalEquivalent2());
                             hexadecimalEquivalent1();
                             System.out.println("\nThe hexadecimal equivalent of " + num1 + " is: " + hexadecimalEquivalent1());
                             hexadecimalEquivalent2();
                             System.out.println("The hexadecimal equivalent of " + num2 + " is: " + hexadecimalEquivalent2());
                             break;
                        case 9 :
                             Round1();
                             System.out.println("The rounded number of " + num1 + " is: " + decimals.format(answer));
                             Round2();
                             System.out.println("The rounded number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 0 :
                             if (choice2 == 0) {
                                  System.exit(1);
                             break;
                   return choice2;
              public String anotherCalculation() throws IOException {
                   boolean inputCorrect = false;
                   while (inputCorrect == false) {
                             try {                              
                                  BufferedReader br3 = new BufferedReader (new InputStreamReader(System.in));
                                  System.out.print("\nWould you like to do another calculation? Y/N ");
                                  more = br3.readLine();
                                  String s1 = "y";
                                  String s2 = "Y";
                                  if (more.equals(s1) || more.equals(s2)) {
                                       inputCorrect = true;
                                       while (inputCorrect = true){
                                            inputNumber1();
                                            System.out.println("");
                                            calculatorChoice();
                                            System.out.println("");
                                            inputNumber2();
                                            System.out.println("");
                                            Calculator();
                                            System.out.println("");
                                            anotherCalculation();
                                            System.out.println("");
                                            inputCorrect = true;
                                  } else {
                                       System.out.println("\n" + nameSurname + " thank you for using this program, you have used this program for: " + decimals.format(programRuntime()) + " seconds");
                                       System.out.println("the program will now exit, Goodbye.");
                                       System.exit(0);
                             } catch (IOException ex){
                                  System.out.println("You did not enter a valid answer: " + "\""+ more + "\" is not in the list!!");
                                  inputCorrect = false;
              return more;
         public static void main(String[] args) throws IOException {
              Project p1 = new Project();
              p1.insertNameAndSurname();
              System.out.println("");
              p1.inputNumber1();
              System.out.println("");
              p1.calculatorChoice();
              System.out.println("");
              p1.inputNumber2();
              System.out.println("");
              p1.Calculator();
                   System.out.println("");
                   p1.anotherCalculation();
                   System.out.println("");
    {code}
    *Can you please run my code for yourself and have a look at how this program is constructed*
    *and give me ANY feedback on how I can better this code(program) or if I've done anything wrong from your point of view.*
    Your help will be much appreciated.
    Thanks in advance

    Smirre wrote:
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??You cannot restrict the user. It is a sad fact in programming that the worst bug always sits in front of the Computer.
    What you could do is checking the input string for numbers. If it contains numbers, just reprompt for the Name.
    AND you might want to ask yourself why the heck a calculator needs to know the users Name.

  • Help with calculated column formula- combine strings and convert to date

    In my list (SharePoint Server 2013) I have:
    'Invoiced Month' column, type of choice (strings with names of months- January, February, March..., December)
    'Year' column, single line of text (e.g. 2012, 2013, 2014)
    1. I need to create a calculated column which will return combined value of the columns above, but in DATE format e.g. 'Sep-2013' or '01-Sep-2013'.
    I then use that newly created calculated column to do this: http://iwillsharemypoint.blogspot.in/2012/03/sharepoint-list-view-of-current-month.html
    I am rubbish with formulas, can I have some help with my problem please?

    Hi,
    Use the formula, I have tested by creating Months column with choice, Year column as numeric and Calculated column as DateTime returned.
    =DATE(Year,IF([Months]="January", 1,IF([Months]="February",2,IF([Months]="March",3,IF([Months]="April",4,IF([Months]="May",5,IF([Months]="June",6,IF([Months]="July",7,IF([Months]="August",8,IF([Months]="September",9,IF([Months]="October",10,IF([Months]="November",11,12))))))))))),1)
    Before applying the formula few things need to be noted.
    DATE(YEAR, MONTH,DAY) will accepts three parameters all should be type numeric(integer).
    Create the Year column of type numeric
    Create the calculated column of type "DateTime" to return as date
    Please mark it answered, if your problem resolved or helpful.

  • Calculated Dimension Member - aggregation error?!

    Hi,
    Hyperion 11.1.2.1.0.83
    I have created a DynamicCalc Scenario member called 'Movements 02', which is calculated as AP02-AP01; (without two pass calculation) - where AP02 and AP01 are both Scenario members with StoreData.
    This works fine for zero level members, but the aggregated member's totals are not correct, even when AP02 and AP01 are re-aggregated - though the sum of errors comes back to zero. (i.e. if one parent is -50 out then another is +50 out)
    (It is possible that entities have moved parents between the original storage of AP02, AP01 and now)
    Account, entity and elements (a custom dimension) are all aggregated via a standard aggregation business rule.
    Anyone suggest a fix please - as the member is calculated it is not like I can run the aggregation script against it...
    thanks,
    Robert.

    This sounds like an order-of-calculation issue. Dynamic variance scenarios usually need to be two-pass calcs. Does it change your results if you set your scenario to two-pass?
    - Jake

  • Help with Calculated Members

    I'm a newbie to SSAS and am having trouble creating a calculated member. My goal is to calculate the number of requests based on status in a specific month/year, however I'd like to enable users to show all amounts on a single report. 
    An excerpt of my cube is as follows:
    FACT REQUESTS
    Measures.Request Count
    DIM STATUS
    Status Description (i.e. Active/Inactive)
    I'd like to create calculated members that will produce the following type of report:
    Month     Year    Total Active    Total Inactive
    Jan          2013      10                    20
    Feb         2013       10                    25
    I previously processed the following code:
    CREATE MEMBER CURRENTCUBE.[Measures].[Total Active Requests]
     AS NULL, VISIBLE = 1;
    Scope [Measures].[Total Active Requests];
    Scope [DIM STATUS].[Status Description].[ACTIVE];
    THIS = SUM ([Measures].[Request Count]);
    END SCOPE;
    END SCOPE; 
    CREATE MEMBER CURRENTCUBE.[Measures].[Total Inactive Requests]
     AS NULL, VISIBLE = 1;
    Scope [Measures].[Total Closed Requests];
    Scope [DIM STATUS].[Status Description].[INACTIVE];
    THIS = SUM ([Measures].[Request Count]);
    END SCOPE;
    END SCOPE;
    However when pulling the values over to the report, the users were unable to see both Active and Inactive at the same time (so I'm guessing Scope isn't the best approach). Is there another method I can follow?  I appreciate any help you can offer.
    Thanks!!

    no need for a scope statement, try the following with 2 different calc measures. 
    IIF(ISERROR([DIM STATUS].[Status Description].&[ACTIVE]), NULL,([DIM
    STATUS].[Status Description].&[ACTIVE],[Measures].[Request Count]))
    IIF(ISERROR([DIM STATUS].[Status Description].&[INACTIVE]),
    NULL,([DIM STATUS].[Status Description].&[INACTIVE],[Measures].[Request
    Count]))
    you can ignore the iif statement, thats just for error handling. 

  • Need help with calculating interest

    Hey im trying to find out where my calculations are screwing up on the interest is coming up wrong but i am unable to find out where. After every month its suppose to be deposit - withdrawl * monthly interest rate and then add that total to the new month etc... any help will be appreciated. Heres my class and test
    public class SavingsAccount
        private double bal;
        private double intRate;
    The constructor initializes an object with a
    balance and an annual interest rate.
    @param bal The account balance.
    @param intRate The annual interest rate.
        public SavingsAccount(double bal, double intRate)
        bal= 0.0;
        intRate = 0.0;
        The withdraw method withdraws an amount from
        the account.
        @param amount The amount to withdraw.
        public void withdraw(double amount)
            bal -= amount;
        The deposit method deposits an amount into
        the account.
        @param amount The amount to deposit.
        public void deposit(double amount)
            bal += amount;
        The addInterest method calculates the monthly
        interest and adds it to the account balance.
        public void addInterest()
        // Get the monthly interest rate.
        // Calculate the last amount of interest earned.
        // Add the interest to the balance.
         intRate = bal * (intRate/12);
         bal += intRate;
        The getBalance method returns the account balance.
        @return The account balance.
        public double getBalance()
        return bal;
        The getInterestRate method returns the annual
        interest rate.
        @return The annual interest rate.
        public double getInterestRate()
        return intRate;
        The getLastInterest method returns the last amount
        of interest earned.
        @return The last amount of interest earned.
        public double getLastInterest()
        return bal;
    import java.util.Scanner;
    import java.text.DecimalFormat;
    public class SavingsAccountTest
        public static void main(String args[])
        // Annual interest rate
           double intRate;
        // Starting balance
           double startBal;
        // Amount of deposits for a month
           double deposit;
           double totalDeposit;
        // Amount withdrawn in a month
           double withdrawn;
           double totalWithdrawn;
        // Interest earned
           double intEarned = 0;
        // Deposit accumulator
           deposit = 0.0;
           totalDeposit = 0.0;
        // Withdrawal accumulator
           withdrawn =0.0;
           totalWithdrawn = 0.0;
        // Months that have passed
           double months;
        // Create a Scanner object for keyboard input.
           Scanner keyboard = new Scanner(System.in);
        // Get the starting balance.
           System.out.println("What is your account's starting balance");
           startBal = keyboard.nextDouble();
           while (startBal < 0)
               startBal=0;
        // Get the annual interest rate.
           System.out.println("What is the annual interest rate?");
           intRate = keyboard.nextDouble();
           while (intRate <= 0 )
               intRate = 0;
        // Create a SavingsAccount object.
           SavingsAccount account = new SavingsAccount(0.0, 0.0);
        // Get the number of months that have passed.
           System.out.println("How many months have passed since the " +
                              "account has opened? ");
           months = keyboard.nextDouble();
           while (months <= 0)
               months = 1;
        // Get the deposits and withdrawals for each month.
        for (int i = 1; i <= months; i++)
        // Get the deposits.
           System.out.println("Enter the amount deposited during month " + i);
           deposit= keyboard.nextDouble();
           totalDeposit += deposit;
           while (deposit <=0)
               deposit = 0;
        // Get the withdrawals.
           System.out.println("Enter the amount withdrawn during month " + i);
           withdrawn = keyboard.nextDouble();
           totalWithdrawn += withdrawn;
           while (withdrawn <= 0)
               withdrawn = 0;
        // Add the deposits to the account.
           startBal += deposit;
        // Subtract the withdrawals.
           startBal -= withdrawn;
        // Add the monthly interest.
           intRate = startBal * intRate/12;
           startBal += intRate;
        // Accumulate the amount of interest earned.
           intRate += intEarned;
        // Create a DecimalFormat object for formatting output.
        DecimalFormat dollar = new DecimalFormat("#,##0.00");
        // Display the totals and the balance.
        System.out.println("Total deposited: " + dollar.format(totalDeposit));
        System.out.println("Total withdrawn: " + dollar.format(totalWithdrawn));
        System.out.println("Total interest earned: " + dollar.format(intEarned));
        System.out.println("Account balance: " + dollar.format(startBal));
    }

    Ok this is what i have fixed up so far but im still having trouble calculating the interest. Problem1) We were given the skeleton to the class and demo. I cannot figure out what to enter in getLastInterest.(completely lost all i need is hint) 2)When i try to get the Total money deposited and i call the account.deposit(balance) it keeps on giving an error void not allowed. Any help is appreciated
    public class SavingsAccount
        private double balance;
        private double interest;
        private double intEarned;
        The constructor initializes an object with a
        balance and an annual interest rate.
        @param bal The account balance.
        @param intRate The annual interest rate.
        public SavingsAccount(double bal, double intRate)
        balance = bal;
        interest = intRate;
        The withdraw method withdraws an amount from
        the account.
        @param amount The amount to withdraw.
        public void withdraw(double amount)
            balance -= amount;
        The deposit method deposits an amount into
        the account.
        @param amount The amount to deposit.
        public void deposit(double amount)
            balance += amount;
        The addInterest method calculates the monthly
        interest and adds it to the account balance.
        public void addInterest()
        // Get the monthly interest rate.
        // Calculate the last amount of interest earned.
        // Add the interest to the balance.
         interest = balance * (interest/12);
         interest = intEarned;
         balance += interest;
        The getBalance method returns the account balance.
        @return The account balance.
        public double getBalance()
        return balance;
        The getInterestRate method returns the annual
        interest rate.
        @return The annual interest rate.
        public double getInterestRate()
        return interest;
        The getLastInterest method returns the last amount
        of interest earned.
        @return The last amount of interest earned.
        public double getLastInterest()
        return intEarned;
    import java.util.Scanner;
    import java.text.DecimalFormat;
    public class SavingsAccountTest
        public static void main(String args[])
        // Annual interest rate
           double intRate;
        // Starting balance
           double balance;
        // Amount of deposits for a month
           double deposit;    
        // Amount withdrawn in a month
           double withdraw;
        // Interest earned
           double intEarned = 0;
        // Deposit accumulator
           deposit = 0.0;  
        // Withdrawal accumulator
           withdraw =0.0;    
        // Months that have passed
           double months;
        // Create a Scanner object for keyboard input.
           Scanner keyboard = new Scanner(System.in);
        // Get the starting balance.
           System.out.println("What is your account's starting balance");
           balance = keyboard.nextDouble();
           if (balance < 0)
               balance=0;
        // Get the annual interest rate.
           System.out.println("What is the annual interest rate?");
           intRate = keyboard.nextDouble();
           if (intRate <= 0 )
               intRate = 0;
        // Create a SavingsAccount object. Cannot find Symbol!!
           SavingsAccount account = new SavingsAccount(balance,intRate);
        // Get the number of months that have passed.
           System.out.println("How many months have passed since the " +
                              "account has opened? ");
           months = keyboard.nextDouble();
           if (months <= 0)
               months = 1;
        // Get the deposits and withdrawals for each month.
        for (int i = 1; i <= months; i++)
        // Get the deposits.
           System.out.println("Enter the amount deposited during month " + i);
           deposit= keyboard.nextDouble();
           account.deposit(deposit);
           if (deposit <=0)
               deposit = 0;
        // Get the withdrawals.
           System.out.println("Enter the amount withdrawn during month " + i);
           withdraw = keyboard.nextDouble();
           account.withdraw(withdraw);
           if (withdraw <= 0 || withdraw >= balance)
               withdraw = 0;
        // Add the deposits to the account.
           account.deposit(balance);
        // Subtract the withdrawals.
           account.withdraw(balance);
        // Add the monthly interest.
           account.addInterest();
        // Accumulate the amount of interest earned. ????? Wrong
           intRate += intEarned;
        // Create a DecimalFormat object for formatting output.
        DecimalFormat dollar = new DecimalFormat("#,##0.00");
        // Display the totals and the balance.
        System.out.println("Total deposited: " + dollar.format(account.deposit(balance)));
        System.out.println("Total withdrawn: " + dollar.format(account.withdraw(balance)));
        System.out.println("Total interest earned: " + dollar.format(account.addInterest()));
        System.out.println("Account balance: " + dollar.format(account.getBalance()));
    }

  • Need help with calculated fields in Adobe Interactive Forms

    Hi Gurus,
    I have an Adobe Interactive form in which i have radio buttons. Upon selecting any of the radio buttons, value in text box should be changed( Calculqated filedS). How i can achieve this?
    Regards,
    Srini
    Moderator message: wrong forum, please post again in Adobe Interactive Forms, but always try yourself before asking.
    Edited by: Thomas Zloch on Jul 13, 2010 11:58 AM

    Hi Tapan
    No, it's working ,with  one remark.
    I've done a mistake, in the final formula. The logic remain the same! ;)
     The calculation values for second column ( COL2 ) are 1,2,3 and not 0,1,2 as I wrote  before and as for COL1 are so the formula is
    =3*if(COL1="ABC",0,IF(COL1="DEF",1,2)+if(COL2="RST",1,IF(COL2="YYZ",2,3)
    and not
    =3*if(COL1="ABC",0,IF(COL1="DEF",1,2)+if(COL2="RST",0,IF(COL2="YYZ",1,2)
    I created also a real example  for you, with 2 dif calculation ways . First I created 2 calc_columns for COL1 and COL2 ( CALC_COL1+CALC_COL and after I added both these 2 column , and second way is to calculate directly) .
    Check this image
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • Help with powerbook dimension

    I'm going to DIY a protector for my gf's PB 15. To Powerbook 15" users, could someone helps me with scaling some dimension of your powerbook15 and let me know the sizes? I would like to pay for your kindness if you have a paypal account. The size data I need is L1-L5 indicated in the image below.
    Thanks a lot for your help.
    PB G4 15 Mac OS X (10.4.7)

    Thanks so much Sig, It's really helpful. could you send me your PP account to s8971 AT hotmail.com? I would like to pay for your work as I promised above.
    PB G4 15 Mac OS X (10.4.7)

  • Help with calculations in XMLP Template

    Hi,
    I would like to get some guidance on how the below could be done in XMLP. I am getting the 'Amount' column from FSG and would like to calculate the percentage in the template. Is it possible to calculate rows and store results in column like in the example below in XMLP? Many thanks for your help.
    Type-------Amount-----%
    Gross-----------10-----166.7 (Gross/Net*100)
    Discount---------4-------66.7 (Discount/Net*100)
    ======================
    Net (G-D)--------6-----100.0 (Net/Net*100) or (Gross% - Discount%)

    Hi Hazan,
    I have done a similar Gross Margin Report using XMLP 5.5.
    I have used the concept of variables to store temporary values in my report and carry out complex calculations.
    Please let me know what version of XMLP are you using?
    Some of my form fields containing variables look like this:
    <?xdoxslt:set_variable($_XDOCTX, ’Sum1’, CS_TCOST + CS_TCOST1)?>
    <?xdoxslt:get_variable($_XDOCTX, ’Sno’ )?> <?xdoxslt:set_variable($_XDOCTX, ’Sno’, xdoxslt:get_variable($_XDOCTX, ’Sno’) + 1)?>
    <?xdofx:if(CS_TSELL + CS_TSELL1) <= 0 then
    xdoxslt:set_variable($_XDOCTX, ’Sum1’, 1)
    end if?>
    I am not sure if you are looking at this or not. Do let me know if this solves the purpose and need be required some help :-o)
    HTH,
    Nitin

  • Help with calculation code!! for Times tables program

    I am creating a times tables program that lets the user select the Times tables, number of lines required and the type of table (multipy, addition etc).
    So if user selects 12 times tables and 4 lines it should look like this on the screen:
    12 x 1 = 12
    12 x 2 = 24
    12 x 3 = 36
    12 x 4 = 48
    and so on...
    Problem is that when I pass the info to the procedure in the below code I am not sure what I need to do to replicate the above.
    Appreciate some ideas! Here is code so far:
    class assign2{                                                                                                         // Begin Class
         public static void main(String[]args){                                                                      // Begin Main
              int table;                                                                                                    // Declare a variable
              int lines;                                                                                                    // Declare a variable
              char type;                                                                                                    // Declare a variable
              do                                                                                                              // Begin do - while loop
                   System.out.println("Please enter the times tables required (1 - 12)");
                   Keyboard.skipLine();
                   table = Keyboard.readInt();
                   if (table < 1 || table > 12)
                   System.out.print("INVALID ENTRY - Please try again and enter between 1 and 12");    // Error msg if invalid
                   System.out.println();
            }while (table < 1 || table > 12);                                                                      // End do - while loop
            do                                                                                                              // Begin do - while loop
                 System.out.println("Please enter the number of lines required (1 - 12)");
                 Keyboard.skipLine();
                 lines = Keyboard.readInt();
                   if (lines < 1 || lines > 12)
                   System.out.print("INVALID ENTRY - Please try again and enter between 1 and 12");    // Error msg if invalid
                   System.out.println();
            }while (lines < 1 || lines > 12);                                                                      // End do - while loop
              do                                                                                                              // Begin do - while loop
                   System.out.println("Please select the table type from one of the following (A - D): ");
                   System.out.println();
                   System.out.println("A: Multiplication Tables");
                   System.out.println("B: Division Tables");
                   System.out.println("C: Addition Tables");
                   System.out.println("D: Subtraction Tables");
                   Keyboard.skipLine();
                   type = Keyboard.readChar();
                   if (type != 'a' && type != 'b' && type != 'c' && type != 'd')
                   System.out.print("INVALID ENTRY - Please try again and enter either A - B - C - D");      // Error msg if invalid
                   System.out.println();
              }while (type != 'a' && type != 'b' && type != 'c' && type != 'd');                              // End do - while loop
                   switch(type){                                                                                          // Begin Switch
                        case 'a': getMultiply(table, lines); break;
                        case 'b': getDivide(); break;
                        case 'c': getAdd(); break;
                        case 'd': getSubtract(); break;
                   }                                                                                                         // End Switch
       //Procedure to calculate the Multiplication Times Tables//
              static void getMultiply(int table, int lines){
       //Procedure to calculate the Division Times Tables//
              static void getDivide(){
                   System.out.println("This is divide!!!");
       //Procedure to calculate the Addition Times Tables//
              static void getAdd(){
                   System.out.println("This is Add!!!");
       //Procedure to calculate the Subtraction Times Tables//
              static void getSubtract(){
                   System.out.println("This is Subtract!!!");
         }                                                                                                              // Ends Main
    }                                                                                                                   // Ends Class

    I wasn't being rudeYes, you were.
    or expecting an immediate
    responseYour posts suggested otherwise.
    I was simply expressing how I was stuck with
    the problem.That's not relevant to anybody here. What is relevant is your specific question, which I don't see in your initial post. Just "how do I do this?"
    You know what, I am a beginner to this programming
    and it's people like you with your smug attitute and
    'KNOW IT ALL' behaviour that puts people like me off
    even looking to go down this road as a career.Given your attitude so far, I doubt you'll be missed.
    So, why don't you stop acting like a spoilt little
    child and stop pretending like you own this forum.Flounder was right: Nobody here likes that demanding, "Help me now!" attitude. Coupled with the fact that your question is very vague and the tone of your subsequent posts, you're not doing much to encourage anyone to volunteer their time to help you.
    Not to mention that posting the same question multiple times is rude and annoying. It's very irritating to spend time answering a question, only to find out somebody else has already answered it.

  • Help with Time Dimensions

    Hi,
    I am trying to create a Time Dimension using the Wizard, but I want to add certain fields to the dimension like Month Ago, Week Ago, Quarter Ago, etc. What are the steps to do this?
    Also, is it possible to combine Fiscal and Calendar year into the same dimension?
    Thanks

    Gurus, anybody anything on this one??
    I haave done a small adjustment in the dimension order by which I have eliminated the following error:
    Record #40 - Error adding Dynamic calc property to member xxxxxxxxx (3320)
    Record #40 - No time dimension defined
    But, I have the following new error/warning (cube build successfull in this case) when I made this adjustment:
    Record #427 - Error adding Attribute to member PATB4_ADJ-PDA (3320)
    The adjustment I made is... I moved TIME dimension up and ACCOUNT dimension below that...so the order I have now is TIME,ACCOUNT,SCENATRIO,XXX,XXXX instead of ACCOUNT,TIME,SCENARIO,XXX,XXXXX ..*would this create any performance issues?*

Maybe you are looking for

  • Windows XP, iTunes 11: iPod cannot be synced because it cannot be found.

    I recently had to restore my iPod Video (circa 2007) after dropping it.  Now it will not sync, and I get the error message "The iPod cannot be synced because it cannot be found." Sometimes it says "the required file cannot be found" instead.  This ha

  • @ adding leading zeros to a number

    Hi, How do I go abt adding leading zeros to a 8- digit number? eg DATA: number(8) Type N.     number = 16. How do i go about converting this to '00000016'. Note that the value in variable number would be read frm a file (Inbound prog).

  • Embedding XML in XML for writing to database

    I am creating a BPEL process in Oracle BPEL Manager 10.1.2.0.2 which will read an XML file using a file adapter, perform some XPath operations on the document to obtain attribute values from its content, then write those values and the document itsel

  • Able to execute a query in TOAD but can't ceate explain plan

    Hi, I can execute a query in TOAD which uses table from other schema. I have created the synonym and given the rights on it. But when I try to create explain plan using TOAD: I get Ora-00942:Table or view does not exist. Any suggestions.. Thanks..

  • Automator Problem

    Hi there, I have been trying to figure this out today and yesterday and have had no luck, please help if you can! I have an excel sheet of 15,000 image file names: eg 10010001.jpg, 10010002.jpg etc I also have a folder of 42,000 images named using th