Help with table calculations

Hi, all, I am working on a form that was previously made in Excel. I wanted to remake this in an expandable pdf fillable so that I can add the accessibiltiy information to the form. The first link is to the static pdf converted from Excel here:
https://acrobat.com/#d=lIGyn*lpuWSQ-Qzkklml6w
The second link is the the form as my strained brain has recreated it. I'm sure there is probably a better method than I have chosen and I am open to all suggestions. But I can't get the table to total.
In the first table, all the calcs work correctly, ie 11, 12, 13, 14 and the total from 14 does show up in 15. but I need 17 to show the amount after the Discount (#16) is deducted. You would think something simple would do the trick, like SubTotal - Discount. That doesn't work.
Column 19 should total in the footer row next to 21. It doesn't. And column 23 should total into space #24. I have been trying for hours at a time to come up with the magic script to make this form work but......now I've decided to grovel for help.
https://acrobat.com/#d=mzovRUkKit7JnPVebPKgZw

Hi,
Here is your form back to you: https://acrobat.com/#d=a06D-SL7SK58ZulXCKNSuw. Please note that all of the scripts are FormCalc, as we are using the sum function and the wildcard. Neither of these will work in JavaScript.
Have a look at this post on how to reference objects, in particular the deomonstration of Control+Click:
http://www.assuredynamics.com/index.php/2011/05/som-expressions/
Also with buttons with linear gradient I would change the click behaviour from Inverted to Outline or None. It will be a little easier on the eyes. I have changed the two Add buttons. Also I think that you are getting in to readibility issues with the contrast between the button background and the black caption. I would recommend a read of this post, which outlines an approach to primary buttons (like the add rows) and secondary buttons (like the delete rows):
http://www.assuredynamics.com/index.php/2010/12/buttons/.
Maybe this discussion on colours:
http://www.assuredynamics.com/index.php/2011/02/any-colour-as-long-as-its-black/
Hope that helps,
Niall

Similar Messages

  • Help with tables (should be simple...)

    I'm trying to use a Table component as a spreadsheet template in my app:
    I'd like the first column to be static-y labels (such as Sunday, Monday, etc.) and the rest of the columns to be bound to a relational data source. I thought that I could just create a simple String array of labels in the session bean and then wrap that array with an Object Array Data Provider on the page and bind the table column to the Object Array Data Provider. Doing this doesn't give me the desired/expected results, namely the first column displaying the labels. What am I missing? I can't seem to visually wrap an Object Array Data Provider around anything other than a bult-in DataType array (String, Integer, etc.) and the only properties of the String array that I can choose from for the column are CASE_INSENSITIVE_ORDER, bytes and empty??
    Thanx in adv.
    -Jake

    I cross-posted and received a reply on the Netbeans - J2EE Nabble forum: http://www.nabble.com/help-with-tables-%28should-be-simple...%29-tf3574200.html
    Essentially, the reply points me to this Tutorial Diva article:
    http://blogs.sun.com/divas/entry/using_the_object_array_data
    Parenthetically, what are are the audiences of the Nabble forum vs. this forum? It seems (to me at least) that there is a lot of overlap in the Creator/VWP topics. Which forum is more active? Does anyone find that the Creator audience is migrating to the Netbeans VWP forum? I seem to be getting better responses to my queries on that forum, but that may be due to the nature of my (admittedly newbie-ish) posts.

  • Help with query calculations (recursive)

    Hi All,
    I want some help with a query using a base rate and the result use in the next calculation year.
    Here an example:
    create table rate_type(
    rate_type_id    number,
    rate_desc       nvarchar2(50),
    rate_base_year  number
    insert into rate_type(rate_type_id, rate_desc, rate_base_year) values (1, 'Desc1', 4.6590);
    insert into rate_type(rate_type_id, rate_desc, rate_base_year) values (2, 'Desc2', 4.6590);
    create table rates (
    rate_type_id number
    rate_year    number,
    rate_value   number
    insert into rates(rate_type_id, rate_year, rate_value) values (1, 2012, 1.2);
    insert into rates(rate_type_id, rate_year, rate_value) values (1, 2013, 1.3);
    insert into rates(rate_type_id, rate_year, rate_value) values (1, 2014, 1.4);
    insert into rates(rate_type_id, rate_year, rate_value) values (2, 2012, 1.2);
    insert into rates(rate_type_id, rate_year, rate_value) values (2, 2013, 1.3);
    insert into rates(rate_type_id, rate_year, rate_value) values (2, 2014, 1.4);The calculation for the first year should be the base rate of the rate type. The next year should use the result of the previous year and so on.
    The result of my sample data is:
    2012 = 4.659 + 1.2 + 4.659 * (1.2 * 0.01) = 5.9149
    2013 = 5.9149 + 1.3 + 5.9149 * (1.3 * 0.01) = 7.1859
    2014 = 7.1859 + 1.4 + 7.1859 * (1.4 * 0.01) = 8.4721Query result:
    NAME 2012 2013 2014
    Desc1 5.9149 7.1859 8.4721
    Desc2 XXXX XXX XXXX
    How can I do this in one select statement? Any ideas?
    Thanks!

    Assuming you are on 11.2:
    with t as (
               select  a.rate_type_id,
                       rate_desc,
                       rate_year,
                       rate_base_year,
                       rate_value,
                       count(*) over(partition by a.rate_type_id) cnt,
                       row_number() over(partition by a.rate_type_id order by rate_year) rn
                 from  rate_type a,
                       rates b
                 where a.rate_type_id = b.rate_type_id
        r(
          rate_type_id,
          rate_desc,
          rate_year,
          rate_base_year,
          rate_value,
          cnt,
          rn,
          result
         ) as (
                select  rate_type_id,
                        rate_desc,
                        rate_year,
                        rate_base_year,
                        rate_value,
                        cnt,
                        rn,
                        rate_base_year + rate_value + rate_base_year * rate_value * 0.01 result
                  from  t
                  where rn = 1
               union all
                select  t.rate_type_id,
                        t.rate_desc,
                        t.rate_year,
                        t.rate_base_year,
                        t.rate_value,
                        t.cnt,
                        t.rn,
                        r.result + t.rate_value + r.result * t.rate_value * 0.01 result
                  from  r,
                        t
                  where t.rate_type_id = r.rate_type_id
                    and t.rn = r.rn + 1
    select  *
      from  (
             select  rate_desc name,
                     rate_year,
                     result
               from  r
               where rn <= cnt
      pivot (sum(result) for rate_year in (2012,2013,2014))
      order by name
    NAME             2012       2013       2014
    Desc1        5.914908  7.2918018 8.79388703
    Desc2        5.914908  7.2918018 8.79388703
    SQL> Obviously pivoting assumes you know rate_year values upfront. If not, then without pivoting:
    with t as (
               select  a.rate_type_id,
                       rate_desc,
                       rate_year,
                       rate_base_year,
                       rate_value,
                       count(*) over(partition by a.rate_type_id) cnt,
                       row_number() over(partition by a.rate_type_id order by rate_year) rn
                 from  rate_type a,
                       rates b
                 where a.rate_type_id = b.rate_type_id
        r(
          rate_type_id,
          rate_desc,
          rate_year,
          rate_base_year,
          rate_value,
          cnt,
          rn,
          result
         ) as (
                select  rate_type_id,
                        rate_desc,
                        rate_year,
                        rate_base_year,
                        rate_value,
                        cnt,
                        rn,
                        rate_base_year + rate_value + rate_base_year * rate_value * 0.01 result
                  from  t
                  where rn = 1
               union all
                select  t.rate_type_id,
                        t.rate_desc,
                        t.rate_year,
                        t.rate_base_year,
                        t.rate_value,
                        t.cnt,
                        t.rn,
                        r.result + t.rate_value + r.result * t.rate_value * 0.01 result
                  from  r,
                        t
                  where t.rate_type_id = r.rate_type_id
                    and t.rn = r.rn + 1
    select  rate_desc name,
            rate_year,
            result
      from  r
      where rn <= cnt
      order by name,
               rate_year
    NAME        RATE_YEAR     RESULT
    Desc1            2012   5.914908
    Desc1            2013  7.2918018
    Desc1            2014 8.79388703
    Desc2            2012   5.914908
    Desc2            2013  7.2918018
    Desc2            2014 8.79388703
    6 rows selected.
    SQL> SY.

  • Help with Custom calculation script in Acrobat 8

    Hi all, I am using acrobat 8 on OS 10.5
    I am trying to add certain fields (numbers) and then subtract another field value to give an end result.
    I don't know anything about Javascript, would anyone be able to help with any info on how I achieve this result? I can only see Add, x and average etc... nothing there for subtraction
    Thanks for any help in advance
    Swen

    This should get you started:
    >if (event) {
    // get values from two text fields
    var a = Number(this.getField('Text1').value);
    var b = Number(this.getField('Text2').value);
    // subtract the values and show it
    this.event.target.value = a - b;
    Place this in a 3d text field, as a Custom Calculation Script.

  • URGENT Help With Scientific Calculator!

    Hi everybody,
    I designed a calculator, and I need help with the rest of the actions. I know I need to use the different Math methods, but I tried tried that and it didn't work. Also, it needs to work as an applet and application, and in the applet, the buttons don't appear in order, how can I fix that?
    I will really appreciate your help with this program, I can't get it to work and I'm frustrated, I need to finish this for next Tuesday 16th. Please e-mail me at [email protected].
    Below is the code for the calcualtor.
    Thanks a lot!
    -Maria
    // calculator
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    public class calculator extends JApplet implements
    ActionListener
      private JButton one, two, three, four, five, six, seven,
      eight, nine, zero, dec, eq, plus, minus, mult, div, clear,
      mem, mrc, sin, cos, tan, asin, acos, atan, x2, sqrt, exp, pi, percent;
      private JLabel output, blank;
      private Container container;
      private String operation;
      private double number1, number2, result;
      private boolean clear = false;
      //GUI
      public void init()
        container = getContentPane();
        //Title
        //super("Calculator");
        JPanel container = new JPanel();     
        container.setLayout( new FlowLayout( FlowLayout.CENTER
        output = new JLabel("");     
        output.setBorder(new MatteBorder(2,2,2,2,Color.gray));
        output.setPreferredSize(new Dimension(1,26));     
        getContentPane().setBackground(Color.white);     
        getContentPane().add( "North",output );     
        getContentPane().add( "Center",container );
        //blank
        blank = new JLabel( "                    " );
        container.add( blank );
        //clear
        clear = new JButton( "CE" );
        clear.addActionListener(this);
        container.add( clear );
        //seven
        seven = new JButton( "7" );
        seven.addActionListener(this);
        container.add( seven );
        //eight
        eight = new JButton( "8" );
        eight.addActionListener(this);
        container.add( eight );
        //nine
        nine = new JButton( "9" );
        nine.addActionListener(this);
        container.add( nine );
        //div
        div = new JButton( "/" );
        div.addActionListener(this);
        container.add( div );
        //four
        four = new JButton( "4" );
        four.addActionListener(this);
        container.add( four );
        //five
        five = new JButton( "5" );
        five.addActionListener(this);
        container.add( five );
        //six
        six = new JButton( "6" );
        six.addActionListener(this);
        container.add( six );
        //mult
        mult = new JButton( "*" );
        mult.addActionListener(this);
        container.add( mult );
        //one
        one = new JButton( "1" );
        one.addActionListener(this);
        container.add( one );
        //two
        two = new JButton( "2" );
        two.addActionListener(this);
        container.add( two );
        //three
        three = new JButton( "3" );
        three.addActionListener(this);
        container.add( three );
        //minus
        minus = new JButton( "-" );
        minus.addActionListener(this);
        container.add( minus );
        //zero
        zero = new JButton( "0" );
        zero.addActionListener(this);
        container.add( zero );
        //dec
        dec = new JButton( "." );
        dec.addActionListener(this);
        container.add( dec );
        //plus
        plus = new JButton( "+" );
        plus.addActionListener(this);
        container.add( plus );
        //mem
        mem = new JButton( "MEM" );
        mem.addActionListener(this);
        container.add( mem );   
        //mrc
        mrc = new JButton( "MRC" );
        mrc.addActionListener(this);
        container.add( mrc );
        //sin
        sin = new JButton( "SIN" );
        sin.addActionListener(this);
        container.add( sin );
        //cos
        cos = new JButton( "COS" );
        cos.addActionListener(this);
        container.add( cos );
        //tan
        tan = new JButton( "TAN" );
        tan.addActionListener(this);
        container.add( tan );
        //asin
        asin = new JButton( "ASIN" );
        asin.addActionListener(this);
        container.add( asin );
        //acos
        acos = new JButton( "ACOS" );
        cos.addActionListener(this);
        container.add( cos );
        //atan
        atan = new JButton( "ATAN" );
        atan.addActionListener(this);
        container.add( atan );
        //x2
        x2 = new JButton( "X2" );
        x2.addActionListener(this);
        container.add( x2 );
        //sqrt
        sqrt = new JButton( "SQRT" );
        sqrt.addActionListener(this);
        container.add( sqrt );
        //exp
        exp = new JButton( "EXP" );
        exp.addActionListener(this);
        container.add( exp );
        //pi
        pi = new JButton( "PI" );
        pi.addActionListener(this);
        container.add( pi );
        //percent
        percent = new JButton( "%" );
        percent.addActionListener(this);
        container.add( percent );
        //eq
        eq = new JButton( "=" );
        eq.addActionListener(this);
        container.add( eq );
        //Set size and visible
        setSize( 190, 285 );
        setVisible( true );
    public static void main(String args[]){
        //execute applet as application
         //applet's window
         JFrame applicationWindow = new JFrame("calculator");
    applicationWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         //applet instance
         calculator appletObject = new calculator();
         //init and start methods
         appletObject.init();
         appletObject.start();
      } // end main
      public void actionPerformed(ActionEvent ae)
        JButton but = ( JButton )ae.getSource();     
        //dec action
        if( but.getText() == "." )
          //if dec is pressed, first check to make shure there
    is not already a decimal
          String temp = output.getText();
          if( temp.indexOf( '.' ) == -1 )
            output.setText( output.getText() + but.getText() );
        //clear action
        else if( but.getText() == "CE" )
          output.setText( "" );
          operation = "";
          number1 = 0.0;
          number2 = 0.0;
        //plus action
        else if( but.getText() == "+" )
          operation = "+";
          number1 = Double.parseDouble( output.getText() );
          clear = true;
          //output.setText( "" );
        //minus action
        else if( but.getText() == "-" )
          operation = "-";
          number1 = Double.parseDouble( output.getText() );
          clear = true;
          //output.setText( "" );
        //mult action
        else if( but.getText() == "*" )
          operation = "*";
          number1 = Double.parseDouble( output.getText() );
          clear = true;
          //output.setText( "" );
        //div action
        else if( but.getText() == "/" )
          operation = "/";
          number1 = Double.parseDouble( output.getText() );
          clear = true;
          //output.setText( "" );
        //eq action
        else if( but.getText() == "=" )
          number2 = Double.parseDouble( output.getText() );
          if( operation == "+" )
            result = number1 + number2;
          else if( operation == "-" )
            result = number1 - number2;
          else if( operation == "*" )
            result = number1 * number2;
          else if( operation == "/" )
            result = number1 / number2;       
          //output result
          output.setText( String.valueOf( result ) );
          clear = true;
          operation = "";
        //default action
        else
          if( clear == true )
            output.setText( "" );
            clear = false;
          output.setText( output.getText() + but.getText() );
    }

    Multiple post:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=474370&tstart=0&trange=30

  • Beginner Web Design help with tables

    For my college Web Design course we are building a basic website using tables and basic coding. Right now I am trying to align this img with the text on the left. The width of the outer table is 1024px and everytime I try and add the img into its own <td> it pushes outside the outer table. I would add screenshots of the code and css, but for some reason it isn't allowing me to insert images into the post.

    SnakEyez02 wrote:
    I don't agree 100% with previous comments made about tables because they are still relevant for email layouts due to archaic applications like Outlook using the brilliant "Word" rendering engine or Google disabling CSS in the header for GMail. 
    Hear, hear!!
    I have never bought into the nonsense about how tables should be used for tabular data only. Adobe has been touting the power of tables as layout tools for as long as I can remember, and still are: http://help.adobe.com/en_US/dreamweaver/cs/using/WScbb6b82af5544594822510a94ae8d65-7da3a.h tml (Although the wording has been toned down some).
    DIV/CSS based layouts were not a part of my workflow until a couple of years ago. At that time, my plan was to make the switch from table based layouts (which already used a fair amount of CSS) to strictly DIV & CSS layouts. That’s when I discovered that Outlook and Gmail were unable to render DIV & CSS based newsletters. When I studied the newsletters of the industry leaders, and realized that almost all of them use tables with inline styles, I decided to put my workflow switch on hold.
    While all of my mobile work is strictly HTML5 (DIV’s & CSS), I have given clients the option to go with either CSS or table based layouts for their websites. Most choose table layouts. Design migrations from Photoshop to Dreamweaver are 10 times faster with tables, with little to no CSS hacks, and far easier to maintain than the purists are telling you. This makes table layouts less expensive in the short and long run.
    As far as SEO is concerned, Google doesn’t care either way: http://www.youtube.com/watch?v=fL_GZwoC2uQ
    With all of that said, the W3C is planning on having the HTML5 recommendation finalized by 2014, at which time it should be completely stable and away from the bleeding edge. And while it is my hope that I will be done with table based layouts by then, I do not feel it is right that Adobe should make that choice for me by continuing to remove critical table, image, and text based tool sets from Dreamweaver. If for nothing else but newsletter design and development, we need those tools back.

  • Help with Auto calculations

    I have an existing pdf that i am trying to edit and make it more functional...i.e. fillable info with auto calculations of cost based on a given number (times a specific cost)
    Example on the form....
    Car Registrations (per car) _____ X $25 _________
    The first line above is # Cars Registered
    The last line is Total Cost
    The blank lines above i have added a text box to for auto calculations. I have formated these boxes as numbers (first line) and dollar value total (second line)
    I've added another text box for the $25 and placed it overtop the worded one. I've locked this box and the total box. I've calculated the product of the total box by linking it to the first line and the $25 to give the total cost...
    Problem is, it isnt working....the total box isn't seeing the $25 to give a proper calc. Whatever number i place in the first line, only zero shows in the total.
    I'm obviously missing something....been at this for two days....frustrated. I have many more inputs like this on the form, and eventually want all the totals to provide sub totals and a grand total. I understand how this all works to a degree, doesnt seem that difficult, but i have to be missing something.
    I even tried re-creating the document in word, input to adobe, make a new form, let the system recoginize areas as fillable, etc, etc, etc. When i get to the calculations portion, same result...there are not many tutorials out there on this...sadly
    Woking on a MAC...
    I have acrobat X Pro

    gr8snkbite wrote:
    I have an existing pdf that i am trying to edit and make it more functional...i.e. fillable info with auto calculations of cost based on a given number (times a specific cost)
    Example on the form....
    Car Registrations (per car) _____ X $25 _________
    The first line above is # Cars Registered
    The last line is Total Cost
    The blank lines above i have added a text box to for auto calculations. I have formated these boxes as numbers (first line) and dollar value total (second line)
    I've added another text box for the $25 and placed it overtop the worded one. I've locked this box and the total box. I've calculated the product of the total box by linking it to the first line and the $25 to give the total cost...
    Problem is, it isnt working....the total box isn't seeing the $25 to give a proper calc. Whatever number i place in the first line, only zero shows in the total.
    I'm obviously missing something....been at this for two days....frustrated. I have many more inputs like this on the form, and eventually want all the totals to provide sub totals and a grand total. I understand how this all works to a degree, doesnt seem that difficult, but i have to be missing something.
    I even tried re-creating the document in word, input to adobe, make a new form, let the system recoginize areas as fillable, etc, etc, etc. When i get to the calculations portion, same result...there are not many tutorials out there on this...sadly
    Woking on a MAC...
    I have acrobat X Pro
    I created your sample.
    name the field after Number  of cars, as car
    The calulation field named total

  • Help with Javascript/Calculations

    Hello,
    Have a building use policy for school.
    Need help with checkboxes and default values.  I can get javascript/math to work when I click check box.
    Someone wants to rent a room they check the rentRoom checkbox.  Then the enter how many rooms 1,2,3 etc..  The value for the rentRoom checkbox is $25.
    I can get it when the checkbox for rentRoom is selected the rentRoom.Total computes correctly.  However, what I want is when the form opens up a default value of $0.00 to be in there.  I also want if someone goes back and unchecks the rentRoom checkbox the value goes back to $0.00 not just blank.   Right now I am getting the error the value entered does not match the value of the field.  That is if I put the default value in options.  Basically, I can't seem to figure out the javascript code to get this to work.
    Am I asking for too much, can someone guide me to javascript to help me out.
    I have tried if/then statements and switch statements.  I just can't figure out how to get it to for lack of better a word - toggle back and forth.
    If this is not possible please tell me.  If it is too complicated tell me.  I am not using livecycle for this as we had a word document and I just used the find form fields.  I am also using Adobe Acrobat 8 Professional.
    Thanks

    Hello,
    Thanks that looks good.  I am still missing something but the calc doesn't work when I put in my variables.  I will work with it more but nothing happens.
    The one thing is I have the default value of the checkbox as 15 so don't know if that messes it up.
    Right now I get the default value of $0.00 all the time.  When I click on the check box on/off it doesn't do the calcs.
    sorry, any more input, what am i missing??
    I also changed the syntax error that was posted on your origianl post.  You had == 'Off" I changed that to 'Off'

  • I need your help, with table

    Hi experts,
    I have a problem with table in sapnetweaver, and want to ask all of you , that is : I want to set a column of a table with 3 rows, one is textview, one is editfield, and the last one is combobox, how can i do that.
    Thank you for your attention,
    looking forward to hearing from you soon.
    Chau.

    Hi,
    For NWDS 7.0 version,this feature is available.
    You can use difference cell editors in the table  column for different
    table rows.
    How to create this:
    Step1>in the outline create one table column.
    step2>Rightclick on table column select "Insert CellVarient".
    Step3>You will get a popup with 3 choice.Select TableStandardCell.
    and give some name.
    Step4>Rightclic on TableStandardCellVarient,then select InsertEditor.
    In this editor you can able to select one newelement(i.e textview/image/
    InputField.........etc)
    Like this you can insert multiple Cellvarients(1.Image,2.Ifld..etc) to the single Tablecolumn.
    Regards,
    Lavanya.G

  • Need help with a calculated column - is there any way to reference a value in the current row?

    Hey guys,
    I'm a bit of a DAX newbie, and I'm running into a block. I'm creating a Power View report about IT tickets. We are going to be creating a cube to automate the data soon, I'm currently working with a flat Excel Data Table of data to demonstrate the Power
    View reporting capabilities to the team. I need the default display to show the top 4-5 items basked on the Ticket Count. The three applicable columns I'm using are the TicketID, the ContactReason, and the AssetCategory - all three are
    text. One slide will show the top five Contact Reasons by Ticket Count, and the other will show the top five Categories by Ticket Count. The users will see this default view, but will be able to change it to see differently ranked items or can clear the
    ranking slicer altogether.
    What I've accomplished so far is to create the Calculated Field [Ticket Count] = COUNTA(Table1[TicketID])
    And 2 other calculated fields:
    [Contact Rank] = RANKX(ALL(Table1[ContactReason]),[Ticket Count],,,DENSE)
    [Asset Rank] = RANKX(ALL(Table1[AssetCategory]),[Ticket Count],,,DENSE)
    If I were creating a Pivot Table, this would be great. These fields calculate everything the right way. The problem is, I need to have a Rank slicer on each slide and the calculation by itself contains no data - with no data, there's nothing to slice. I
    realized I need to actually have columns of data so I can create a slicer. I need each row of the table to show the same [Contact Rank] for every instance of a particular ContactReason (and the same for the [Asset Rank] and AssetCategory).
    The RANKX formulas pasted into the Calculated Column section only show a value of 1 - with no Pivot table summarizing the fields, it's counting each row's ticket once, giving every line the tied Rank of #1.
    I've solved the problem in Excel by creating 2 Pivot Tables on a separate sheet that have the data field and the calculated field for ContactRason and AssetCategory. Then on my Excel Data Table, I've added two columns that do a VLOOKUP and pull over a the
    Calculated Rank from each Pivot Table that match the ContactReason and AssetCategory fields. This works on the flat Excel Data Table now, but will not be a solutions when we start pulling the data from the cube (and there is no flat table).
    What I think I need is an Expression for the RANKX formula that can give me, for each row, the count of all of the times a ContactReason shows up in an entire column. There's only about 100,000 lines of data and each ContactReason or AssetCategory
    may show up several thousand times. But if I can get the expression to return that count, then the RANKX formula should work in the Column. If it wasn't a DAX formula, I'd use a COUNTIF and say 'Count the entire ContactReason column anytime it's equal to the
    ContactReason on THIS row', but in DAX I don't know how to reference a single value in a row. I've tried the CALCULATE() formula, but it seems like the filter needs a specific value, and doesn't work on a dynamic "cell" value.
    Any help would be greatly appreciated! (I hope it all makes sense!)

    If I've understood you correctly then the ALLEXCEPT function may be what you're after and it could be applied in a similar way to the following...
    =
    RANKX(
    ALL(Table1),
    CALCULATE(
    COUNTROWS(table1),
    ALLEXCEPT(Table1, Table1[ContactReason])
    DENSE
    If this has missed the mark, would it be possible to clarify the requirement further?
    Regards,
    Michael Amadi
    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)
    Website: http://www.nimblelearn.com
    Blog: http://www.nimblelearn.com/blog
    Twitter: @nimblelearn

  • DAX - Need help with TotalYTD calculation with Rolling 12 Months (Fiscal Months)

    These are the tables I currently have in my solution:
    DimDate - date dimension - our fiscal periods don't match with calendar periods
    Fact Claims - ID, Date, Doc#, Amount,  ProductKey
    DimDateR12 - fiscal periods with max and min calendar dates - using DatesAdd gave me error because of contiguous dates error, so ended up using this.
    Here are the calculations -
    Issue Count = Distinct count of Products where (Sum of amount >= 1000 and count of claims >= 5) in last 12 fiscal periods - I am using summarize function here.
    I need to add another calculation where I need to count issues resolved.
    Issues resolved = Distinct count of products, where Rolling 12 Claims Amount >= 1000 and claim count >= 5 in the previous fiscal period) and Current fiscal period, NOT(Rolling 12 Claims Amount >= 1000 AND claim count >= 5) - this needs
    to be a cumulative calculation.
    I got Issues Resolved Calculation to work with summarize function, but using TotalYTD (using Fiscal Date key) to get cumulative number, is not working. Here is my calculation - TotalYTD([Count of Issues Resolved],DimDateR12[FiscalDate])
    I tried using All(DimDateR12) filter, but didn't work.
    Any help is really appreciated.
    Thanks,
    Sonal

    These are the calculations I am currently using -
    Rolling12ClaimCount:=CALCULATE(FactClaim[ClaimCount],FILTER(DimDate,AND(DimDate[Calendar Date] >= Min(DimDateR12[StartDate]),DimDate[Calendar Date] <= Max(DimDateR12[EndDate]))))
    Rolling12ClaimAmount:=CALCULATE(FactClaim[ClaimAmount],FILTER(DimDate,AND(DimDate[Calendar Date] >= Min(DimDateR12[StartDate]),DimDate[Calendar Date] <= Max(DimDateR12[EndDate]))))
    IsCurrentIssue:=IF(([Rolling12ClaimAmount] >= 1000) && ([Rolling12ClaimCount] >= 5),TRUE(),FALSE())(([Rolling12ClaimAmount] >= 1000) && ([Rolling12ClaimCount] >= 5),TRUE(),FALSE())
    WasWarrantyIssue:=IF(([PrevFiscalPeriodRolling12ClaimAmount] >= 1000) && ([PrevFiscalPeriodRolling12ClaimCount] >= 5),TRUE(),FALSE())
    Resolvedissues:=IF(AND([IsWarrantyIssue]=FALSE(),[WasWarrantyIssue]=TRUE()),1,0)
    Rolling12IssuesResolved:=SUMX(SUMMARIZE(FactClaim,FactClaim[ProductKey],"ResolvedIssueCount",[Resolvedissues]),[ResolvedIssueCount])
    YTDResolvedIssues:=TotalYTD([Rolling12IssuesResolved],DimDateR12[FiscalDate])
    -- Fiscal Date is <Fiscal Period>/1/<Fiscal year>
    Thanks,
    Sonal

  • Help with date calculation based on office hours

    Hi,
    could you guys point me which way should I think of in PL/SQL, or maybe SQL to calculate a date using not 24 hours day, but office hours.
    Let me give you an example
    Office hours are between 9am till 5pm
    I receive a case - registration time - 14.03.2013 4pm, and I'm supposed to calculate the Due date, let's say Registration time + 10hours.
    Normaly I would do "registration time" + 10hours, but I can't. I cannot use 24 hours window for the calculation, but 9am - 5pm window.
    So the "Due timestamp" would be = "16.3.2013 10am". Which is : 1 hour from 14.03. + 8hours from 15.3. + 1 hour from 16.3.
    Thanks for any ideas.

    Hi,
    A user-defined function would be very handy for that. Foir example
    add_office_hours ( in_start_date DATE
                     , in_num_hours  NUMBER
    RETURN DATE
    DETERMINISTIC ...First, copy in_start_date to a local variable, start_date, and check if start_date is within office hours. If not, change it to the beginning of the next business day.
    Add in_num_hours to start_date. Is the result before 5pm on the same day?
    If so, the function is finished. Return that date.
    If not, find how much past 5pm the result is, and recurse (that is, have the function call itself with a new, later in_start_date and a new, smaller in_num_hours). If you prefer, you can use a loop instead of recursion.
    How do you treat weekend and holidays?
    Would you want to call the function with a negative number of hours?
    If you'd like help. post your best attempt.
    Post CREATE TABLE and INSERT statements for a table that you use for testing. The table should have start_date, num_hours and correct_result_date columns.
    Always say which version of Oracle you're using (e.g. 11.2.0.3.0).
    See the forum FAQ {message:id=9360002}

  • Help with math / calculations in RTF templates

    Greetings,
    I know that there are math capabilities in the templates... I've seen the code samples in the Core Components guide.
    What this doesn't tell you is WHERE these things would go in a template. And... that... is my question.
    We are just starting to use BIP in conjunction with JDE EnterpriseOne (8.12, tool set 8.97.12). For our first attempt we're creating our template over a new report.
    I have a template where I sum two different repeating values (through the normal BI Properties) and place these values in two separate cells in a table. I want to sum the two of these together for a "grand" total.
    I've seen the "examples" but they really aren't very helpful. The xsfo, etc. for doing addition is fine, but WHAT are the values to add and WHERE does the code go?
    If anyone has done something like this or has experience using the embedded code I would appreciate hearing from you.
    Thanks in advance

    I see what you are saying about the spaces... but it made no difference... still got the error.
    The XML file is too large and convoluted to be pasted here.
    With reqards to the following snippet:
    COLA = <?sum(current-group()/COLA)?>
    COLB = <?sum(current-group()/COLB)?>
    Summ== <?sum(current-group()/COLA) + sum(current-group()/COLB)?>
    Where does THIS code go?
    Here is the error detail:
    ConfFile: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\config\xdoconfig.xml
    Font Dir: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    Template: C:\Documents and Settings\jdenison\My Documents\BIP Templates\R5642001\R5642001_TEMPLsave.rtf
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\Documents and Settings\jdenison\My Documents\BIP Templates\R5642001\R5642001_RICE0001_D081029_T144059683.xml
    FOProcessor setLocale: en-us
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
         at RTF2PDF.runRTFto(RTF2PDF.java:629)
         at RTF2PDF.runXDO(RTF2PDF.java:439)
         at RTF2PDF.main(RTF2PDF.java:289)
    Caused by: oracle.xdo.parser.v2.XPathException: Extension function error: Method not found 'sum'
         at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:1534)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:521)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:489)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:271)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:155)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:192)
         ... 15 more

  • Help with table scan

    I have a problem with full table scans that make very slow the performance of a report.
    The test case is below. It looks that when the column is called from the table, the index is in use. If I use the same select from the view, then I get a table scan.
    I would appreciate any idea on how to optimize it.
    Thanks a lot for the help.
    mj
    <pre>
    create table test1 (id1 number , id2 number, id3 number, col1 varchar(10),col2 varchar(50), col3 varchar(100));
    create table test2 (id4 number , id5 number, id6 number, col4 varchar(10),col5 varchar(50), col6 varchar(100));
    ALTER TABLE test1 ADD CONSTRAINT PK_test1 PRIMARY KEY(ID1) USING INDEX REVERSE;
    create index index1 on test1(ID2);
    create index index2 on test1(ID3,col2 );
    ALTER TABLE test2 ADD CONSTRAINT PK_test2 PRIMARY KEY(ID4) USING INDEX REVERSE;
    create or replace view test_view as select t1.*,
    case (select t2.id4 from test2 t2 where t1.id2 = t2.id5 and t2.id6 = -1)
    when t1.id2 then t1.id3
    else t1.id2
    end as main_id
    from test1 t1 ;
    create or replace view test_view2 as select * from test_view; --(requred by security levels)
    select * from test1 where id2 =1000;
    select * from test_view where id2 = 1000;
    select * from test_view2 where id2 = 1000;
    SQL> select * from test_view where id2 = 1000;
    Elapsed: 00:00:00.00
    Execution Plan
    Plan hash value: 1970977999
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 125 | 1 (0)| 00:00:01 |
    |* 1 | TABLE ACCESS FULL | TEST2 | 1 | 39 | 2 (0)| 00:00:01 |
    | 2 | TABLE ACCESS BY INDEX ROWID| TEST1 | 1 | 125 | 1 (0)| 00:00:01 |
    |* 3 | INDEX RANGE SCAN | INDEX1 | 1 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter("T2"."ID5"=:B1 AND "T2"."ID6"=(-1))
    3 - access("T1"."ID2"=1000)
    SQL> select * from test_view where main_id = 1000;
    Elapsed: 00:00:00.03
    Execution Plan
    Plan hash value: 3806368241
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 125 | 4 (0)| 00:00:01 |
    |* 1 | TABLE ACCESS FULL | TEST2 | 1 | 39 | 2 (0)| 00:00:01 |
    |* 2 | FILTER | | | | | |
    | 3 | TABLE ACCESS FULL| TEST1 | 1 | 125 | 2 (0)| 00:00:01 |
    |* 4 | TABLE ACCESS FULL| TEST2 | 1 | 39 | 2 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter("T2"."ID5"=:B1 AND "T2"."ID6"=(-1))
    2 - filter(CASE WHEN "T1"."ID2"= (SELECT /*+ */ "T2"."ID4" FROM
    MJ42."TEST2" "T2" WHERE "T2"."ID5"=:B1 AND "T2"."ID6"=(-1)) THEN
    "T1"."ID3" ELSE "T1"."ID2" END =1000)
    4 - filter("T2"."ID5"=:B1 AND "T2"."ID6"=(-1))
    SQL>
    </pre>

    If you think about what the two queries are doing, it is easy to see why the first uses an index and the second does not.
    Your first query:
    SELECT * FROM test_view WHERE id2 = 1000explicitly uses an indexed column from test1 in the predicate. Oracle can use the index to identify the correct row from test1. Having found that single row in test1, it uses the FULL SCAN test2 to resolve the case statement.
    Your second query:
    SELECT * FROM test_view WHERE main_id = 1000uses the result of the case statement as the predicate. Oracle has no way of determing what row from test1 to use initially, so it must full scan both tables.
    John

  • Need help with Table of Content

    Hi,
    I have recently started working with Robohelp 7. I just
    completed my first project working with the tool. This project has
    several Topics, and each topic has sub-topic under them. When I
    generated the html files, I had given the Introductory sub-topic as
    the default topic.
    Now after the files are generated, I cannot open any other
    topic in the table of content until I expand the topic containing
    the default sub-topic. This issue is basically with Firefox
    browser. It seems to work well with Safari. IE anyways opens the
    folder containing the default topic.
    I am not sure if any other user have faced similar problems?
    Would like to hear from you guys too.

    Welcome to the forum
    Whenever you install new software, check for updates before
    starting work.
    Go to Help | Updates and apply both patches.
    Regenerate your help and try again. It should be OK.

Maybe you are looking for