Combining different measures based on different dates in a single table

Hi,
I'm attempting to produce a report that gives two counts of items in a database, the first based on the date added to the database, the second based on the date marked as deleted, all reported by month over the last 12 months.
The following pertinent fields are available for use in the query builder:
Item ID, Entry Date, Deleted Date, End date of previous month, End date of previous month last year.
The report should look something like this:
Month.....Total Items....Additions....Deletions
May 08....54.............. 43...............3
Apr 08.....654..............600.............0
Mar 08.....654..............0................0
Feb 08.....654.............10...............10
Jan 08.....53................0................601
Jul 08......96................3................2
Jun 07.....46................4................54
Month:
=If(DaysBetween([Last Day Of Prev Month Prev Year];[Entry Date])>0;
+Month([Entry Date]) + " " + FormatNumber(Year([Entry Date]);"####");+
"Previous Balance")
Total Items:
=RunningSum(Count([Item Id]))-RunningSum(Count(Item ID) Where(Not(IsNull([Deleted Date]))))
Item Additions:
=Count([Item ID])
Item Deletions:
=Count([Item ID]) Where(Not(IsNull([Deleted Date])))
The part I'm having problems with is splitting the results by month, such that the number of deletions equals the number of items deleted that month, rather than the number of items deleted that month of the items added that month. I.e. I need to split by month on the additions date for the additions column and by month on the deletions date for the deletions column.
At the moment, if the 54 items deleted in Jul 07 were originally added to the DB in, say Mar 06, then they would show up as deletions in Mar 06 - because the Month column is being split out based on Additions date. Of course I could reverse this and split the months out by deletion date, but then I would have the same problem in reverse - I can't see any way of doing both.
Any ideas?
I hope I've explained that so that it makes vague sense, please ask if it doesn't!
Many thanks in advance,
Steve

Have you tried splitting this out into 2 seperate queries the first to return the additions by month and the second to return the deletions by month. You should then be able to merge the date dimensions and report both additions and deletions against a single date dimension.
Regards,
Mike

