CREATING CALCULATION ON THE SAME FIELD

I want to create a calculation where I can get the movement in balance from one period to the next (the periods are specified in parameters), eg End balance sum of Dec 07 less End balance sum of Mar 08.
There is a similar query where I want to compare the balances held in different sets of books. eg End balance sum of sob id 93 less End balance sum of sob id 94.
Would appreciate any pointers. Thanks

create table t(d date, n number, t varchar2(40));
alter session set nls_date_format='DD.MM.RR';
insert into t values (to_date('01/01/05'),1000,'credit');
insert into t values (to_date('02/01/05'),500,'credit');
insert into t values (to_date('02/01/05'),200,'debit');
insert into t values (to_date('01/01/05'),2000,'debit');
insert into t values (to_date('01/01/05'),3000,'debit');
insert into t values (to_date('01/01/05'),12,'credit');
insert into t values (to_date('02/01/05'),12,'credit');
select d,
    sum(n*instr(t,'debit')) debit,
    sum(n*instr(t,'credit')) credit
from t
group by d;
D             DEBIT     CREDIT
01.01.05       5000       1012
02.01.05        200        512

Similar Messages

  • How to create colums with the same Field

    Hello every body,
    I have this report only with one field how i can create columns in base of rows for example some times  this field containing 40 rows then I need to create 2 columns of 20 that when is even or 15 then create 2 columns one with 8 rows and the other with 7.

    you can try making the report layout with multiple section. Please the field in detail section and right cick on the detail section and go to section expert and select the option "format with multiple columns" and then go to layout tab and select the each column width and select the printing direction option as down then across and click on OK.
    Now you will be able to see the multi column report.
    regards,
    Raghavendra.G

  • Different fonts in the same field

    Is it possible to format a single field with two different fonts. I have concatenated two database columns to get this field. But I want different fonts for the two columns. I could achieve this by using a format trigger and placing some html tags. But this solution only works if the output is in HTML style sheets. It does not work if I want the output to be in PDF. Does anybody know how to achieve it in PDF? Is it possible at all (from what I have seen it isn't). I will be grateful for any help in this direction.
    Thanks
    Janaki

    Hi!
    Try this:
    Let say you have scott/tiger and emp-table and want to concatenate and print ename and job in the same field but with different fonts.
    1. In the Database model you have the columns seperate as usual.
    2. Create a boileplate text field and put &ENAME &JOB in this field.
    3. Select &ENAME and set the right font to it, set another font for &JOB.
    4. Run and test. This should work...

  • Freetype OR digital signature in the same field?

    Hello, 
    I'm creating a form for someone who wants to be able to use a digital signature OR free type within the same field.
    I've tried creating a new combo box with the free type as the first option, but can't seem to figure out a way to have a digital signature as the second option. 
    Does anyone know if it's possible to get both options in one field? 
    Thanks in advance.

    Thanks, George.  You've helped me several times in the past and I know you're a power user, so if you say it's not possible, I know I'm barking up the wrong tree!    Appreciate the reply.

  • Pull more than one field into the same field in a report.

    I am attempting to put together a report in Visual Studio 2008. It seemed a simple report at first, but as I am creating the SQL, I am having a little trouble conceptualizing how to get it to work exactly as needed. Here is the issue...
    In this case, the report should show two rows for each department. One is the count of who within an audience (that will be set up as a parameter) completed a certain course (the course may also be a parameter). The next row should be
    a count, within that same department, of all users within the audience. Both counts should be within the same field on the report, but on different rows.
    My thought was to create two CTE's. One would contain the counts, by department, of everybody in the audience. The other would contain the counts, by department, of those within the audience who completed the given course.
    The problem is, though, I need to then have these two counts by department on two separate lines, and they should be within the same field. Basically, the idea is they are the numerator and denominator. There would also be a field before the count that would
    need to identify which one it is. For the sake of the example, call it "Measure_ID" and it would say "CourseCert" for the count of who completed the course and "CourseAvail" for the count of those who are part of the audience.
    Let me know if that makes sense, or if I can provide any further clarification to help you better understand what I am trying to achieve. Does anybody have thoughts on how to do this?

    Unfortunately, the counts need to be in separate rows. If they could be in the same row, it would have probably been a lot easier. I think I could have just done a couple "Case When" type formulas within the list of things under "Select."
    As it is, I need the two counts to show up under the same heading in separate rows. Unfortunately, the table structure of this database is very complicated. I think it would likely just further confuse things if I tried to share all of that detail here.
    That is why I was trying to be generic.
    Unless there is another easier way I am missing, I was thinking the easiest way to achieve what I needed was to use two CTE's. One would list all users by department who belong to a specific audience (the audiences are what we use to then assign them
    to certain courses, so the audience would be the people who are required to complete a certain course). The other would list all user by department who are in that audience and have completed a particular course. I think I am fine to complete that part.
    It is just getting them to then display as in my example that I am not sure how to do.
    The desired result, as you see in my example, has two lines per department, the first being a count of those who completed the course ("Certified"). The second line being a count of those who are required to complete it ("Available").
    Does that help? I was basically hoping somebody had an example they could use, just with fake table names so I could adapt it to my data. If it helps, though, let's pretend the two CTE's are like this:
    Table Name: Certified
    Table's purpose: This table would list all people who had completed the course.
    Fields:
    CourseName
    CourseCode
    AudienceName
    AudienceCode
    CompletionResult
    EmpCode
    DepartmentCode
    Table Name: Available
    Table's purpose: This table would list all people who are assigned to the audience.
    Fields:
    AudienceName
    AudienceCode
    EmpCode
    DepartmentCode
    The desired result would then count the EmpCodes, by department, from each table in that Measure_Amount field so it could display as I showed above. Does that make sense? I apologize if that does not help to clarify. I was trying to be as simple
    as possible so you could just use it as a generic example.

  • Combobox and UseLOV with the same field

    Hi,
    i want use a Combobox which Select a Field name and after make a UseLov with this field name.
    I can make the combobox with field name Column and i can separatly make a USELov with a field name, but i can't make it together.
    Have tried two things create a new Bean with one method which call theses two methods and i have tried call the two methods directly in the JSP on the same field.
    In each case the first method's call is ignored.
    Thanks
    Philippe
    null

    Philippe,
    To do this you'd have to implement your own control.
    Thanks
    Blaise

  • IBooks app thinks my two user created textbooks are the same!

    iBooks app thinks my two user created textbooks are the same file. Whichever I load first works just fine, but when I try to load the second, nothing happens and then my first book opens up again. I use drop copy to move files onto my class' iPads (20 of them), but I have to uninstall the first book in order to load the second. This only happens with my two textbooks. Other user created books work fine.
    My semester has already started and I'm not able to put my content into their hands. Please help!!

    Thank God somebody figured it out! This was driving me nuts. But I have to say this is a pretty stupid way to address the problem...I have a client that produces iBooks for corporate clients, customizing the book for each one. Having to start from scratch every time, then  copy and paste all the content in to a new instance of the template is really, REALLY stupid. There should be some field you fill in within the U/I that would allow you to specify the name of the book, so that the iBooks app would know if it's a new rev of an existing book, or a new book altogether. Kinda brain dead the way they do it now.

  • How to Print the same field value in a single row

    Hi,
    I need to print the same field values in a single row
    For Examble
    in a table TestTable
    ID Name Value
    1 AB 120
    1 BC 150
    1 CD 130
    2 AB 111
    2 BC 112
    2 CD 113
    I need the query like if the Name contains BC and CD then i need to print like ID, BC Value, CD Value as below
    ID BC'Value CD'Value
    1 150 130
    2 112 113
    Kindly suggest me...
    Thanks in Advance
    Anu

    Hi,
    Since you're on 9i some available functionality unfortunatly isn't at your disposal.
    This should work, however, using your sample data:
    MHO%xe> create table t as ( -- generating sample data:
      2  select 1 cid, 'AB' cname, 120 cvalue from dual union all
      3  select 1, 'BC', 150 from dual union all
      4  select 1, 'CD', 130 from dual union all
      5  select 2, 'AB', 111 from dual union all
      6  select 2, 'BC', 112 from dual union all
      7  select 2, 'CD', 113 from dual
      8  );
    Tabel is aangemaakt.
    MHO%xe> select cid
      2  ,      max(decode(cname, 'BC', cvalue, null)) BC_value
      3  ,      max(decode(cname, 'CD', cvalue, null)) CD_value
      4  from   t
      5  group by cid;
           CID   BC_VALUE   CD_VALUE
             1        150        130
             2        112        113For reference and future challenges, see:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:419593546543
    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php

  • Pulling more than one field into the same field within a report.

    I posted this in the T-SQL forum, but it was suggested it may be better to post it here. This is somewhat complicated, so I hope I am explaining this well. I will post here what I posted there. I will also include two replies I gave in offering further information
    in case that may help to further clarify my question. See below:
    I am attempting to put together a report in Visual Studio 2008. It seemed a simple report at first, but as I am creating the SQL, I am having a little trouble conceptualizing how to get it to work exactly as needed. Here is the issue...
    In this case, the report should show two rows for each department. One is the count of who within an audience (that will be set up as a parameter) completed a certain course (the course may also be a parameter). The next row should be a count, within that
    same department, of all users within the audience. Both counts should be within the same field on the report, but on different rows.
    My thought was to create two CTE's. One would contain the counts, by department, of everybody in the audience. The other would contain the counts, by department, of those within the audience who completed the given course.
    The problem is, though, I need to then have these two counts by department on two separate lines, and they should be within the same field. Basically, the idea is they are the numerator and denominator. There would also be a field before the count that would
    need to identify which one it is. For the sake of the example, call it "Measure_ID" and it would say "CourseCert" for the count of who completed the course and "CourseAvail" for the count of those who are part of the audience.
    Let me know if that makes sense, or if I can provide any further clarification to help you better understand what I am trying to achieve. Does anybody have thoughts on how to do this?

    Unfortunately, the counts need to be in separate rows. If they could be in the same row, it would have probably been a lot easier. I think I could have just done a couple "Case When" type formulas within the list of things under "Select."
    As it is, I need the two counts to show up under the same heading in separate rows. Unfortunately, the table structure of this database is very complicated. I think it would likely just further confuse things if I tried to share all of that detail here.
    That is why I was trying to be generic.
    Unless there is another easier way I am missing, I was thinking the easiest way to achieve what I needed was to use two CTE's. One would list all users by department who belong to a specific audience (the audiences are what we use to then assign them to
    certain courses, so the audience would be the people who are required to complete a certain course). The other would list all user by department who are in that audience and have completed a particular course. I think I am fine to complete that part. It is
    just getting them to then display as in my example that I am not sure how to do.
    The desired result, as you see in my example, has two lines per department, the first being a count of those who completed the course ("Certified"). The second line being a count of those who are required to complete it ("Available").
    Does that help? I was basically hoping somebody had an example they could use, just with fake table names so I could adapt it to my data. If it helps, though, let's pretend the two CTE's are like this:
    Table Name: Certified
    Table's purpose: This table would list all people who had completed the course.
    Fields:
    CourseName
    CourseCode
    AudienceName
    AudienceCode
    CompletionResult
    EmpCode
    DepartmentCode
    Table Name: Available
    Table's purpose: This table would list all people who are assigned to the audience.
    Fields:
    AudienceName
    AudienceCode
    EmpCode
    DepartmentCode
    The desired result would then count the EmpCodes, by department, from each table in that Measure_Amount field so it could display as I showed above. Does that make sense? I apologize if that does not help to clarify. I was trying to be as simple as possible
    so you could just use it as a generic example.

  • How to summary a field from 2 separate tables but having the same fields

    Post Author: thuyvd78
    CA Forum: General
    Hi, I am getting trouble with creating the summary from 2 separate tables. These tables dont have any link together but they have the same fields, such as: part id, qty, etc. I need to create a report that displays whole the information from these tables and also the summary of total qty field of these tablesAny idea to organize this report? Thank you very much! Thuy  

    Post Author: thuyvd78
    CA Forum: General
    Thank you for your help v361.where can I can get the link to download samples for subreport from official website?And can I use FULL INNER query to join these tables. I think this way is much clearer than using subreport but not sure it will work? Thanks Thuy  

  • Using !format on multiple occurrences of the same field

    I'm trying to use the @if function to apply formatting to two occurrences of a field, but am not having any luck so far.  The specific example is that I have two check boxes on the template, and would like to have only one of them checked at a time, using the same field in my data file for both check boxes.  The field that I'm using in my data file is:
    ^field ACCOUNT_TYPE
    And the only two possible values for that field are CHECKING and SAVINGS.  On the first ACCOUNT_TYPE checkbox, I have entered the following !format:
    @(If("@_$_."=="CHECKING","X"," "))
    And on the second ACCOUNT_TYPE check box it is
    @(If("@_$_."=="SAVINGS","X"," "))
    The @if statement works fine when I apply it to only one of the check boxes, but when I apply it to both, nothing populates into the field.  A simple solution would be to change the data, but doing so is not an option in this case for me.  Any help or alternate solutions is appreciated.  Thanks!

    Hi
    I treid different combination keeping the same field name for two radio buttons but it didnt work. You can work out with an alternate solution , keep different name for two radio buttons say : JF07 & JF08
    And under JF07 for !Format event : @(If("@JF03."=="SAVING","S",""))
    And under JF08 for !Format event : @(If("@JF03."=="CHECKING","C",""))
    where JF03 is the field name which may have one of two value : i.e either SAVING or CHECKING
    So your form consits of 2 radio buttons ( JF07,JF08) and one field label JF03. In your dat file you have to refer to first radio button that appears first on the form i.e left to right or top to bottom.(So whatever radio button is appearign first in the sequence on the form from left to right use that radio button in dat file.Here its JF07)
    ^symbolset 108
    ^page 1
    ^field JF03
    CHECKING
    ^field JF07
    ==========
    ^symbolset 108
    ^page 1
    ^field JF03
    SAVING
    ^field JF07
    Hope this layman's altenate solution will give you a bit of relief.
    thanks
    jaY

  • Can we start more than one user created database at the same time

    Hi.,
    Can we start/work more than one user created database at the same time ??
    --Shyam                                                                                                                                                                                       

    Hi Shyam,
    I really dont understand what you have asked?
    If your question is can we start more than one database at the same time then the answer to that is yes but provided to have enough resources on your server to support running of two or more different databases on the same machine.
    Ex Senior DBA

  • I would like to use Formcentral form data to populate a pdf with the same fields.  Is that possible?

    I would like to use Formcentral form data to populate a pdf with the same fields.  Is that possible?

    Randy,
    We have an application that I would like to have in Formscentral.  That application is also in a larger PDF file that once filled in populates all the other forms below it (lease, credit check form, ect).  If the Application on Formscentral keep the same field names as the pdf can I pull the data from formscentral and sill populate the old application pdf so that all the forms below it will be also populated. 
    Greg

  • Getting the name of the previous event of a field in another event of the same field?

    How to get the previous event that has occured on the same field?
    For example when we click a text box click event occurs then the enter event occurs.so want to know how to write a code in enter event of the text box to check that the click event has occured before the current event in java script.?
    Please give an idea.
    Regards,
    Sugan.

    Any changes (like adding new fields, deleting existing field, change field properties of existing fields) applied to the database table has to adjust to changes to their definition in the ABAP Dictionary. So everytime when you make any new change on a database table, table conversion is required to refresh the exisiting entries in  the ABAP dictionary so as to synchronize Database &  Data Dictionary.
    Thanks,
    Rakhi
    Edited by: Rakhi Nair on Oct 4, 2011 7:21 PM

  • Providing F4 help for the same field on selection screen

    Hello Experts,
    My requirement is :
    There are 2 radio buttons and a parameter "p_file" on my selection scree.
    1. rb_appl
    2. rb_pres
    If the radio button rb_appl = 'X', I need to place the logic of F4 help of application server for the field p_file. Else if the rb_pres = 'X', then I need to place the logic of F4 help of presentation server for the same field p_file.
    I have written the code in the below manner
    PARAMETERS: rb_appl RADIOBUTTON GROUP rad DEFAULT 'X',
                             rb_pres RADIOBUTTON GROUP rad ,
                             p_file   TYPE ibipparms-path.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      IF rb_appl = 'X'.
          PERFORM f_applictn_server_filenm.
      ELSEIF rb_pres = 'X'.
        PERFORM f_presentation_filenm.
      ENDIF.
    But I am getting the F4 help for only the radio button for which i have placed the default value in the parameters.
    So please let me know how to define the F4 help for the same field based on the radio buttons.

    Hi,
    You can acheive the same by the addition of [USER-COMMAND fcode].
    RADIOBUTTON GROUP group [USER-COMMAND fcode] - The addition USER-COMMAND can be used to assign a function code fcode to the first parameter in a radio button group. The function code fcode must be specified directly, and have a maximum length of 20 characters. When the user selects any radio button of the radio button group on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and transfers the function code fcode to the component ucomm of the interface work area sscrfields.
    So you code should be altered as
    PARAMETERS: rb_appl  RADIOBUTTON GROUP rad
                         USER-COMMAND radclick    "Addition which you have to make.
                         DEFAULT 'X',
                rb_pres  RADIOBUTTON GROUP rad ,
                p_file   TYPE ibipparms-path.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      IF rb_appl = 'X'.
        PERFORM f_applictn_server_filenm.
      ELSEIF rb_pres = 'X'.
        PERFORM f_presentation_filenm.
      ENDIF.
    Thanks & Regards,
    Harish

Maybe you are looking for