Difference in Current and previous row item value

Hi Vinish and Team,

We are using Forms 11.1.2.2 on Linux Platform.

Here is what we have a requirement of the new column highlighted by me in the attached image. We have added the Exposure Time Diff column and exposed in Data Block and in respective Canvas.

You can see that the first row of this column will always be blank and then the second row will be the exposure time of the second row minus the exposure time of the first row (2.25 – 2.00), and the same moving down the rest of the rows.

Please help with the best approach to meet this requirement.

Thanks,
Babu N

3 Comments
  • Hi Babu,

    You can handle this using the data block based on the From Clause. Check this link Create Data Block Based On From Clause Query In Oracle Forms.

    The from clause blocks are based on the SQL query and in SQL query you can use the Lead or Lag analytical function to solve your purpose. Here is an example:

    Select cycle_id, start_date, end_date, exp_min, exp_sec, exp_time, (Lag (exp_time, 1, null) over (order by cycle_id, your_order_by) - exp_time) exp_time_diff from your_table;

    Here the Lab expression value is the previous row exp_time and exp_time is the current row value.

    First, you can test your query only in Oracle. You will get the desired result.

  • Vinish – What is the importance and benefit of ‘from clause’ query in Oracle forms?

    Could you please explain?

    • It depends on the requirement, like the above question, the from clause query is the appropriate solution for this.

      So if any time, you think that your purpose is not going to solve by simply specifying one or more tables for a data block, then you can use the from clause query feature. This is the only benefit of this.

Leave a Reply

Your email address will not be published. Required fields are marked *