Similar Messages

  • Exporting form data to a single table

    I have created a form in LiveCycle Designer ES 8.2  and simply want to export the data into a single table that I can then import into Access. It appears that in LiveCycle the row elements of a table are children of the table element and the column elements are children of the row elements.  I am wondering if there is an easy way to design a form in LiveCycle so that each cell of a table is a root element like the rest of the fields in the form.  I basically want to export one row of data from each form and append it to a larger table. Exporting the data as csv or tab-delimited would be sufficient, but neither of these appears to be an option.

    The only way I've found to do this is to open the form in Acrobat, click Forms, mouse over Manage Form Data, then click Export Data. Your only options are to save as .xml or .xdp. I saved my data as .xml. I was then able to import the .xml file into excel by clicking Data, mousing over xml, clicking Import... and browsing to the Acrobat generated .xml file. I know this is convoluted but it's the only way I've found to get the data into a spreadsheet. Acrobat exports the data as filename_data.xml, i.e. a form named contacts will export it's data as contacts_data.xml. Be aware, I've only tested this on a form that had a table in it and nothing else. If your table is part of a form with other fields in it I have no idea how the other data will look after exporting.

  • Text Entry Box - Different Results based on Different Entries?

    Hello,
    I'm trying to figure out a way to use the Text-Entry Box (if there's a better tool to go about this, let me know) in order to bring up a particular caption box with a particular response. So for example, in a standard text-entry box, I have listed 4 possible "correct" answers, and for this example, I'll just say answer 1, answer 2, answer 3, and answer 4. I would like each answer to bring up a different caption box with a different statement based on which answer they type in. Basically:
    Answer one -> Caption 1
    Answer two -> Caption 2
    etc.
    All I can ever get is for each answer to just respond to the same standard buttons, Success, Failure, etc. I can't seem to add a new button that would pop up like the standard ones, or, as I would like better, Captions instead. Any ideas?

    Hello,
    Perhaps it is a problem with terminology, but as the 'proclaimed' advanced actions freak I have to ask what you mean by your latest answer 'captions did not come as variables to use'. A button is not a variable in my mind, but you mean perhaps the object ID? Which statement did you use in the advanced actions where the object ID of the captions do not show? AFAIK that is only the case with the statements Assign and Expression if you use variables, but there the button will not be in the list as well.
    Do you understand why I'm puzzled?
    My work flow would be this one:
    Create the Text captions TC_one, TC_two... and set them to invisible
    Create the Advanced conditional action that checks which (correct) answer was chosen, this action will have one decision for each correct answer; the action to be executed is to show TC_one in case answer1 was chose, TC_two for answer2 etc. If you allow the user to change his answer, hide at the same time the other captions
    Attach this action as Success action to the TEB, and have a shortcut or the Submit button like you wish.
    In case you allow also a Retake functionality, where the user returns to this slide, you'll need sort of a Reset that hides all Text Captions when entering the slide
    Please, I hope you'll take the time to answer my question in the first paragraph.
    Lilybiri

  • How to display appcmd /config xml data into a single table

    Hi,
    I extracted my IIS sites using appcmd
    appcmd /site /config /xml > c:\temp\iisconfig.xml
    afterwhich I would like to grab the data from this xml and export into excel file
    [xml]$iisconfig = get-content c:\temp\iisconfig.xml
    I would like to get the Site Name, Bindings, Physical Directory Path and AppPool from this xml file and output to a excel file
    #Physical Path Directory
    $iisPhysicalPath = $iisconfig.appcmd.site.site.application.VirtualDirectory.PhysicalPath
    #Application Pool
    $iisAppPool = $iisconfig.appcmd.site.site.application.applicationPool
    #Site Details (Site Name, Binding)
    $iisSite = $iisconfig.appcmd.site
    It doesn't have a single command to output into a table. How do I combine all these code and display in a single table?
    Jeron

    Try it like this:
    $sites=[xml](c:\windows\system32\inetsrv\appcmd.exe list site  /xml)
    $sites.appcmd.site
    \_(ツ)_/

  • Add a legend or control group to set different settings based on different user scenarios on a button click

    In the settings page of my application, I want to add a group of settings pertaining to a particular setting requirement. So when a user clicks an "Add" button, a legend type control should come up with required set of controls like text boxes
    and/or toggle buttons inside where the user can enter their custom settings and save it. Now if the user again click on "Add" button, again a set of controls should be displayed where a user can set up some settings for other user scenarios.
    So my question is how to implement this, and how to access the parent legend control, and access the values of the child element, to get the values of the setting values entered by the user.
    I hope my question is clear?.
    Any help or suggestions regarding this would be great.
    Thanks In Advance.

    Hi Siddy,
    >>So when a user clicks an "Add" button, a legend type control should come up with required set of controls like text boxes and/or toggle buttons inside where the user can enter their custom settings and save it. Now if the user
    again click on "Add" button, again a set of controls should be displayed where a user can set up some settings for other user scenarios.
    If I'm not misunderstanding, we can consider using Popup control to show the addition information or a set of controls:
    http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.primitives.popup
    For example, in this sample:
    https://code.msdn.microsoft.com/How-to-render-html-to-6a9cabe5
    The author placed a WebBrowser control to Popup's child panel.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Different actions based on different drop down selection

    Hi,
    I am new to WebDynpro so still getting to used to the differences with what I am used to. My question is this:
    Is it possible to create a drop down list (by key) in a top view that allows the user to display one of three views in the bottom view? I know it is possible if I add a button, but I want it to look like one form so that the user is unaware of the difference. The "logical" way to me would be to have an action created for each option in the drop down list, but this does not seem possible. Any suggestions on how I could do this?
    Thanks,
    Helen

    As already explained by other posters, this is possible:
    Define an action with a parameter "selectedKey" of type string.
    Bind the DropDownByKey.onSelect event to this action.
    Map the event parameter "key" to the action parameter "selectedKey" by writing this line of code inside method wdDoModifyView():
    if (firstTime)
      IWDDropDownByKey dd = (IWDDropDownByKey) view.getElement("<ID of your drop-down>");
      dd.mappingOfOnSelect().addSourceMapping
        "key", /* event parameter name, see JavaDoc */
        "selectedKey" /* action parameter name */
    The effect of this mapping is that at runtime, the action handler parameter "selectedKey" contains the key that has been selected from the drop-down list.
    In the action handler, you can navigate to the view that corresponds to the selected key by calling the outbound-plug to this view. These firePlug* methods will be generated by the framework, if you have defined the corresponding navigation links in the view modeller.
    But: I would not use at all a drop-down list to switch views because this will not match most user's expectation. Links are more appropriate to indicate navigation to other views.
    Armin

  • Data pump export single tables with specific criteria with the API

    Hello, I'm trying to export some table data from a schema using dbms_datapump API, but it gives me problems and it takes too much time to elaborate and I don't understand why! I want to export data only in a dmp file, that I will use later to import in an other schema. I'm using Oracle 10g R2 .
    I want to export data from TABLE1 and TABLE2, and ONLY the first 10 rows (this is for test now). I used the data_filter to write the subquery to filter the rows, and NAME_LIST to filter table names. I've set INCLUDE_METADATA to 0, to not export metadata. But it takes 10 minutes to run, and the output log says that there was an error (after 10 minutes??!):
    content of : table_dump.log
    Starting "MYSCHEMANAME"."SYS_EXPORT_TABLE_02": 
    Estimate in progress using BLOCKS method...
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 0 KB
    ORA-39166: Object IN ('TABLE1' was not found.
    ORA-39166: Object 'TABLE2') was not found.
    ORA-31655: no data or metadata objects selected for job
    Job "MYSCHEMANAME"."SYS_EXPORT_TABLE_02" completed with 3 error(s) at 15:58:47
    This is the code I use:
    DECLARE
      handle NUMBER;
      status VARCHAR2(20);
    BEGIN
      handle := DBMS_DATAPUMP.OPEN ('EXPORT', 'TABLE');
      dbms_datapump.add_file(handle => handle,filename => 'table_dump.log',directory => 'DATAPUMP_DIR',filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
      dbms_datapump.add_file(handle => handle,filename => 'table_dump.dmp',directory => 'DATAPUMP_DIR',filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE);
      dbms_datapump.metadata_filter(handle, 'SCHEMA_EXPR', 'IN (''MYSCHEMANAME'')');
      dbms_datapump.metadata_filter (handle, 'NAME_LIST', 'IN (''TABLE1'',''TABLE2'')');
      dbms_datapump.data_filter(handle, 'SUBQUERY', 'WHERE rownum <= 10', 'TABLE1', 'MYSCHEMANAME');
      dbms_datapump.data_filter(handle, 'SUBQUERY', 'WHERE rownum <= 10', 'TABLE2', 'MYSCHEMANAME');
      dbms_datapump.set_parameter(HANDLE => handle,NAME => 'INCLUDE_METADATA', VALUE => 0) ;
      dbms_datapump.START_JOB(handle);
      dbms_datapump.WAIT_FOR_JOB(handle, status);
    END;
    /Edited by: user10396517 on 27-feb-2012 9.17 - added the code formatting

    Welcome to the forums. When pasting code use the {  code  } tags for better readability. See the FAQ for other details. And always feel free to include all the ddl/dml for your test cases so we don't have to do much more than run your code to reproduce it ourselves.
    I've had very little luck with NAME_LISTs. Though I know you can do similar with NAME_EXPR:
    SQL> create table table1 as select * from dba_tables where rownum <= 20;
    Table created.
    SQL> create table table2 as select * from dba_tables where rownum <= 20;
    Table created.
    -- note 20 rows each.
    SQL> DECLARE
    handle NUMBER;
    status VARCHAR2(20);
      2    3    4  BEGIN
      5  handle := DBMS_DATAPUMP.OPEN ('EXPORT', 'TABLE');
      6  dbms_datapump.add_file(handle => handle,filename => 'table_dump.log',directory => 'DATA_PUMP_DIR',filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
      7  dbms_datapump.add_file(handle => handle,filename => 'table_dump.dmp',directory => 'DATA_PUMP_DIR',filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE);
      8  dbms_datapump.metadata_filter(handle, 'SCHEMA_EXPR', 'IN (''ANDY'')');
      9  dbms_datapump.metadata_filter (handle, name=> 'NAME_EXPR', value=> 'IN (''TABLE1'',''TABLE2'')');
    10  dbms_datapump.data_filter(handle, 'SUBQUERY', 'WHERE rownum <= 10', 'TABLE1', 'ANDY');
    11  dbms_datapump.data_filter(handle, 'SUBQUERY', 'WHERE rownum <= 10', 'TABLE2', 'ANDY');
    12  dbms_datapump.set_parameter(HANDLE => handle,NAME => 'INCLUDE_METADATA', VALUE => 0) ;
    dbms_datapump.START_JOB(handle);
    13   14  dbms_datapump.WAIT_FOR_JOB(handle, status);
    15  END;
    16  /
    PL/SQL procedure successfully completed.
    SQL> !cat /u01/app/oracle/admin/test1/dpdump/table_dump.log
    Starting "SYS"."SYS_EXPORT_TABLE_18":
    Estimate in progress using BLOCKS method...
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 128 KB
    . . exported "ANDY"."TABLE1"                             29.32 KB      10 rows
    . . exported "ANDY"."TABLE2"                             29.32 KB      10 rows
    Master table "SYS"."SYS_EXPORT_TABLE_18" successfully loaded/unloaded
    Dump file set for SYS.SYS_EXPORT_TABLE_18 is:
      /u01/app/oracle/admin/test1/dpdump/table_dump.dmp
    Job "SYS"."SYS_EXPORT_TABLE_18" successfully completed at 17:01:41 As for your time issues, nothing is preventing you from seeing what your datapump session is doing. If it is waiting on something, doing a full scan of something, etc.
    Good luck.

  • How to compare data in a single table by month and year

    Hello Please.,
    i would like to see the 2014-06 matched results (3rd query),
    if the same ssn and acctno is exist in 2012-06 and 2013-06 and 2014-06 then eliminate from results, otherwise show it
    select ssn, acctno From jnj.drgSamples where Channel ='KM' and TrailMonth ='2012-06'
    select ssn, acctno From jnj.drgSamples where Channel ='KM' and TrailMonth ='2013-06'
    select ssn, acctno From jnj.drgSamples where Channel ='KM' and TrailMonth ='2014-06'
    i have written the below query but it shows only matched across three queries, but i want to display / delete from 2014-06 records if the ssn and acctno is exist in 2012-06 and 2013-06
    select c.*  from (
    (select * From jnj.drgSamples where Channel ='KM' and TrailMonth ='2012-06' ) a join
    (select * From jnj.drgSamples where Channel ='KM' and TrailMonth ='2013-06' ) b on a.SSN = b.SSN  and a.acctno = b.acctno  join
    (select * From jnj.drgSamples where Channel ='KM' and TrailMonth ='2014-06' ) C on a.SSN = c.SSN  and a.acctno = c.acctno  join
    Please Help me with this
    Thank you very much in Advance
    Asitti

    This is a relational division problem T-SQL:
    Relational Division
    Try:
    ;with cte as (select ssn, acctno, count (distinct(TrailMonth)) as cntMonths
    from jnj.drgSamples WHERE Channel = 'KM' AND TrailMonth IN ('2012-06','2013-06',2014-06'))
    GROUP BY ssn, acctno)
    delete from jnj.drgSamples S where exists (select 1 from cte where S.ssn = cte.ssn and S.acctno = cte.acctno and cte.cntMonths = 3)
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Amount in different colomns based on week...

    Requirement is
    On the selection screen user enters a date..i have to display the amounts corresponding to last 4 weeks in 4 different colomns based on the date entered..Can any one suggest me how to acheive this.
    Regards
    Ansari

    Logic would be as below :
    Define things appropriately
    Data : zweek(6) type c.
    IF i_step = 2.
    READ TABLE i_t_var_range
                           WITH KEY vnam = 'zdate' INTO ls_var.
    *****Use function module DATE_GET_WEEK******** just pass *****ls_var to the same.Get the week value to ZWEEK
            l_s_range-low = zweek.
            l_s_range-sign = 'I'.
            l_s_range-opt  = 'EQ'.
            APPEND l_s_range TO e_t_range.
          ENDIF.

  • Execute BAPI for different input values and dispaly data in a table

    Hi all,
    I have a specific problem about executing BAPI multiple times for different input values and didplay result in a table.
    I am using the code similar to the following logic.
    Bapi_Mydata_Input in = new Bapi_Mydata_Input();
    wdContext.nodeBapi_Mydata_Input().bind(in);
    String in = wdContext.currentperdataElement.getnumber();
    in.setDestination_From(10)
    wdThis.wdGetMydataComponentController().executeBapi_Mydata_Input();
    in.setDestination_From(20)
    wdThis.wdGetMydataComponentController().executeBapi_Mydata_Input();
    in.setDestination_From(30)
    wdThis.wdGetMydataComponentController().executeBapi_Mydata_Input();
    And I want to display the data in a single table. I want the result in a table for Bapi execution based on input parameters passed 10,20 30.
    But I am getting the table data only for the input parameter 30.I mean its actually display the data in table only for the last input parameter.
    So May I ask you all if you know the solution for this problem.PLease advise me with some tips .or sample code is very much appreciated.I promise to award points to the right answer/nice advises.
    Regards
    Maruti
    Thank you in advance.

    Maruti,
    It seems that WDCopyService replaces content of node, rather then adds to content.
    Try this:
    Bapi_Persdata_Getdetailedlist_Input frelan_in = new Bapi_Persdata_Getdetailedlist_Input();
    wdContext.nodeBapi_Persdata_Getdetailedlist_Input().bind(frelan_in);
    final Collection personalData = new ArrayList();
    String fr1 = wdContext.currentE_Lfa1Element().getZzpernr1();
    frelan_in.setEmployeenumber(fr1);
    wdThis.wdGetFreLanReEngCompController().executeBapi_Persdata_Getdetailedlist_Input();
    WDCopyService.copyElements(wdContext.nodePersonaldata(), wdContext.nodeNewPersonaldata());
    for (int i = 0, c = wdContext.nodePersonaldata().size(); i < c; i++)
      personalData.add( wdContext.nodePersonaldata().getElementAt(i).model() );
    String fr2=wdContext.currentE_Lfa1Element().getZzpernr2();
    frelan_in.setEmployeenumber(fr2);
    wdThis.wdGetFreLanReEngCompController().executeBapi_Persdata_Getdetailedlist_Input();
    WDCopyService.copyElements(wdContext.nodePersonaldata(), wdContext.nodeNewPersonaldata());
    for (int i = 0, c = wdContext.nodePersonaldata().size(); i < c; i++)
      personalData.add( wdContext.nodePersonaldata().getElementAt(i).model() );
    wdContext.nodeNewPersonalData().bind( personalData );
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • Can you create a javascript dynamic menu based on security data in oracleDB

    I am looking for a dynamic javascript menu that is generated based on the user role... basically i get the user role from ldap and then I have a Security table in oracle data base that has the permission info and i want to generate my dynamic menu based on the data in the database table.... the table has the following columns
    private String userId;
    private String security_level; // page level , field level
    private String permission; //CRUD
    private String permissionType; //ALLOW, DENY

    Hello Suzie,
    It is possible but you have "many" ways to do it, since what will happen is the javascript will be generated by an application.
    Are you developing a J2EE application? with or without JSF?
    The best way will be to Google to find a good Javascript menu library, and adapt the generation of it based on the content of your database.
    Regards
    Tugdual Grall

  • Creating Time Dimension from date columns in fact tables.

    I remember watching a demo from a BI Tool a couple years ago, wich I swear was OBIEE, and the presentator stated it was possible to create a Time Dimension in the admin tool, based on a date column in other table.
    Can you guys tell me if there's such functionality in OBIEE?
    If so, how could I achieve that?!
    Thanks in advance!
    Marcos

    hi,
    You are trying to make Fact table as Dim table ???
    Fact table has some dim columns??
    We can do this by making a fact table as dim table ,create a dim hierarchy on that table
    Year level :Extract(year from fact_date_column)
    Month and year  level:CAST (Extract(month from fact_date_column) As CHAR(5) ) || CAST (Extract(yearfrom fact_date_column) As CHAR(5) )
    Like this
    But,be careful while doing this make sure that all joins and content levels are good
    As per my knowledge this is not a good way,Experts can add some words lets see!!!!!! :-)
    thanks,
    saichand.v

  • Function... to capture data in worksheet  to table help needed

    hi,
    I am new to this field, i need a sample code, for the following
    A function1 should capture data elements like 3 to 4 values from discoverer worksheet1 and those values must me transfered to dummy tables..
    The data in the dummy tables should be deleted once it is being captured by Function2
    Other function2 should capture those data from dummy tables and pass it to other worksheet2. the result on the worksheet 2 will be based on the data in the dummy tables
    It would be really helpful, if i get a sample code for this process..
    regards
    -Seetha.

    Hi Sabine,
    I created a worksheet 1, which shows the amount of all
    customers for Quater1, Quater 2, Quater3 and Quater 4.
    And in the end it will show total amount for Quat1,
    Quat2,Quat3 and Quat4.
    eg.
    CUSTOMER     Quat1     Quat2     Quat3     Quat4
    abcd          100     10     200     300
    zaqws          10     230     90     60
    qwer          400     250     300     100
    Total          510     580     590     460
    This Four Values in total
    Quat1_Total = 510
    Quat2_Total = 580
    Quat2_Total = 590
    Quat2_Total = 460
    These four amounts has to be transfered to worksheet 2..
    the output of the worksheet 2.. depends on these 4
    values.
    1. How should i captures these four values and pass it
    to worksheet 2?
    2. Should I have to use function? if so how?
    I need sample code for it.. since i am new to this field.
    3. Depending up on the result on worksheet 1 , worksheet2
    has to provide results like.. comparing with last
    quaters...etc..
    Thanks in Advance
    -Seetha

  • How to get the data from multiple tabes into single table

    hi all,
    here i am having 10 data base tables,how to get the data into a single table.
    regards,
    subba reddy

    hi,
    non XI/PI related
    Regards,
    Michal Krawczyk

  • How to populate data in the same table based on different links/buttons

    Hi
    I'm using jdeveloper 11.1.4. I have a use case in which i need to populate data in the same table based on click of different links.
    Can anyone please suggest how can this be achieved.
    Thanks

    I have a use case in which i need to populate data in the same table based on click of different linksDo you mean that you need to edit existing rows ?
    What format do you have the date in - table / form ?

Maybe you are looking for

  • Exception Error 1

    Every time I try to start I tunes I get an exception error and it has to close. Cannot use Itunes at all. Any ideas?

  • Can't get rid of "My Computer Box on desktop

    My husband's white two-year old Macbook has a problem which is driving us crazy. On start-up a box which says "Ken's computer" appears in the middle of the screen, blocking files and everything else. In the box is the hard drive icon and the Firefox

  • Email of SAPSCRIPT Print Output

    Hi, Can anyone please tell me steps to send an External Email from SAPSCRIPT. let me elaborate more on this.I have a "Z" print program for printing RFQ's.Now we need to send this output thru Email as well to vendors. Thanks in advance,

  • Contribute/DW

    Hello, Does Anyone Here Work With Large Websites and Contribute and Dreamweave I made a website using DreamWeaver and My client adds/changes content using Contribute.. The site has gotten very large over the past three or four years. It is actually a

  • Facelets example numberguess with Tomcat 6 and Eclipse WTP

    Hello I�m new with facelets (1.1.3) so I wanted to start the example that was in the download directory "numberguess". I imported the *.war-file in Eclipse. I have both, Tomcat 5.5 and Tomcat 6 but the error message is the same: INFO: validateJarFile