How to create a variance on data that exists iIn only one database column

How to create a variance on data that exists iIn only one database column?
I'm trying to create a calculation to show the difference between the budgets for two different years in a Discoverer crosstab query.
I'm using the lag function to repeat the value of a column for the current year and the year before.

Lag and lead seems to be the only choice and they work excellent. Checkout the new 10g Database features. There is new SQL modal clause which might give additional and powerful analytics but in this case lag and lead should be sufficient.
regards
http://www.infocaptor.com/workbook-dump.php

Similar Messages

  • How to create a report with data using the Crystal Reports for Java SDK

    Hi,
    How do I create a report with data that can be displayed via the Crystal Report for Java SDK and the Viewers API?
    I am writing my own report designer, and would like to use the Crystal Runtime Engine to display my report in DHTML, PDF, and Excel formats.  I can create my own report through the following code snippet:
    ReportClientDocument boReportClientDocument = new ReportClientDocument();
    boReportClientDocument.newDocument();
    However, I cannot find a way to add data elements to the report without specifying an RPT file.  Is this possible?  I seems like it is since the Eclipse Plug In allows you to specify your database parameters when creating an RPT file.
    is there a way to do this through these packages?
    com.crystaldecisions.sdk.occa.report.data
    com.crystaldecisions.sdk.occa.report.definition
    Am I forced to create a RPT file for the different table and column structures I have? 
    Thank you in advance for any insights.
    Ted Jenney

    Hi Rameez,
    After working through the example code some more, and doing some more research, I remain unable to populate a report with my own data and view the report in a browser.  I realize this is a long post, but there are multiple errors I am receiving, and these are the seemingly essential ones that I am hitting.
    Modeling the Sample code from Create_Report_From_Scratch.zip to add a database table, using the following code:
    <%@ page import="com.crystaldecisions.sdk.occa.report.application.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.data.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.document.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.definition.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.*" %>
    <%@ page import = "com.crystaldecisions.report.web.viewer.*"%>
    <%
    try { 
                ReportClientDocument rcd = new ReportClientDocument();
                rcd.newDocument();
    // Setup the DB connection
                String database_dll = "Sqlsrv32.dll";
                String db = "qa_start_2012";
                String dsn = "SQL Server";
                String userName = "sa";
                String pwd = "sa";
                // Create the DB connection
                ConnectionInfo oConnectionInfo = new ConnectionInfo();
                PropertyBag oPropertyBag1 = oConnectionInfo.getAttributes();
                // Set new table logon properties
                PropertyBag oPropertyBag2 = new PropertyBag();
                oPropertyBag2.put("DSN", dsn);
                oPropertyBag2.put("Data Source", db);
                // Set the connection info objects members
                // 1. Pass the Logon Properties to the main PropertyBag
                // 2. Set the Server Description to the new **System DSN**
                oPropertyBag1.put(PropertyBagHelper.CONNINFO_CRQE_LOGONPROPERTIES, oPropertyBag2);
                oPropertyBag1.put(PropertyBagHelper.CONNINFO_CRQE_SERVERDESCRIPTION, dsn);
                oPropertyBag1.put("Database DLL", database_dll);
                oConnectionInfo.setAttributes(oPropertyBag1);
                oConnectionInfo.setUserName(userName);
                oConnectionInfo.setPassword(pwd);
                // The Kind of connectionInfos is CRQE (Crystal Reports Query Engine).
                oConnectionInfo.setKind(ConnectionInfoKind.CRQE);
    // Add a Database table
              String tableName = "Building";
                Table oTable = new Table();
                oTable.setName(tableName);
                oTable.setConnectionInfo(oConnectionInfo);
                rcd.getDatabaseController().addTable(oTable, null);
        catch(ReportSDKException RsdkEx) {
                out.println(RsdkEx);  
        catch (Exception ex) {
              out.println(ex);  
    %>
    Throws the exception
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: java.lang.NullPointerException---- Error code:-2147467259 Error code name:failed
    There was other sample code on SDN which suggested the following - adding the table after calling table.setDataFields() as in:
              String tableName = "Building";
                String fieldname = "Building_Name";
                Table oTable = new Table();
                oTable.setName(tableName);
                oTable.setAlias(tableName);
                oTable.setQualifiedName(tableName);
                oTable.setDescription(tableName) ;
                Fields fields = new Fields();
                DBField field = new DBField();
                field.setDescription(fieldname);
                field.setHeadingText(fieldname);
                field.setName(fieldname);
                field.setType(FieldValueType.stringField);
                field.setLength(40);
                fields.add(field);
                oTable.setDataFields(fields);
                oTable.setConnectionInfo(oConnectionInfo);
                rcd.getDatabaseController().addTable(oTable, null);
    This code succeeds, but it is not clear how to add that database field to a section.  If I attempt to call the following:
    FieldObject oFieldObject = new FieldObject();
                oFieldObject.setDataSourceName(field.getFormulaForm());
                oFieldObject.setFieldValueType(field.getType());
                // Now add it to the section
                oFieldObject.setLeft(3120);
                oFieldObject.setTop(120);
                oFieldObject.setWidth(1911);
                oFieldObject.setHeight(226);
                rcd.getReportDefController().getReportObjectController().add(oFieldObject, rcd.getReportDefController().getReportDefinition().getDetailArea().getSections().getSection(0), -1);
    Then I get an error (which is not unexpected)
    com.crystaldecisions.sdk.occa.report.lib.ReportDefControllerException: The field was not found.---- Error code:-2147213283 Error code name:invalidFieldObject
    How do I add one of the table.SetDataFields()  to my report to be displayed?
    Are there any other pointers or suggestions you may have?
    Thank you

  • How to Create report in Material Master that outputs stock

    Hi,
         How to Create report in Material Master that outputs stock, grouped by Material Type and Plant. The output shows Material No, Storage location, Unit of Measure and Description in addition to group totals. Data was extracted from MARA, MARC, MARD, MAKT,MKPF,
         MSEG and T001W.and what are the fields to be used.

    hi,
    check the transaction MMBE or MC.9..
    for mmbe the program is RMMMBESTN.
    check the logic in the program.

  • How to Create Rule in Interface Data Transformer.

    Hi,
    If any one know how to Create Rule in Interface Data Transformer(IDT) Super user by using Lookup(Oracle R12 Version) Please help me on this.
    I have one value in GL Interface table, while loding data into base tables (GL_JE_BATCHES, GL_JE_HEADERS, GL_JE_LINES) that values replace with another value.
    For that purpose we have to use Interface Data Transformer.
    If any one how to create rule in IDT, Please give me a example how to create rule by using Lookup.
    Thanks in Advance.
    Regards
    Varma.

    Hi;
    Please check below note which could be helpful for your issue:
    Setup Checklist for the Interface Data Transformer - Global Consolidations System [ID 277875.1]
    Regard
    Helios

  • How to create user function in Data Functions in Query Designer?

    Could someone tell me how to create user function in Data Functions in Query Designer?
    I mean function like "NDIV0" in Data Functions.
    SAP BW 3.x.
    Query Designer (SAP BW 3.x)

    Hi check the following URL, it gives how to add in Formulas in formula Builder, not in DataFunctions.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f095592f-42f7-2a10-6ab1-c836a559b48f
    Thanks
    Reddy

  • SMARTFORM: how to create 3 copy (each copy can print more than one page)

    SMARTFORM: how to create 3 copy (each copy can print more than one page)
    Hello everyone.
    my user want to have form that print 3 copy.
    such as 1 copy description = master,  2 copy description = copy 1 ,3 copy description = copy 2.
    so i create 3 page . I copy from page 1.
    and in each page there is main window which can have data more than 1 page.(such as have a lot of sale data ,it's take 2 page for show output .so it's take 2 page in each copy)
    please help me.
    how to set page and window in each page for print 3 copy and each page can have main window that print more than 1 page

    Hello Vinit.
    thank you very much for your help.
    could you help me more please.
    in below code
      DO NAST_ANZAL TIMES.
    l_counter = l_counter + 1.  " << pass this to FM and use for the TEXT to print
    CALL FUNCTION LF_FM_NAME
               EXPORTING
                         COUNTER = l_COUNTER   " USE this to derive the text into PRINTOUT
    enddo.
    Now i out of office .so i cannot test.
    where do i set NAST_ANZAL for 3 ?
    can i input ?
    NAST_ANZAL = 3.
      DO NAST_ANZAL TIMES.
    l_counter = l_counter + 1.  " << pass this to FM and use for the TEXT to print
    CALL FUNCTION LF_FM_NAME
               EXPORTING
                         COUNTER = l_COUNTER   " USE this to derive the text into PRINTOUT
    enddo.
    Edited by: dittaporn nanasilp on Mar 12, 2011 3:33 PM

  • How to create a credit memo for an existing sales order !

    Can any body help for how to create a credit memo for an existing sales order !

    Hi,
    It is actually possible to create credit memos from sales orders though it is not followed in most of the scenarios.
    We have got a scenario in commodity trading that a sales order will be created with positive value. Once the swaps are settled by the portfolio mngt team, if we have to give some money to the payer, then a credit memo will be greated (as in their case all invoices will have only +ve value as net value) with reference to the sales order. In the copy control, the main field to be taken care of at itme level is the PRICING TYPE for which a value of F has to be maintained. This will convert the sign of the values and fix them. Now a credit memo will be created for teh saels order.
    In this case, the document cateogyr of sales order will be C in VBAK, but it will be K in VBFA table which is the table for document flow.
    Hope this answers your question. You can reward if it helps you.
    Otherwise the normal process is
    SALES ORDER---INVOICECREDIT MEMO REQUEST----CREDIT MEMO

  • Could somebody teach me how to set the lastest iTunes so that it repeats just one of the numbers installed from the CD? I've alreadly tried it by clicking "control" and the bottom, but it doesn't work. Thank you.

    Could somebody teach me how to set the latest iTunes so that it repeats just one of the numbers installed from the CD?
    I've already given it a try by clicking "control" and the bottom item which means one item in Japanese, but it doesn't work.
    Thank you.

    You can access the repeat options if you right-click on the shuffle icon or if menus are enabled you can use
    Controls > Repeat > Off | All | One.
    Once the control is visible you can click it to switch between states as before. If the control is turned to off it disappears on the next track change. In contrast the shuffle control remains visible whenever it is appropriate. Hopefully the next release will fix this.
    The bottom one should do it.
    tt2

  • I need to copy data from a table in one database (db1) to another table in

    Hi
    I need to copy data from a table in one database (db1) to another table in another database (db2).
    I am not sure if the table exists in db2,,,if it doesnot it needs to be created as well data also needs to be inserted...
    How am I supposed to this using sql statements..?
    I shall be happy if it is explained SQL also...
    Thanking in advance

    How many rows does the table contains? There are manyway you can achieve this.
    1. export and import.
    2. create a dblink between two databases and use create table as select, if structure doesnot exists in other database, if structure exists, use, insert into table select command.
    example:
    create a dblink in db2 database for db1 database.
    create table table1 as select * from table1@db1 -- when there is no structure present
    -- you need to add constraints manually, if any exists.
    insert into table1 select * from table1@db1 -- when there is structure present.
    If the table contains large volume of data, I would suggest you to use export and import.
    Jaffar

  • Create multiple portal instances with only one database?

    Can someone create multiple portal instances with only one database?
    If so, how is this done, just by running the portal configuration wizard?
    How are most people running with multiple developers working on portal? Do they share a portal instance, or create their own?
    Thank you very much!
    Phillip

    i'm currently using 9ias rel 2(9.0.2) and i have install one infrastructure and two mid tier, hoping that this will create two portal, but it didn't. Can you please tell me how to do create two portal within one server.
    thanks and regards;
    andrew

  • Where can I see the downloads LIST when downloading podcasts, like in the older version of iTunes?  I find it frustrating that I see only one at a time now !  Any suggestions please?

    Where can I see the downloads LIST when downloading podcasts,
    like in the older version of iTunes?  I find it frustrating that I see only one
    download at a time now !  Any suggestions please?

    Thanks for taking a stab at it: that didn't prove to be the problem. That option in the settings for tabbed browsing was not checked.
    I may be a bit behind the times: I am used to tabbed browsing showing all the tabs it possibly can, instead of just the last one. Sometimes it won't even show the last tab: I can have 15 tabs open, and not see a single tab. I've been confused by this into closing a window with lots of tabs open, because it looks like a single page-window.
    My main problem with the tab-bar flashing to the end of the row is that it means a great deal more mouse-clicking around to browse.
    I haven't tried installing the latest beta. Maybe that would fix the problem.
    Toddo

  • Mac, have just upgraded to Yosemite and when I shall open Photoshop (CS4), the following message appears: "The licensing of the product does not work" Fault 6 How should I proceed? Have the program installed on only one computer.

    Mac, have just upgraded to Yosemite and when I shall open Photoshop (CS4), the following message appears:
    "The licensing of the product does not work"
    Fault 6
    How should I proceed?
    Have the program installed on only one computer.

    Download the Adobe Licensing Repair Tool.
    Run the License Service Update.
    Mac OS X 10.7 and above:
    a. Double-click the LicenseRecovery111.dmg   It will extract the folder. Open the folder.
    b. Double-click your Hard Drive.
    c. Double-click Applications.
    d. Double-click Utilities.
    e. Double-click Terminal.
    f. Type sudo python
    Note: There is a space following “python”. Do not press Return.
    g. Drag LicenseRecover.py from the LicenseRecovery111 folder onto the Terminal Window and press Return.
    It should look like this:
    h. Enter your administrator user name and password when prompted and click OK.
    (Note: the cursor will not move and you will not see stars or dots, just enter your password anyway.
    i. Let the script run, it will tell you when it is finished. Quit terminal and restart Photoshop
    Gene

  • How to create APEX report from data in PLSQL table

    Hi, I have a procedure that is creating/inserting records into multidimensional pslql table. I want to create a report and graph based on the data stored in plsql table. Can someone please advice how to can I select this data in apex OR point me to any sample code?
    Thanks
    Aali

    Hi,
    try to google something about ORACLE TABLE CAST
    SELECT ot.yourcolumn
    FROM
       TABLE(CAST(yourplsqltablevariable AS userdefinedoracletype)) otE.g.
    http://it.toolbox.com/blogs/oracle-guide/using-a-plsql-table-in-sql-11013
    Regards,
    R.

  • How to create a chart with dates?

    I've created a table with projects I have to deliver and the date they were delivered. I would like to create a chart from this data - however I can't figure out how to use date in the chart.
    Ideally the chart would work with the date (lets say from jan 01 to april 5) on the x-axis and the project on the y-axis. And a line that goes from time A (which marks the initial part of the project) to the time B (which marks the delivery date) defined on the table.
    Is it possible?
    heres a pic of what i mean:
    /Users/judavies/Desktop/Screen shot 2011-01-14 at 11.36.12 AM.png
    Message was edited by: jujudavies

    Hi Jerry,
    I'm ALMOST there! If you could help me with one last thing it would be amazing. I've uploaded my number project and you can downloaded it on the link bellow, if you prefer.
    I managed to do the same idea chart as you have. However I would like to have two bars for every JOB (y-axis). On my table i've inputed for every job 4 values = START DATE that was scheduled / Duration period scheduled (this happens prior to the job itself // START DATE Delivered / Duration Period Delivered (this is the actual time the JOB took place). This way I can see at the end of a JOB if I worked during the period I planned.
    using your example on the chart above (your reply) Could Proposal have a bar 1.0 / 4.0 - and bellow this bar have another one (with different colours) that went from 2.0 / 5.0 - for example? - the first one representing the "scheduled dates"and the second one representing what actually happened.
    I managed to do the four bars but couldnt manage to have them bellow each other.
    Tks again for your help
    files.me.com/jujudavies/wgugl1.numbers.zip
    x'jul.

  • How to create a folder with date each day?

    I've not used Automator, just once to "create" a workflow to create a new folder with a name; but what I want is this:
    Each morning at 12:01 am, a new folder to be created with the correct date as the name of the folder.
    So for tomorrow, Sunday 23 Nov 2008 at 12:01, I'd suddenly have a folder on my Hard Drive that would have the date like 23 Nov 2008 or 11/23/2008 or 23-11-2008 or similar.
    Then at the end of a week I'd have 7 of these; - but I can manually trash them-- I want to create these on my HD since I backup via SuperDuper! each morning (automatically) at 3:35 am (incremental backup to an external La Cie HD) and I want to know if was done, so by having a folder with the date on it I can open the external HD and if I see that that folder with the recent date is there, then I'm confident the BackUp was run.
    I have been able to create a workflow to create a folder in Automator, but not sure how to:
    1. Have the folder created automatically each day at 12:01
    2. How to have the folder label be the date
    Thanks for any comments or certainly any other work-around or other way to do this or similar.
    Regards, Steve

    Open the AppleScript Editor. Copy the following into it:
    set dt to date string of (current date)
    set mth to word 2 of dt
    set dy to word 3 of dt
    set yr to word 4 of dt
    set dtt to mth & " " & dy & " " & yr
    tell application "Finder"
    make new folder at alias "Macintosh HD:Users:username:Desktop:" with properties {name:dtt}
    end tell
    Amend the path with your Hard Disk name and username. Save as an application to anywhere suitable.
    In iCal, set up an event with a daily repeat and an alarm at the time you want it: under 'Alarm' choose 'Open file': then in the next menu which will appear change from 'iCal' to 'Other' and navigate to your script. Enter the date and time.
    Your folder will be created as required: iCal does not need to be running. This script gives the folder name as, for example, 'November 22 2008', but it's easy to amend the script if you want something a bit different - for example:
    property zro : ""
    set yr to year of (current date) as string
    set dy to day of (current date)
    set mt to month of (current date)
    set dyy to dy as string
    set nmm to the number of items in dyy
    if nmm is 1 then
    set zro to 0
    end if
    if mt is January then
    set mth to "01"
    else if mt is February then
    set mth to "02"
    else if mt is March then
    set mth to "03"
    else if mt is April then
    set mth to "04"
    else if mt is May then
    set mth to "05"
    else if mt is June then
    set mth to "06"
    else if mt is July then
    set mth to "07"
    else if mt is August then
    set mth to "08"
    else if mt is September then
    set mth to "09"
    else if mt is October then
    set mth to "10"
    else if mt is November then
    set mth to "11"
    else if mt is December then
    set mth to "12"
    end if
    set dtt to mth & "-" & zro & dy & "-" & yr as string
    tell application "Finder"
    make new folder at alias "iBook HD:Users:roger:Desktop:" with properties {name:dtt}
    end tell
    This gives the folder name as, for example, 11-22-2008. (The days will have leading zeros, if you don't want these just remove the references to 'zro'.)

Maybe you are looking for

  • ICal error  "server did not recognize your user name"

    I recently was added to the MobileMe calendar beta, and now my iCal calendar doesn't sync with MobileMe. iPhone works fine. Error message when I launch iCal says "server did not recognize your user name" Any thoughts, suggestions would be appreciated

  • Conversion of outlook data

    how do I convert my address book from explorer to Safari? I am unable to download Explore anymore because it has been discontinued for the Mac.

  • Safari eating up 75% of CPU

    Hello, I would like to know if anyone has any suggestions on what is wrong with my browser. The past couple weeks Safari has slowed drastically and I can't really figure out why. I have emptied the cache, and deleted all of the favorite icons a few t

  • Employee TimeSheet

    Hi All, How an employee can enter his daily Timesheet details in SAP...?? I believe this activity falls under HR Module..Am i right? Can anyone explain me about TimeSheet Management in SAP..? (Like Related Database Tables, Transaction Codes)... Thank

  • STILL no ExpressCard support in 3.1

    Yep - Unless I have missed something - there is STILL no ExpressCard support in release 3.1. Begs the question - what has been done to it since 3.0?