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. 

Similar Messages

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

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

  • 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 calculating expiration date

    Hi Microsoft Access community.
    I am trying to automatically set the expiration date in my table each time new data is entered which is +10 months -1 Day. My field name is called 'Best Before Date:', Data Type is called Date/Time, Format is set to 'Short Date' and under the Default
    Value field property I have two expressions I am trying to input.
    =DateAdd("m",10,Date())
    =DateAdd("y",-1,Date())
    These expressions work for me only when they are input separately. My issue is that I want to combine these two expressions but I don't know how.
    If anyone has any ideas of how to accomplish this task best please do help.
    Thanks
    sNiPel2

    They'll help you over here.
    http://answers.microsoft.com/en-us/office/forum/access?sort=lastreplydate&dir=desc&tab=Threads&status=&mod=&modAge=&advFil=&postedAfter=&postedBefore=&threadType=All&tm=1426425719481
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • Help with calculating fractions in a program...

    I'm supposed to declare to fractions and then add, subtract, mulitply, and divide them.
    (3, 4)
    (2, 3)
    The outcome is supposed to look like this...
    Number 1 is 3/4
    Number 2 is 2/3
    Reciprocal of 3/4 is 4/3
    Reciprocal of 2/3 is 3/2
    3/4 + 2/3 is 17/12
    3/4 - 2/3 is 1/12
    3/4 * 2/3 is 6/12
    3/4 divided by 2/3 is 9/8
    And I have my Fraction class all figured out, but I'm not sure how to display the calculations in the main part of my program.
    Here is my fraction class
    public class Fraction {
         private int numerator;
         private int denominator;
         //Constructor method     
         public Fraction(int n, int d) {
              numerator = n;
              denominator = d;
    //Returns the fractions numerator
         public int getNumerator() {
              return numerator;
    //Returns the fractions denominator
         public int getDenominator() {
              return denominator;
    //Returns the fractions reciprocal
         public Fraction reciprocal() {
              //Declare the local variables
              int newNumerator;
              int newDenominator;
              int tempNumerator;
              int tempDenominator;
              //Swap the two values
              newNumerator = denominator
              newDenominator = numerator;
              //Return a new Fraction as the reciprocal
              return new Fraction(newNumerator, newDenominator);     
    //Returns a string representing numerator/denominator
         public String toString() {
              return (numerator + "/" + denominator);
         public Fraction add(Fraction f2) {
              tempNumerator = (numerator * number2.getDenominator()) + (denominator * number2.getNumerator());
              tempDenominator = (denominator * number2.getNumerator());
              return new Fraction (tempNumerator, tempDenominator);
         public Fraction subtract(Fraction f2) {
              tempNumerator = (numerator * number2.getDenominator()) - (denominator * number2.getNumerator());
              tempDenominator = (denominator * number2.getDenominator());
              return new Fraction (tempNumerator, tempDenominator);
         public Fraction multiply(Fraction f2) {
    tempNumerator = (numerator * number2.getNumerator());
    tempDenominator = (denominator * number2.getDenominator());
    return new Fraction (tempNumerator, tempDenominator);
         public Fraction divide(Fraction f2) {
              tempNumerator = (numerator * number2.getDenominator());
              tempDenominator = (denominator * number2.getNumerator());
              return new Fraction (tempNumerator, tempDenominator);
    }

    You've got the Fraction class already written and it looks not too bad. Probably there's some bugs, and it won't compile, but that's not your question. Are you saying you have written a Java class, but you don't know how to write a main program to use that class?
    Okay, let's suppose you want to get the following output:
    Number 1 is 3/4
    Reciprocal of 3/4 is 4/3
    Then your program would look something like this:public class FractionTest {
      public static void main(String[] args) {
        Fraction f1 = new Fraction(3, 4);
        System.out.println("Number 1 is " + f1);
        System.out.println("Reciprocal of " + f1 + " is " + f1.reciprocal());
    }

  • SQL help with calculation uptime from event logs

    Hi guys,
    I'm able to retrieve uptime/downtime info from the eventlogs using the 6005, 6006 events. I just realized that there are cases (dirty shutdowns) where there may not be a shutdown (6006) logged. There will be a 6008 message logged though. I am kinda stumped as to how to match up the 6006 and 6005 messages now to calculate uptime as there might be a few more 6005 messages than 6006. Any ideas. Here's what I have so far: I'm querying the MOM reporting database.
    select t1.computername ServerName,
    t1.computerdomain ComputerDomain,
    t1.timegenerated ShutdownTime,
    (select min(t2.TimeGenerated) from SDKEventView t2
    where t1.ComputerName = t2.computername
    and NTEventID = 6005
    and t2.timegenerated >= t1.TimeGenerated) StartupTime,
    datediff(minute,t1.TimeGenerated, (select min(t2.TimeGenerated) from SDKEventView t2
    where t1.ComputerName = t2.computername
    and NTEventID = 6005
    and t2.timegenerated >= t1.TimeGenerated)) Downtime
    from SDKEventView t1
    where t1.NTEventID = 6006
    and t1.timeGenerated between '5/1/2005 12:00:00.000 AM' and '5/2/2006 12:00:00.000 AM'
    and t1.computername in (select name from sdkcomputerview where name like '%FLK%')
    order by Downtime

    What I would do is create a class with the stored procedure call as one of the methods:
    Class Accessor()
      public UsrObject getUser(String loginId)
         //put stored procedure here>
         //after getting data from database, put into an
         // object you define (ie: UsrObject)
         return UsrObject
    }You have a couple of other issues you need to address (and they may already be taken care of)
    You need to decided if this is a 2-tier or 3-tier architecture. Are you accessing the database directly without going through a middle tier?

  • Help with calculation by level

    I have ref cursor like this (I can not put this into a view because of business logic.)
    OPEN X_CURSOR FOR
    SELECT i.col1, i.col2, i.col3, mil.col,
           COUNT(ol.col4) "COL_HITS",
           SUM(ol.col4) "USAGE",
           MAX(oh.col5) "LAST_DATE"
      FROM oh, ol, i, l, mil, M
    WHERE oh.col1 = i.col1 ......
       AND m.code = p_sales
    GROUP BY i.col1, i.col2, i.col3, mil.col;I need to add two columns to above select statement:
    * Percentage of per "col_hits" field in Sum of the "col_hits" - as HITS_PERCENTAGE
    ** Pareto (cumulative SUM) of the "hits_percentage" - as PARETO OF HITS
    For example:
    COL_HITS          HITS_PERCENTAGE          PARETO OF HITS
    16          40.00%                          40.00%
    12          30.00%                          70.00%
    8          20.00%                          90.00%
    2          5.00%                          95.00%
    2          5.00%                          100.00%any idea what's the best way to do this calculation? Thank you.

    Hi,
    This sounds like a job for analyrtic functions.
    On your existing results, do a query like this:
    SELECT  ...
    ,     100 * RATIO_TO_REPORT (col_hits) OVER ()     AS hits_percentage
    ,     100 * SUM (col_hits) OVER (ORDER BY col_hits DESC, col1) -- See note below
             / SUM (col_hits) OVER ()                        AS pareto_of_hitsSince col_hits is not unique, you need a tie-breaker in the ORDER BY clause, so that, for example, your two last rows of output:
    2          5.00%                          95.00%
    2          5.00%                          100.00%will have 95 and 100 in the last column, rather than both having 100. I picked col1, quite arbitrarily. Instead of col1, you can use any column or lcolumns (such as col1, col2, col3).

  • Help With Calculating Two Fields In JDBC

    Hi, I'm doing a library system, i have a field called totalfine and need it to sum up 5 values each called fine1 till fine5.
    And each fine is supposed to calculate a seperate value based on the date and month, e.g $.20 for each day based on the difference of date borrowed and date returned.
    This is part of my codes,
    public void actionPerformed( ActionEvent e )
    try {
    Statement statement = connection.createStatement();
    if ( ! fields.transactionID.getText().equals( "" ) ) {
    String query = "UPDATE transaction SET " +
    "libraryID='" + fields.libraryID.getText() +
    "', serialno1='" + fields.serialno1.getText() +
    "', itemtype1='" + fields.itemtype1.getText() +
    "', dateborrowed1='" + fields.dateborrowed1.getText() +
    "', monthborrowed1='" + fields.monthborrowed1.getText() +
    "', datereturned1='" + fields.datereturned1.getText() +
    "', monthreturned1='" + fields.monthreturned1.getText() +
    "', fine1='" + fields.fine1.getText() +
    "', serialno5='" + fields.serialno5.getText() +
    "', itemtype5='" + fields.itemtype5.getText() +
    "', dateborrowed5='" + fields.dateborrowed5.getText() +
    "', monthborrowed5='" + fields.monthborrowed5.getText() +
    "', datereturned5='" + fields.datereturned5.getText() +
    "', monthreturned5='" + fields.monthreturned5.getText() +
    "', fine5='" + fields.fine5.getText() +
    "', totalfine=fine1+fine2+fine3+fine4+fine5 '" +
    "' WHERE transactionID=" + fields.transactionID.getText();
    output.append( "\nSending query: " +
    connection.nativeSQL( query ) + "\n" );
    Hope, you can help as im a newbie.
    thanks,
    Josie

    Sorry about that poor explanation, hope this is more clear;
    a person is allowed to borrow up to 5 books each, for each late book returned, there is an individual fine, fine1 for book1, fine2 for book2 and so on.
    the program will have to generate the Totalfine, which is the sum of fine1+fine2+fine3+fine4+fine5
    and each fine is supposed to be automatically generated based on the number of days extra the book has been borrowed. for example, say the duration allowed is 7 days, but it has been returned on the 10th day, the fine for that particular book would be $0.20*3 .
    there is a syntax error for the total fine when i run the applet.
    hope you can help,
    Thanks

  • Help on renaming members

    Hi, I would need some help with changing members name in Planning 9.3.1.
    We have tried to change some members names (members of Employees and Business Lines dimensions). After doing that, the database didn't want to refresh sending us to the log (that was not enabled). However, the member names were changed after this to the new formats but most of the forms were not showing data anymore. We tried to change back the names to the old ones. Database didn't refresh again but the names were changed to the original. Forms still didn't show data.
    I am interested on how I could recover the data and also what is the "Oracle politically correct" way of changing names of the members (we got new catalogs and need to change the names accordingly).
    I would appreciate a quick answer, thank you, as the user made the changes in production environment and the wrath of God might come upon us soon if we fail the noble recovery quest :)

    JohnGoodwin wrote:
    Hi,
    Your best option is going to backup, as it is a production system I would assume you have a recent backup.
    You should be able to change member names and refresh without any issues.
    I would go back to backup (enable logging)
    Then try renaming just one member and refreshing.
    If these are dense member changes remember the blocks and index of the data have to be rebuilt
    Depending on the amount of changes and size of data sometimes it is good practice to export the data, clear the db, make the changes, refresh and then import the data back in.
    Then try more.
    Cheers
    John
    http://john-goodwin.blogspot.com/
    John,
    Can you really load back the data backup after you made changes on dimension member names?
    Cheers,
    Alp

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

Maybe you are looking for

  • After Upgrading to IOS 5.1 I am having issues connecting to the WIFI

    After updating to IOS 5.1 i am having ptoblems connectng to the WIFI. If I reboot my wireless route it will connect Without the reboot it will just set and search. My wife's phone is running 4.2.1 and connects everytime. Can I back out of the upgrade

  • 8.1.7 Installer load failure

    - Server name - Filename : Win817Client.zip - Date: 2/25/02 11:45 - Broswer: Internet Explore (5) - OS: Win 2000 - none AutoRun window pops-up, but when I click on the install/deinstall button, hour glass shows momentarily but never get LOADING splas

  • Link DIR's in MAC

    Greetings, I'm not a wiz on code, but I try and I need some help please. I'm building a hybrid CD to play on both PC & MAC and some of my links will open a new Director movie located in a subfolder. When I publish for both PC & MAC it works fine on a

  • Hi, everyone, how to add subject of the email by which my smartform is sent

    I use the three interface parameters in smartform including mail_recepient_obj, mail_sender_obj, and mail_app_obj, and I use three function modules to import the three objects, does anyone know that which I should give value to to make the subject I

  • Complex FM with PLL

    Hi All! I've found example of PLL FM demodulation by T.J.Moir http://decibel.ni.com/content/docs/DOC-1101;jsessionid=82a40f1a30d6b414f9c6b27d40eca1b8b6f16bb38b32....  I tried to to demodulate my own signal which contains two Sine harmonics as a messa