Simple  Fact Calculation Help

Hi Team
I need help in creating a simple fact calculation. I need to create a fact column that should give the lastest transaction amount , if the type of the transacion is "DEBIT". for example if there 100 transactions are there, and out of that only 25 are DEBIT Transaction, I need the amount of the last (Most recent date's) DEBIT Transaction.
Please help me, what should be the calculation and the aggrecate setting of that fact column.
Our version is OBIEE 10.1.3.4.1
Thanks a lot for the help
With Regards
Bas

The analytics function that yo search is last.
Check here:
http://gerardnico.com/wiki/dat/obiee/last_first
Try to apply the last on only one dimension (ie time dimension) otherwise it can take a lot of time. Check the bad performance section of the article.
Cheers
Nico

Similar Messages

  • I am using Numbers on my iPhone5 and cannot get the app to do a simple (SUM) calculation.  It shows the formula correctly in the cell, but all I get for my long list of numbers to add is 0.  How can I get this to work?

    I am using Numbers on my iPhone5 and cannot get the app to do a simple (SUM) calculation.  It shows the formula correctly in the cell, but all I get for my long list of numbers to add is 0.  How can I get this to work?

    Oaky, at least we got that far.  Next step is to determine if all those "numbers" are really numbers.  Changing the format to "number" doesn't necessarily change the string to a number. The string has to be in the form of a number.  Some may appear to you and me as numbers but will not turn into "numbers" when you change the formatting from Text to Number. Unless you've manually formatted the cells to be right justified, one way to tell if it is text or a number is the justification. Text will be justified to the left, numbers will be justified to the right.
    Here are some that will remain as strings:
    +123
    123 with a space after it.
    .123

  • Hi when I stream video content to my Tv using Apple from my Ipad3 I find the Ipad goes to sleep after 2/3 minutes and disconects, the only way I have found to stop this is to continually tap the Ipad screen but there has to be a simpler method/ any help

    Hi when I stream video content to my Tv using Apple tv from my Ipad3 I find the Ipad goes to sleep after 2/3 minutes and disconects, the only way I have found to stop this is to continually tap the Ipad screen but there has to be a simpler method/ any help would be most welcome.

    Welcome to the Apple Community.
    Contact the developer of the Air Video app.

  • I am un able to send mail as it gets stuck in my outbox. I am sure the solution is simple but need help?

    I am un able to send mail as it gets stuck in my outbox. This is a recent phenomena. I am sure the solution is simple but need help?

    I looked everywhere for a solution - and I finally figured it out! Deleting my accounts didn't work, but here is what worked. This worked when my Gmail accounts were not sending properly. I'm not sure if it works for other e-mail services.
    1. While in Mac Mail, click "Mail" in the top left corner of the screen
    2. Click "Preferences"
    3. Click "Accounts"
    4. Select your account that isn't sending properly
    5. In "Outgoing Mail Server (SMTP)" there will be two options - Gmail & Gmail (offline)
    Make sure that "Gmail" is selected and NOT "Gmail (offline)"
    If you navigate to another section in Preferences, it will ask you to SAVE - make sure you save your changes!
    It worked for me, hope it works for you!

  • Simple Graphing Calculator with 2D array

    Hello,
    I am building a simple graphing calculator which reads in coefficients from a txt file. All is going well except when I plot the points, the graph is at the corner of the screen and sideways. As we all know, the origin of the array is at the top right corner, so how do I transform/slide it so that it is at the xy origin? Code is posted below, thanks!
    import javax.swing.*;
    import java.awt.*;
    public class baseClass extends JFrame{
         private shapesPanel panel;
         public baseClass(String title){
              panel = new shapesPanel();
              setTitle(title);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              getContentPane().add(panel);
              pack();
              setVisible(true);
         public void drawLine(int x1, int y1, int x2, int y2){
              panel.addLine((short)x1,(short)y1,(short)x2,(short)y2);
              panel.repaint();
         public void drawDot(int x, int y){
              panel.addOval((short)x,(short)y,(short)1,(short)1);
              panel.repaint();
         private class shapesPanel extends JPanel{
              final private short max = 10000;
              private short[][] lines, ovals;
              private int numLines, numOvals;
              public shapesPanel(){
                   setBackground(Color.white);
                   setPreferredSize (new Dimension(500,500));
                   lines = new short[max][4];
                   ovals = new short[max][4];
                   numLines = 0;
                   numOvals = 0;
              public void paintComponent(Graphics g){
                   super.paintComponent(g);
                   g.setColor(new Color(0,0,255));
                   for(int i = 0; i < numLines;++i){
                        g.drawLine(lines[0],lines[i][1],lines[i][2],lines[i][3]);
                   g.setColor(new Color(255,0,0));
                   for(int i = 0; i < numOvals;++i){
                        g.drawOval(ovals[i][0],ovals[i][1],ovals[i][2],ovals[i][3]);
              public void addLine(short x1, short y1, short x2, short y2){
                   lines[numLines][0] = x1;
                   lines[numLines][1] = y1;
                   lines[numLines][2] = x2;
                   lines[numLines][3] = y2;
                   ++numLines;
              public void addOval(short x, short y, short w, short h){
                   ovals[numOvals][0] = x;
                   ovals[numOvals][1] = y;
                   ovals[numOvals][2] = w;
                   ovals[numOvals][3] = h;
                   ++numOvals;
    import java.util.Scanner;
    import java.io.*;
    public class graphingCalculator extends baseClass{
         // CONTAINS THE FOUR FUNCTION COEFFICIENTS
         private double[] theFunction;
    // CONTAINS THE DISCRETE FUNCTION PLOT
    private boolean[][] grid;
    // SIZE OF THE COORDINATE SYSTEM
    private final int columns = 500, rows = 500;
    public graphingCalculator(String filename) throws IOException{
         // INITIALIZATIONS ///////////////////////////////////////
    super("GRAPHING CALCULATOR");
    theFunction = new double[4];
         grid = new boolean[rows][columns];
    for(int i = 0;i<rows;++i){
    for(int j = 0;j<columns;++j){
    grid[i][j] = false;
    // DRAW THE COORDINATE SYSTEM ON THE SCREEN /////////////
    drawLine(0,250,500,250);
    drawLine(250,0,250,500);
    for(int i = 0; i < columns;i+=20){
    drawLine(i,247,i,253);
    for(int i = 0; i < rows;i+=20){
    drawLine(247,i,253,i);
    // GET THE FUNCTION COEFFICIENTS ///////////////////////
    // theFunction[0] will have the x^3 coefficient
    // theFunction[1] will have the x^2 coefficient
    // theFunction[2] will have the x^1 coefficient
    // theFunction[3] will have the x^0 coefficient
    Scanner scan1 = new Scanner(new File(filename));
    for(int i=0;i<4;++i){
         theFunction[i] = scan1.nextDouble();
    scan1.close();
    // DRAW THE FUNCTION ////////////////////////////////////
    computeGrid();
    drawDiscrete();
    drawContinuous();
    private double computeFunction(int x)
         double a=theFunction[0];
         double b=theFunction[1];
         double c=theFunction[2];
         double d=theFunction[3];
         double answer=(a*Math.pow(x,3.0)+b*Math.pow(x,2.0)+c*Math.pow(x,1.0)+d*Math.pow(x,0.0));
         return answer;
    private void computeGrid()
              // Populate the 'grid' array with true values that correspond
              // to the discrete function.
              // The 'grid' array is the internal representation of the function
         for(int x=0; x<columns; x++)
                   if(computeFunction(x)>=0&&computeFunction(x)<500)
                   grid[(int)computeFunction(x)][x]=true;
    private void drawDiscrete()
              // Use drawDot(x,y) to draw the discrete version of the function
         for(int x=0;x<columns;x++)
              for(int j=0;j<rows;j++)
         if(grid[x][j])
              drawDot(x,j);
    private void drawContinuous()
              // Use drawLine(x1,y1,x2,y2) to draw the continuous version of the function

    Rest of code:
    import java.util.Scanner;
    import java.io.*;
    public class Main {
        public static void main(String[] args) throws IOException{
        String infile;
        Scanner scan = new Scanner(System.in);
        // The input file should have 4 doubles in it
        // corresponding to the 4 coefficients of a cubic function.
        // A GOOD EXAMPLE:
        //                  0.01
        //                  0.0
        //                  -5.0
        //                          50.0
        // CORRESPONDS TO FUNCTION: 0.01*X^3 - 5.0*X + 50.0       
        // ANOTHER GOOD EXAMPLE:
        //                  0.0
        //                  0.01
        //                  -1.0
        //                          -100.0
        // CORRESPONDS TO FUNCTION: 0.01*X^2 - X - 100.0       
        System.out.println("Please enter filename of input file: ");
        infile = scan.next();
        graphingCalculator cal = new graphingCalculator(infile);
    }

  • Can someone help me with a simple duration calculation?

    I created a simple workbook for calculating hours worked. I am entering the start time, end time, and using the DUR2HOURS formula to calculate the duration. For some reason the calculation is wrong. I am sure it is somethign simple, but I could not find an answer and it has been bothering me for a couple of days now. Here is an example of what is happening:
    Start Time     |     End Time     |     Duration
    7:15 AM               5:30 PM               10.25  (formula: =DUR2HOURS(ENDTIME - STARTTIME)
    The duration in this example should be 10.15?
    Thanks,
    Nate

    Hi NorthrailDrive,
    DUR2HOURS gives the value in decimal hours, not hours:minutes.
    Your answer (in decimal hours) is correct (10.25, or ten and a quarter hours).
    Cell C2 contains the formula you need to calculate a duration:
    =B2-A2
    C2 is formatted as Duration h (hours) m (minutes). You can change the display to show 10:15
    Regards,
    Ian.

  • Help with simple Javascript calculation please

    Hello, I've created a form for my company that contains measurements in meters for shipping.  I need to have the total of the measurement appear in the cube/M3 field.  For example, 6.17*3.02*3.35 returns NaN - it should return 62.42.  My fields are called Measure1Row and CubeM31Row.  This field will also be calculated as a total which I had no problem setting up. Under simplified field notation I entered = Measure1Row and it didn't work.  I also tried Measure1Row * 1.  Can someone please help me out?  Thanks so much!

    Hi George,
    I want the product of this measurement 6.17*3.02*3.35 (in meters) to appear in theCubeM31Row.  There are only 2 fields that are affected by this calculation - Measurement and Cube/M3.  The form fields are Qty, Commodity, Measurements, lbs, kgs and Cube/M31Row.  The measurement appears in one field - the other fields contain calculations that match and produce the correct answer.  Does that help?  I'm stumped.

  • Very simple calculation help needed.

    I am a non-techie person being tasked with creating a form. Java? Thats coffee right?
    see what I mean .
    Anyway I need to have a form calculate the difference between two dollar amounts.
    They are: Previous Check Amount ____________
                     Current Check Amount   __________
                     Difference(+/-) _____________
    I looked at doing the calculation via the value field on the calculate tab. But I see I cannot do that unless I choose the Custom Calculation Script and writing it myself. I am not sure how to do that. If I could send cookies to my savior I would.
    Thanks!!

    Gilad,
    Thanks for the reply,
    The fields are "Previous Check Amount" and "Current Check Amount" and I need to calculate whatever (+/-) difference there would be between the two......

  • PDF form field calculation help needed

    I need to make some simple calculations on a pdf form and need some help.
    I have a form field for number of guests.
    A field for a set cost for various tickets (there are 3 levels of ticket prices) (I might not need this field).
    A subtotal of the guests attending and ticket price.
    A grand total of the subtotals.
    I can't figure out how to either put in a fixed cost in a form field or input a calculation so that the number of tickets is muliplied by a fixed number and gives me a subtotal.
    Thanks.

    Ok. I finally got the calculations to work. But..... when I save and open in Reader, they don't work. Go back to Pro, they don't work there now either. They also don't show up under the Set Field Order Calculations. To reset them, i have to erase the calculations, save, redo the calculations. Preview the form and everything works — calculations happen and i get a total.
    Adobe Reader usage rights are enabled.
    Why is this so hard?
    I found this thread http://forums.adobe.com/message/1152890#1152890 about it. Is this bug still going on since 2009?
    Ok. Apparently you have to enable reader rights after the form is done. It seems to work now. What a pain.

  • Calculations Help Needed

    Here is the situation:
    I am doing a quick "play around" between Pages/Word, Numbers/Excel and Keynote/Powerpoint.
    This is to refresh my memory to windows, since I am going into a short-term (5 - 7 or 8 years) of IT.
    I need help with calculating the average time of sunrise for one week, using two sheets.
    The times given are 5:40am, 5:41am, ........ 5:46am. The cells: B5 - B11 (Sunrise Column for week 1). The name for this sheet is "Weekly".
    The equation is going to be place in cell B5 of sheet named "Monthly" representing the average time of sunrise for that week.
    In excell, I understand "Weekly!B3" refers to cell B3 on worksheet "Weekly".
    How would I do this in numbers? (I will figure out how to do it in Excell.)
    Thanks again guys (and ladies)!

    In fact, the problem is not the one which you described.
    The way to reference a cell or a range of cell is perfectly described in iWork Formula and Functions User Guide in which every user may get it.
    The important thing to know is that in NumbersLand, 5:40am isn't a time value but a date_time one.
    In the tables above, I deliberately choose to insert time values entered at different dates so, the formula inserted in Monthly :: B5
    =AVERAGE(Weekly :: B5:B11)
    return an exact result which doesn't match what we are wanting to get.
    This is why I used the auxiliary column C
    In Weekly :: C5, the formula is :
    =TIMEVALUE(B)
    Apply Fill Down to insert the formula in rows below.
    The formula returns the time value using the unit day.
    In Monthly // C5, the formula is :
    =AVERAGE(Weekly :: C5:C11)
    but I guess that you don't wish to get the result in this format.
    In Monthly // D5, the formula is :
    =DURATION(0,AVERAGE(Weekly :: C5:C11))
    You may edit the format of this duration cell as you want.
    An alternate formula would be :
    =TIME(,AVERAGE(Weekly :: C5:C11)*24*60,)
    But CAUTION, one more time, as you may see, the cell will contain a date component.
    Yvan KOENIG (VALLAURIS, France) vendredi 27 mai 2011 12:20:15
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.7
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • Simple percentage calculation

    Hello,
    i am new to Numbers...i need to do something i think is very simple, but still can't figure out how to...
    Basically i need to have a calculation of percentage.
    Say in cell B2 i have a certain value, i would like to have cell C2 that calculate B2 value + the 20% of B2 value.
    Would it be possible? Which formula should i use?
    Or would i need to set C2 only as percentage value (20%), then set a SUM (B2+C2) formula in D2?
    I've actually already tried all this, but i must make some formula editing errors...
    Appreciate your help.
    Max

    Either if these will do the job:
    =B+B*0.2
    =B*1.2
    "20 percent" is just a 'fancy' way of saying "20/100", and "20/100" expressed as a decimal is "0.20"
    =B+B*20%
    This will also work, but you will need to set the cell's format to display the result as a number. Set to Automatic, the cell will choose Percent to display the result.
    Regards,
    Barry

  • Currency Calculations Help Please

    I have been searching for the past 2 days and have not found a usable solution.
    We are working with us currency, or example problem is $1350.50
    Text1 = 1350.50
    Text2 = (Text1*0.25)
    Which is 337.625 but displays with 2 decimal places 337.63
    Text3 = (Text1-Text2)
    Which is 1012.875 but displays with decimal places 1012.88
    of which the total now equals 1350.51
    We are using Acrobat 8 Professional, I am using the text field tool to populate data on the form, and simple calculations for my math.

    Rounding to 2 decimal places makes it only show that the total is 337.63, the actual total is 337.625 which is used in the math calculation.
    I have a form I am trying to ID 10 T proof, they put in one number and the pdf calculates the other 2.  The first calculated amount is 25% of the total amount, the second calculated amount is the difference of the number input and the 25%.
    The currency problem starts with TOTAL $1350.50
    Does that help?

  • Simple math calculation in numbers

    Hi I'm trying to do a simple calculation of 46.66*2 in numbers and i get a red triangle saying syntax error. Any light on this as what is wrong.

    Hi Fuija,
    Happy to help, and strangely enough, I just got a fresh cup of coffee.
    Most issues are easier to solve when enough information is presented. Keep that in mind when you have another question.
    As to using , as the decimal separator, it's not a Mac thing. That's dependent on where you live and what regional settings you've made in System Preferences. If you'd normally write ten thousand four hundred twenty-three and five hundredths like this:
    10,423.05
    Then your regional settings for numbers should show 1,234.56
    and you should use a period as the decimal separator.
    If you'd normally write that number this way:
    10.423,05
    Then your regional settings for numbers should show 1.234,56
    and you should use a comma as the decimal separator.
    Pick whichever region is set to use the same separators as you would use when writing the number with pencil on paper.
    Regards,
    Barry

  • REPORT CALCULATION HELP NEEDED!!!

    Hello
    I have a report where i need to do some calculation .
    I have 3 columns in my report Businesstype , Business Code & Fact . When i display the report i see the Business Code 1 - Business Code 5 in 5 rows . But sometimes the report contains Business Code 6 along with Business Code 1 - Business Code 5 then Business Code 6 needs to calculate SUM(Business Code 1-6) and display in one row .
    Could anybody please leave me any suggestions .

    Hi there,
    Create a table
    - On the first row create for each group to populate the data for Business Code [1-n] with a second column containing numeric values.
    - On the second row use the sum function using current-group() function for the value that you want to calculate the sum for.
    Hope this helps.
    Let me how you get on.
    cheers...

  • BPS Layout formatting looks simple but tricky - Help

    Hi ,
    Created a layout with the below charaterstics and Month1 give the qty for that month. It works great but
    1)  When there is no data i.e no qty for that month , it suppose to be blank but it gives the below out put
    Currenlty :
    Material     mplant  DType month(qty)
    552477     552477     
    552477     552477     
    552477     552477     
    552477     552477     
    552477     552477     
    552477     552477     
    552477     552477     
    552477     552477     
    552477     552477     
    Desired :
    Material     mplant  DType month(qty)
    2) When there is data i.e qty for that month , it suppose to give two records but it gives the below out put
         i.e values and some more lines with material but no qty . Actually there is data for only 2 rows.
    Currently :
    Material     mplant  DType month(qty)
    552477     552477  A           10
    552477     552477  B           20
    552477     552477     
    552477     552477     
    552477     552477     
    552477     552477     
    552477     552477     
    552477     552477     
    552477     552477     
    Desired :
    Material     mplant  DType month(qty)
    552477     552477  A           10
    552477     552477  B           20
    I created a macro to delete the duplicate when the number repeats but that doesnot solve because when ever I want to read the total number of rows in another macro it shows wrong total number of line because of these repeating material numbers .
    How can I get the desired output ? is there any simple setting in the layout or XL with out using a complicated macros etc.........
    Using sem bw 320
    Please help . Thank you inadvance.
    Raju
    Edited by: venkat bhuaptiraju on Jan 8, 2008 6:01 PM
    Edited by: venkat bhuaptiraju on Jan 8, 2008 6:04 PM
    Edited by: venkat bhuaptiraju on Jan 8, 2008 6:07 PM

    Thank you all for your reply very very useful tips. This is getting some how very interesting and frustating at the same time.
    Bindu : I used the similar code that you gave me that works perfect it removes the rows data that I do not need but retains the format for exmple the STYLES that I applied for the data and header data
    Arya : The cube has the 2 records and my below msg will clarify that the issue is not with this
    Aby : Yes even, I do not understand why the those 2 columns data with no key figure values
    Jeoffrey :
    - I checked 3- : Layout set to From Transaction data
    - I checked 4- restrictions (variables?)  may not be because ...see... my below observations........
    - I checked 5- ...may not be because ...see... my below observations........ BUT I am going through they
      are very interesting.
    Sappie :
    ...may not be because even for one material ...see... my below observations........
    More Facts :  Sorry I would have given this in the beginning.
    - I am running an adhoc package that contains an existing layout  which works perfect
    - When I copy layout and remove all the styles and macros still it works great
    - BUT when I create a new layout with exactly same setting NO CHANGE and run the SAME adhoc   package I get those material numbers repeating .........
    I have both the layouts in my PC and compared but did not see any difference , Can you please look at it if you think there could be something there ? Please send me you email I can email you.
    Again thank you for looking in to it, your replies are very logical.
    Regards,
    Raju

Maybe you are looking for

  • How to create a table of contents (TOC) linking to specific pages of different (multiple) PDFs

    Hi All, I would like to create clickable Table of Contents (TOC) that can lead to a sub clickable TOC that would lead to a specific page of different PDFs within a folder. Is that possible? Secondly, is is possible to create a search box that upon ty

  • How to get Flashlite2.1 on Samsung

    I wish to post my earlier Q here since the more specific category involving Samsung doesn't seem to get much attention as yet. ...so I bought this beefed up phone, the Samsung SGH ZX20 with the 1Gg microSD card and USB transfer cable and see I may be

  • Using network file share with iPhoto 08

    Hello all: I am a new "switcher". My home network consists of a windows machine and my new imac, with a linux file server which I use to store all data files including my family's extensive photo library. Back in windows land I was able to just point

  • Java on cellular phones

    Is there any guide regarding writting java apps. for cellphones?

  • Looking for "save as" in File ?

    WHow do I locate "save as" ? I know it should be in File. Help