How the last report line by order?

Here is a sample report of 3 commands, each with different actions on different dates. What I want to show are only recent actions for each order (marked in red). I tried to use max (sequence number) and max (date of the Action), but they have no effect since this will only work when all columns (except the sequence or the date of the Action number) for each line are the same.

http://I84.Photobucket.com/albums/K24/The_Dutchman_2006/OBIEE/Nieuweafbeelding11.jpg

Any ideas?

BTW: It's on OBIEE v10

Thank you!

Published by: The_Dutchman on June 17, 2011 11:26

Hi Dutch,

create three more columns with the following formulas:

RCOMPTE (order number sequence number)
COUNT (order number sequence number)
CASE WHEN RCOMPTE (order number sequence number) = COUNT (order number sequence number) THEN 'Y' ELSE ' don't END

Filter on all lines with 'Y '.

Kind regards
Stijn

Edit: You may need to create another application on top of this request and put the filter on this request.

Published by: Stijn Gabriels on June 17, 2011 11:44

Tags: Business Intelligence

Similar Questions

  • How to get an average displacement of the last 5 lines that were NOT NULL?

    I have a question involving a moving average, and it works fine using:

    AVG (col_x) more (partition col_a, col_b, col_c lines between 5 preceding and 1 preceding arrested)

    However, I want to change this option to give the average of the last 5 lines which were non-null.  Does anyone know how to do?

    For example:

    create table sample_table)

    col_a varchar2 (10),

    date of col_b,

    col_c number (2),

    col_x number (5.2)

    );

    insert into sample_table values ('X', trunc (sysdate), 1, 1);

    insert into sample_table values ('X', trunc (sysdate), 2, 2);

    insert into sample_table values ('X', trunc (sysdate), 3, 3);

    insert into sample_table values ('X', trunc (sysdate), 4, 4);

    insert into sample_table values ('X', trunc (sysdate), 5, 5);

    insert into sample_table values ('X', trunc (sysdate), 6, 6);

    insert into sample_table values ('X', trunc (sysdate), 7, 7);

    insert into sample_table values ('X', trunc (sysdate), 8, null);

    insert into sample_table values ('X', trunc (sysdate), 9, null);

    insert into sample_table values ('X', trunc (sysdate), 10, null);

    insert into sample_table values ('X', trunc (sysdate), 11, null);

    insert into sample_table values ('X', trunc (sysdate), 12, null);

    insert into sample_table values ('X', trunc (sysdate), 13, null);

    insert into sample_table values ('X', trunc (sysdate), 14, null);

    insert into sample_table values ('X', trunc (sysdate), 15, null);

    Select t.*,

    AVG (col_x) on myavg (partition col_a, col_b, col_c lines between 5 preceding and 1 preceding arrested)

    of sample_table t

    order by 1,2,3;

    COL_A, COL_B, COL_C MYAVG COL_X

    ---------- ----------- ----- ------- ----------

    X 15/01/2015 1 1.00

    X 15/01/2015 2 2.00 1

    X 15/01/2015 3 3.00 1.5

    X 15/01/2015 4 4,00 2

    X 15/01/2015 5 5.00 2.5

    X 15/01/2015 6 6.00 3

    X 15/01/2015 7 7.00 4

    X 15/01/2015 8 5

    X 15/01/2015 9 5.5

    15/01/2015 X 10 6

    X 15/01/2015 11 6.5

    X 15/01/2015 12 7

    15/01/2015 X 13

    15/01/2015 X 14

    X 15/01/2015 15

    15 selected lines

    What I really want is:

    COL_A, COL_B, COL_C MYAVG COL_X

    ---------- ----------- ----- ------- ----------

    X 15/01/2015 1 1.00

    X 15/01/2015 2 2.00 1

    X 15/01/2015 3 3.00 1.5

    X 15/01/2015 4 4,00 2

    X 15/01/2015 5 5.00 2.5

    X 15/01/2015 6 6.00 3

    X 15/01/2015 7 7.00 4

    X 15/01/2015 8 4

    X 15/01/2015 9 4

    X 15/01/2015 10 4

    X 15/01/2015 11 4

    X 15/01/2015 12 4

    X 15/01/2015 13 4

    X 15/01/2015 14 4

    X 15/01/2015 15 4

    15 selected lines


    concerning

    Neil

    Hello

    Here's one way:

    WITH got_avg AS

    (

    SELECT T.*

    AVG (col_x) OVER (PARTITION BY col_a, NVL2 (col_x, 1, 0)

    ORDER BY col_b, col_c

    LINES BETWEEN 5 PRECEDING

    AND 1 PRECEDING

    ) AS myavg

    OF sample_table t

    )

    SELECT col_a, col_b, col_c, col_x

    LAST_VALUE (myavg IGNORE NULLS) over (PARTITION BY col_a

    ORDER BY col_b, col_c

    ) AS myavg

    OF got_avg

    ORDER BY col_a, col_b, col_c

    ;

    Too bad, that we cannot use the IGNORE NULLS with AVG function.

  • The speed of the processor 1 group 0 is restricted by the system firmware. The processor has been in this state of reduced performance for 4 seconds since the last report.

    The speed of the processor 1 group 0 is restricted by the system firmware. The processor has been in this state of reduced performance for 4 seconds since the last report.

    Event ID: 37
    Source: Kernel-processor-Power
    Task category: 7

    -What it means and how to fix this?

    : S

    Make sure that the system has sufficient cooling, and that you have upgraded the BIOS most recent.

  • Display the last few lines added

    Hello

    Could someone help me how to prepare a select statement which show the last 10 added lines? I have the column with DATE format.

    Best.

    Hi Best

    SQL > drop table t;

    Deleted table.

    SQL > create table t (t1 date);

    Table created.

    SQL > insert into values (sysdate) t;

    1 line of creation.

    SQL > insert into t values (sysdate + 1);

    1 line of creation.

    SQL > insert into t values (sysdate + 2);

    1 line of creation.

    SQL > insert into t values (sysdate + 3);

    1 line of creation.

    SQL > insert into t values (sysdate + 4);

    1 line of creation.

    SQL > insert into t values (sysdate + 5);

    1 line of creation.

    SQL > insert into t values (sysdate + 7);

    1 line of creation.

    SQL > insert into t values (sysdate + 6);

    1 line of creation.

    SQL > insert into t values (sysdate + 8);

    1 line of creation.

    SQL > insert into t values (sysdate + 9);

    1 line of creation.

    SQL > insert into t values (sysdate + 10);

    1 line of creation.

    SQL > insert into t values (sysdate + 11);

    1 line of creation.

    SQL > insert into t values (sysdate + 12);

    1 line of creation.

    SQL > commit;

    SQL > select * from (select * from (select rownum, t1 from t by t1 desc) where rownum)<=10) order="" by="" t1="">

    ROWNUM T1
    ------ ---------
    6 24 AUGUST 09
    8 25 AUGUST 09
    7 AUGUST 26 09
    9 27 AUGUST 09
    10 28 AUGUST 09
    11 AUGUST 29, 09
    12 30 AUGUST 09
    13 31 AUGUST 09
    14-01 - SEP - 09
    15-02 - SEP - 09

    Please use above written request...

    A P R I T S I N H A

  • inventory including the last report date of extinction

    Hello

    I'm new to power cli (about a week to try) and am trying to run a powercli script that will give me a list of off the virtual computer with specific information, including the date, it has been turned off. My script looks like this:

    @"
    ===============================================================================
    Title: vminventory.ps1
    Description: Export VM Information for vCenter in one. CSV file for import into what anyone
    Use:.\vminventory.ps1
    Date: 15/10/2012
    ===============================================================================
    "@
    # Get virtual center to connect to:
    $VCServerName = Read-Host "What is the name of Virtual Center?"
    $ExportFilePath = Read-Host "where you want to export the data?
    $VC = to connect-VIServer $VCServerName
    $Report = @)
    #$VMs = get-file $VMFolder | Get - VM
    $VMs = get - vm | WHERE-object {$_.powerstate - eq "poweredoff"}
    $Datastores = get-Datastore. Select Name, Id
    $VMHosts = get-VMHost | Select Name, Parent
    # Get turned off from the time of the event:
    {ForEach ($VM to $VMs)
    Get-VIEvent-body $VM - MaxSamples ([int]: MaxValue) | where {$_-is [VMware.Vim.VmPoweredOffEvent]} |
    Group-object - property {$_.} Vm.Name} | %{
    $lastPO = $_. Group | Tri-objet-property Createduserid-descending | Select - 1 first | Select Createduserid - ExpandProperty
    New-object PSObject-property @ {}
    VM = $_. Group [0]. Vm.Name
    "The last Poweroff" = $lastPO
    }
    }
    $VMView = $VM | Get-View
    $VMInfo = {} | Select VMName Powerstate, OS, IPAddress, ToolsStatus, host, Cluster, data store, NumCPU, MemMb, DiskGb, SSGOwner, BUSowner, PowerOFF, Note
    $VMInfo.VMName = $vm.name
    $VMInfo.Powerstate = $vm. PowerState
    $VMInfo.OS = $vm. Guest.OSFullName
    $VMInfo.IPAddress = $vm. Guest.IPAddress [0]
    $VMInfo.ToolsStatus = $VMView.Guest.ToolsStatus
    $VMInfo.Host = $vm.host.name
    $VMInfo.Cluster = $vm.host.Parent.Name
    $VMInfo.Datastore = ($Datastores | where {$_.}) ID-match (($vmview.)) Data store | Select - first 1) | Select the value). Value} | Select name). Name
    $VMInfo.NumCPU = $vm. NumCPU
    $VMInfo.MemMb = [math]: round (($vm.)) (MemoryMB), 2)
    $VMInfo.DiskGb = [math]: Round ((($vm.)) Hard drives | Measure-Object-CapacityKB property-sum). Summary * 1 k / 1 GB), 2)
    $VMInfo.PowerOFF = $lastPO
    $VMInfo.SSGOwner = ($vm |) Get-Annotation - CustomAttribute "SSG system owner"). Value
    $VMInfo.BUSowner = ($vm |) Get-Annotation - CustomAttribute "Business system owner"). Value
    $VMInfo.Note = $vm. Notes
    $Report += $VMInfo
    }
    $Report = $Report | Sort-Object VMName
    IF ($Report - don't ' ') {}
    $report | Export-Csv $ExportFilePath - NoTypeInformation
    }
    $VC = disconnect VIServer $VCServerName - confirm: $False

    I can't get to browse and read the power of the events in the log of the events on the virtual machine?  Someone at - it ideas?

    No, my mistake. Which should have been $lastPO.VM.VM.

    I've corrected the above code

    Update: just noticed another typo, it's fixed

  • Excluded, the last miniature line

    What is the workaround to see the last row of tiles to Pro 9.0?  I played with various window dressings, but I can't activate the scroll to show me the last pages of miniatures any zoom that I use.

    Extremely aggrivating.  Any help?  A fix available somewhere? Currently using 9.3.2,and updated yesterday. Works on Win 7 x 64.

    You can add a few empty pages to your document.

  • To understand how the situation report of the printer hp officejet 6000

    Product number CV051, Vista 32-bit.  Earlier today, a telephone support had run me uninstall3 and then reinstall (my printer print an alignment page after each print job).  The initial problem was solved, but now says my printer HP solutions Center is disconnected.  I can and have printed documents.  The printer is connected of course.  So I ran a Printer Status Report.  This report argues that the network status is offline, and Active connection type is none.  Is that what it means that the printer is not connected?  If so, how can I solve this problem?  (Although it is a newly installed printer this printer was purchased for more than a year and is no longer under warranty.  I used my support call a phone to solve the problem of alignment page).  Please note: I am really a Novice!

    susana1027

    Hey Susana,

    You are assuming that this network status 'offline' means that the printer is not connected to the network. Have you set up this printer on the wireless network again? Also how this printer currently connected to the printer (wired or wireless)? IM waiting for run the HP Print & Scan Doctor to see if he is able to solve your problem. If it does not solve the problem, post back with new details and will continue from there.

    Thank you!

    Sean

  • "the last in line" bubble on contact name no longer works

    Until the most recent update of Skype, if you hovered over a name in your contact list, alt-text would be displayed showing when this contact had been amended online. This feature now seems, were abducted.

    Anyone experienced or knows the reason why this useful feature was pulled?

    Open a conversation with any contact you want to check

    then scroll to the contact in the list on the left

    Wait a moment, and he will show you his last time online

  • The speed of the CPU 0 in group 0 is restricted by the system firmware. The processor is in this state of reduced performance for 71 seconds since the last report.

    Kernel-processor-power of the source; Event ID 37

    What is this deposit is and how to fix it?

    It's a really unpleasant to receive sorta message.   ;-(

    This thread shed light on your situation?

    http://social.answers.Microsoft.com/forums/en-us/w7install/thread/0326f8e8-4146-4961-8bf6-bab6a2661155 All the answers and suggestions are provided by an enthusiastic amateur and are therefore no explicit or implicit guarantee. Basically, you use my suggestions at your own risk.

  • The speed of the CPU 0 in group 0 is restricted by the system firmware. The processor has been in this state of reduced performance for 4 seconds since the last report.

    Log of the event viewer shows in administrative events just before my laptop computer stops while playing games. It is due to overheating because it is right, it started happening 2 weeks ago.

    Overheating is the likely cause.

    Use a can of compressed gas to clean ventilation openings. If the laptop can be opened easily, clean it inside as well. Make sure that the ventilation openings are not blocked when you use it.

  • How to scrolledPane/text box to display the last lines?

    I have a JTextArea in a get.

    I add to the text box and scrolls information off the visible portion of the screen.
    How can I force the scrollbar to always display the last few lines at the bottom of the screen when they are added?

    Thank you.

    See [url http://www.camick.com/java/blog.html?name=text-area-scrolling] text scroll area

  • How to remove duplicate Oracle lines and retain the last rows in double

    Hello

    I have millions of records in the table. Some values / duplicate rows are inserted into it.
    I want to just delete the duplicate lines but I also want to keep the last duplicate line.
    For example if a record is found three times, I want to delete the first and second record and keep
    the third is to say the last inserted a.


    Concerning
    Valérie Singh

    Hello

    PLS, try the commond...!

    1.
    delete from  a where rowid<(select max(rowid) from  b
    where a.ID = b.ID (or perticular column name). 
    
    OR 
    
    2.
    delete from  a where rowid>(select min(rowid) from  b
    where a.ID = b.ID (or perticular column name). 
    
    for example emp table a.empno=b.empno;
    

    * If you are satisfied with this answer make as correct
    * If you're ok withi this answer helpful also

    Concerning
    KPR

  • How to find the last pasted paragraphs FMP?

    I'm sticking FMP several objects at once in a file (a file of changes to the sections containing the changebars) in the main text flow. I want a separator line to go at the end of each pasted section, so I try to insert one after the paste operation. But instead of a line between each section, all lines are added at the end of the file, after all the sections. So if there are 3 glued sections at the end of the file are three lines. My code is below, do you know how I could fix this?

    Thank you, Mark

    function copyPasteChanges (doc, chgRange) {}

    Select the section with changebar and copy it.

    doc. TextSelection = chgRange;

    doc. Copy();

    Prepare for the changes doc and paste there the modified section.

    var firstChgPgf = changesDoc.MainFlowInDoc.FirstTextFrameInFlow.LastPgf;

    var changesTloc = new TextLoc (firstChgPgf, Constants.FV_OBJ_END_OFFSET);

    var changesTRange = new TextRange (changesTloc, changesTloc);

    changesDoc.TextSelection = changesTRange;

    changesDoc.Paste ();

    To go at the end of the file again (I think)

    var lastPgf = changesDoc.MainFlowInDoc.FirstTextFrameInFlow.LastPgf;

    var dividerPgf = changesDoc.NewSeriesPgf (lastPgf);

    var TLoc = new TextLoc (dividerPgf, 0);

    changesDoc.AddText (TLoc, '_');

    }

    Hi Mark,

    The problem is that the dough does not occur when you think. The dividing line is added at the end of the file, but are not your actions of dough. Actually, I think that maybe a little random where pasta is produced, because this line:

    var changesTloc = new TextLoc (firstChgPgf, Constants.FV_OBJ_END_OFFSET);

    .. .is does not create a valid text location. You can check this by abandoning the service after:

    changesDoc.TextSelection = changesTRange;

    .. and look at where's the insertion point. It will probably be everywhere where you left it last, because the call is not valid. I can't tell you exactly why, except that it has something to do with the fact that you are using the last paragraph in the stream. There is something weird to try to define a range of full-paragraph text with the last paragraph. I'm sure it's related to how the last TFP in a stream does not show a mark of FMP, but beyond that, I don't know how to do what you're trying to do with the last paragraph.

    Having no knowledge of how do it right, any time I need to do this, I create a paragraph "dummy" at the end of the flow to fill that space strange 'last FMP", then do the work around it. In the end, I just want to remove fake TFP. I don't know if it's a good idea or not, but it's the only way I ever get it to work and it sorts the mirror how you could do this manually in the GUI.

    With this, I modified your script as follows, and it seems to work better. Note that I also modified the logic of how to find the last paragraph of the flow by writing a separate function. Your call to the 'FirstTextFrameInFlow' is OK, unless your doc begins to span several pages and/or begins with several empty pages. The function I wrote ensures that you really the last TFP in the stream.

    I hope this helps.

    Russ

    function copyPasteChanges (doc, chgRange) {}

    Select the section with changebar and copy it.

    doc. TextSelection = chgRange;

    doc. Copy();

    Prepare for the changes doc and paste there the modified section.

    var lastPgf = getLastPgf (changesDoc);

    var dummyPgf = changesDoc.NewSeriesPgf (lastPgf);

    var changesTloc = new TextLoc (dummyPgf, 0);

    var changesTRange = new TextRange (changesTloc, changesTloc);

    changesDoc.TextSelection = changesTRange;

    changesDoc.Paste ();

    To go at the end of the file again (I think)

    Don't forget that last TFP is now fake TFP

    lastPgf = getLastPgf (changesDoc);

    var dividerPgf = changesDoc.NewSeriesPgf (lastPgf.PrevPgfInFlow);

    var TLoc = new TextLoc (dividerPgf, 0);

    changesDoc.AddText (TLoc, '_');

    dummyPgf.Delete ();

    }

    function getLastPgf (doc)

    {

    textFrame var is doc. MainFlowInDoc.LastTextFrameInFlow;

    var lastPgf = textFrame.LastPgf;

    While (! lastPgf.ObjectValid () & textFrame.ObjectValid ())

    {

    textFrame = textFrame.PrevTextFrameInFlow;

    lastPgf = textFrame.LastPgf;

    }

    Return lastPgf;

    }

  • Display of the audit report

    Hello.
    I work with a bunch of provider (I can't change the data model) that is running some logging activity of audit of the java interface. A report is needed in order to identify who does what to change (old and new) and when.

    The system stores a matrix as of several thresholds that are applied to new accounts, because they are introduced into the system.
    WITH matrix_table AS ( -- no indexes or constraints
    SELECT '20090101' matrix_date, '000' attr_type, 20 percent_1, 40 percent_2, 'A' rate_1, 'D' rate_2,  5 amount_1, 10 amount_2 FROM dual UNION ALL
    SELECT '20090101' matrix_date, '001' attr_type, 40 percent_1, 60 percent_2, 'B' rate_1, 'E' rate_2, 10 amount_1, 15 amount_2 FROM dual UNION ALL
    SELECT '20090101' matrix_date, '002' attr_type, 60 percent_1, 80 percent_2, 'C' rate_1, 'F' rate_2, 15 amount_1, 20 amount_2 FROM dual UNION ALL
    SELECT '20090101' matrix_date, '003' attr_type, 80 percent_1, 99 percent_2, 'D' rate_1, 'G' rate_2, 20 amount_1, 25 amount_2 FROM dual UNION ALL
    SELECT '20100101' matrix_date, '000' attr_type, 21 percent_1, 41 percent_2, 'A' rate_1, 'E' rate_2,  4 amount_1,  9 amount_2 FROM dual UNION ALL
    SELECT '20100101' matrix_date, '001' attr_type, 41 percent_1, 61 percent_2, 'B' rate_1, 'F' rate_2,  9 amount_1, 14 amount_2 FROM dual UNION ALL
    SELECT '20100101' matrix_date, '002' attr_type, 61 percent_1, 81 percent_2, 'C' rate_1, 'G' rate_2, 14 amount_1, 19 amount_2 FROM dual UNION ALL
    SELECT '20100101' matrix_date, '003' attr_type, 81 percent_1, 99 percent_2, 'D' rate_1, 'H' rate_2, 19 amount_1, 24 amount_2 FROM dual UNION ALL
    SELECT '20110101' matrix_date, '000' attr_type, 22 percent_1, 42 percent_2, 'A' rate_1, 'F' rate_2,  3 amount_1,  8 amount_2 FROM dual UNION ALL
    SELECT '20110101' matrix_date, '001' attr_type, 42 percent_1, 62 percent_2, 'B' rate_1, 'G' rate_2,  8 amount_1, 13 amount_2 FROM dual UNION ALL
    SELECT '20110101' matrix_date, '002' attr_type, 62 percent_1, 82 percent_2, 'C' rate_1, 'H' rate_2, 13 amount_1, 18 amount_2 FROM dual UNION ALL
    SELECT '20110101' matrix_date, '003' attr_type, 82 percent_1, 99 percent_2, 'D' rate_1, 'I' rate_2, 18 amount_1, 23 amount_2 FROM dual)
    SELECT * FROM matrix_table;
    When a manual adjustment is made to the matrix already attached to an account, the java application stores a record of who made the change in an audit table
    WITH manual_adjustment AS ( -- no indexes or constraints
    SELECT '1234' account_no, '20100809' change_date, '234512' change_time, 'John Doe' change_user FROM dual UNION ALL
    SELECT '1234' account_no, '20100810' change_date, '001546' change_time, 'John Doe' change_user FROM dual)
    SELECT * FROM manual_adjustment;
    and a record of the new matrix associated with the account in another table audit
    WITH audit_record AS ( -- no indexes or constraints
    SELECT 'Account Matrix' tablename, 'add' change_type, '20100809' change_date, '234508' change_time, 'jdoe' change_user, '1234,000,22,41,A,E,4,9'   change_data FROM dual UNION ALL
    SELECT 'Account Matrix' tablename, 'add' change_type, '20100809' change_date, '234509' change_time, 'jdoe' change_user, '1234,001,41,61,B,F,9,14'  change_data FROM dual UNION ALL
    SELECT 'Account Matrix' tablename, 'add' change_type, '20100809' change_date, '234510' change_time, 'jdoe' change_user, '1234,002,61,81,C,G,14,19' change_data FROM dual UNION ALL
    SELECT 'Account Matrix' tablename, 'add' change_type, '20100809' change_date, '234511' change_time, 'jdoe' change_user, '1234,003,81,99,D,H,19,24' change_data FROM dual UNION ALL
    SELECT 'Account Matrix' tablename, 'add' change_type, '20100809' change_date, '001543' change_time, 'jdoe' change_user, '1234,000,21,41,A,E,4,9'   change_data FROM dual UNION ALL
    SELECT 'Account Matrix' tablename, 'add' change_type, '20100809' change_date, '001544' change_time, 'jdoe' change_user, '1234,001,41,61,B,F,9,14'  change_data FROM dual UNION ALL
    SELECT 'Account Matrix' tablename, 'add' change_type, '20100809' change_date, '001545' change_time, 'jdoe' change_user, '1234,002,61,81,C,G,14,19' change_data FROM dual UNION ALL
    SELECT 'Account Matrix' tablename, 'add' change_type, '20100809' change_date, '001546' change_time, 'jdoe' change_user, '1234,003,81,99,D,H,19,24' change_data FROM dual)
    SELECT * FROM audit_record;
    The example above shows one changed once a John Doe and then changed back. Java process appears to record the date and time the change occurs and the audit_record values do not match exactly the time of the manual_adjustment.

    The audit based on the test data report must provide who changed what and when. When to use the date/time of the response (s) stored in manual_adjustment. What should identify the item changed values prerequisites audit_record or the matrix_table initial if no previous audit_record value exists. So in the example, John Doe has first made a change to the item of data of 1 percent, and since no prior audit were recorded in audit_record, the matrix_table is compared to (I made the order of the data in the columns matrix_table and audit_record.change_data). The old value is retrieved from matrix_table, and the new value is retrieved from audit_record. Then, John Doe has reversed the change to the data item for 1 percent. Since a pre-audit was recorded at audit_record, the most recent (s) audit_record are compared to the previous audit_record (s). The old value is retrieved from the previous audit_record and the new value is retrieved from the most recent audit_record.
    Changed By Changed When      Account Attribute Element   Old Value New Value
    ---------- ----------------- ------- --------- --------- --------- ---------
    John Doe   20100809 23:45:12 1234    000       Percent 1 21        22
    John Doe   20100810 00:15:46 1234    000       Percent 1 22        21
    The audit report must be presented as a database view (all current reports use a database view that is queried by other software for editing).

    I have trouble to determine how to approach the question from the point of view SQL. The analysis of the change_data by commas with REGEXP_SUBSTR is quite simple and I don't have the ability to create functions to determine certain values, but at that time, I also try to tune and feel that I am limit myself to the approach already too. Any suggestions?


    Thank you
    Luke

    Oracle 10 g 2

    Published by: Luke Mackey on Aug 10, 2010 08:35
    Table of audit_record has been fixed.

    Published by: Luke Mackey on August 10, 2010 09:03
    Add a description of how the audit report values are obtained.

    Hi, Luke,.

    Sorry, that it lasted so long.
    It is not enough:

    WITH    manual_adjustment_d     AS
    (
         SELECT    change_user          AS changed_by
         ,       TO_DATE ( change_date || change_time
                           , 'YYYYMMDDHH24:MI:SS'
                     )          AS changed_when
         ,       account_no                AS account
         FROM       manual_adjustment
    )
    ,     change_history          AS
    (
         SELECT     TO_DATE ( change_date || change_time
                           , 'YYYYMMDDHH24:MI:SS'
                     )          AS changed_when
         ,     change_user
         ,             REGEXP_SUBSTR (change_data, '[^,]+', 1, 1)     AS account
         ,             REGEXP_SUBSTR (change_data, '[^,]+', 1, 2)     AS attr_type
         ,      TO_NUMBER (REGEXP_SUBSTR (change_data, '[^,]+', 1, 3))     AS percent_1
         ,      TO_NUMBER (REGEXP_SUBSTR (change_data, '[^,]+', 1, 4))     AS percent_2
         ,             REGEXP_SUBSTR (change_data, '[^,]+', 1, 5)     AS rate_1
         ,             REGEXP_SUBSTR (change_data, '[^,]+', 1, 6)     AS rate_2
         ,      TO_NUMBER (REGEXP_SUBSTR (change_data, '[^,]+', 1, 7))     AS amount_1
         ,      TO_NUMBER (REGEXP_SUBSTR (change_data, '[^,]+', 1, 8))     AS amount_2
         FROM     audit_record
         WHERE     tablename     = 'Account Matrix'
         AND     change_type     = 'add'
              --
        UNION ALL
              --
         SELECT  TO_DATE ( matrix_date
                   , 'YYYYMMDD'
                   )     AS changed_when
         ,     NULL          AS change_user
         ,     NULL          AS account
         ,       attr_type, percent_1, percent_2, rate_1, rate_2, amount_1, amount_2
         FROM     matrix_table
    )
    ,     got_change_num     AS
    (
         SELECT     ch.*
         ,     ROW_NUMBER () OVER ( PARTITION BY  attr_type
                                   ORDER BY          changed_when
                           )         AS change_num
         FROM    change_history        ch
    )
    ,     elements          AS
    (
         SELECT  1 AS element_num, 'Percent 1' AS element_name      FROM dual     UNION ALL
         SELECT  2,               'Percent 2'                      FROM dual     UNION ALL
         SELECT  3,               'Rate 1'                      FROM dual     UNION ALL
         SELECT  4,               'Rate 2'                      FROM dual     UNION ALL
         SELECT  5,               'Account 1'                      FROM dual     UNION ALL
         SELECT  6,               'Account 2'                      FROM dual
    )
    ,     got_diff          AS
    (
         SELECT     ma.*
         ,     ar.attr_type     AS attribute
         ,     el.element_num
         ,     el.element_name
         ,     CASE     el.element_name
                   WHEN  'Percent 1'  THEN  TO_CHAR (pr.percent_1)
                   WHEN  'Percent 2'  THEN  TO_CHAR (pr.percent_2)
                   WHEN  'Rate 1'         THEN      pr.rate_1
                   WHEN  'Rate 2'         THEN      pr.rate_2
                   WHEN  'Account 1'  THEN  TO_CHAR (pr.amount_1)
                   WHEN  'Account 2'  THEN  TO_CHAR (pr.amount_2)
              END                AS old_value
         ,     CASE     el.element_name
                   WHEN  'Percent 1'  THEN  TO_CHAR (ar.percent_1)
                   WHEN  'Percent 2'  THEN  TO_CHAR (ar.percent_2)
                   WHEN  'Rate 1'         THEN      ar.rate_1
                   WHEN  'Rate 2'         THEN      ar.rate_2
                   WHEN  'Account 1'  THEN  TO_CHAR (ar.amount_1)
                   WHEN  'Account 2'  THEN  TO_CHAR (ar.amount_2)
              END             AS new_value
         FROM     manual_adjustment_d     ma
         JOIN     user_table          ut     ON     ma.changed_by     = ut.user_name
         JOIN     got_change_num          ar     ON     ar.changed_when     BETWEEN ma.changed_when - ( 10          -- seconds before
                                                                    / (24 * 60 * 60)
                                                                    )
                                                 AND     ma.changed_when + ( 5          -- seconds after
                                                                    / (24 * 60 * 60)
                                                                    )
                             AND     ar.change_user     = ut.user_code
            JOIN     got_change_num          pr     ON     ar.attr_type     = pr.attr_type
                             AND     ar.change_num     = pr.change_num     + 1
            CROSS JOIN     elements     el
    )
    SELECT       changed_by
    ,       changed_when
    ,       account
    ,       attribute
    ,       element_name     AS element
    ,       old_value
    ,       new_value
    FROM       got_diff
    WHERE       old_value     != new_value
    ORDER BY  changed_when
    ,            element_num
    ;
    

    As always, to understand a query that uses subqueries, run each auxiliary request by himself and watch its result set.
    Manual_adjustment_d of the subquery is just the corresponding columns of manual_adjustment, with the date converted to DATE.
    Subquery change_history is a combination of audit_record and matrix_table, with the converted data in common columns common and converted to DATEs dates.
    Subquery got_change_num is change_history, with a new column, change_num, added, to make it easy to find the last change before a given change.
    Elements of subquery contains a line for each item that you level. You can have a real table like that, in the case of shich you don't need the subquery. This is necessary for the non swivel data between 1 column on 6 rows and 6 columns on 1 line.
    Got_diff of the subquery is where most of the work takes place. He joined manual_adjustment_d in two rows of got_change_num: (1) the line has the same user and "almost the same" time and (2) the previous row for the same attribute. As posted, a row of got_change_num will be condered as "almost at the same time" like a row of mandual_adjustment_d if it is dated not earlier than 10 seconds ealeir and not later than 5 seconds following line in manual_adjustment_d. You can easily change that. Got_diff also of the Nations United-pivot of the data on a separate line for each item.
    As often happens, the main query plays the same role in this query as the final step takes place in the Tour de France: not much changes, and the results of this part are all that matters. In this case, change is all that really unchanged lines are ignored. The only reason why I haven't done this in got_diff was I wanted to use the alias old_value and new_value, rather than repeat the CASE expressions.

    I'm sure that the query can be a bit shortened and consierably more effective.
    Returned could be simplified if you have stored your dates in the DATE columns.
    It would be easier and more effective if you knew that all data checked, including the data of matrix_table, was audit_record. Then we wouldn't need matrix_table in this request at all, and we wouldn't have to reconcile the different ways of you these two tables to store the same data.

  • Mac Mini to crash, trying to understand the panic report

    My Late 2009 Mac Mini Core2Duo 8 GB Ram started to crash and this is the last report of panic.  I don't understand what is the error.

    Anonymous UUID: 89505A63-49A1-1409-1B56-F6C97DB19897

    Sun Apr 10 16:06:38 2016

    Panic report *.

    panic (cpu 0 0xffffff801eef437e appellant): ' thread_invoke: preemption_level 1, possible cause: blocking while holding a spinlock, or within interruption context"@/Library/Caches/com.apple.xbs/Sources/xnu/xnu-3248.40.184/osfmk/kern/s ched_prim.c:2068.

    Backtrace (CPU 0), frame: return address

    0xffffff812896b800: 0xffffff801eedab12

    0xffffff812896b880: 0xffffff801eef437e

    0xffffff812896b910: 0xffffff801eef0def

    0xffffff812896b950: 0xffffff801efc6650

    0xffffff812896b9c0: 0xffffff801f486c3c

    0xffffff812896b9f0: 0xffffff801f486c9f

    0xffffff812896ba10: 0xffffff801f48c420

    0xffffff812896ba30: 0xffffff801f48c45d

    0xffffff812896ba40: 0xffffff7f9fc31557

    0xffffff812896bae0: 0xffffff7f9fd1e0cc

    0xffffff812896bbc0: 0xffffff7f9fbe2e8c

    0xffffff812896bc30: 0xffffff7f9fc294c4

    0xffffff812896bcc0: 0xffffff7f9fc31892

    0xffffff812896bd00: 0xffffff7f9fb54a7c

    0xffffff812896bd80: 0xffffff7f9faeadcc

    0xffffff812896be10: 0xffffff801f4b5958

    0xffffff812896be80: 0xffffff7f9faea65f

    0xffffff812896bee0: 0xffffff7f9faef971

    0xffffff812896bf20: 0xffffff7f9faef6cf

    0xffffff812896bf40: 0xffffff801f4b27c1

    0xffffff812896bf80: 0xffffff801f4b28b6

    0xffffff812896bfb0: 0xffffff801efc8e27

    Extensions of core in backtrace:
    com.apple.iokit.IOUSBHostFamily (1.0.1) [4C8B5BB6-6AE4-313E-B79C-AC07A4E31A2D] @ fffff7f9fab6000-0xffffff7f9fb1efff > 0xf
    dependency: com.apple.driver.AppleUSBHostMergeProperties (1.0.1) [52E62355C]@0xffffff7f9fab2000 9D5F86A1-76EF-3007 - 94 CA-496
    com.apple.iokit.IOUSBFamily (900.4.1) [7B5AC81A-D0B6-3F3D-87C7-AFD78F4686DB] @0xfff fff7f9fb28000-> 0xffffff7f9fbc1fff
    dependency: com.apple.iokit.IOPCIFamily (2.9) [4FE41F9B-2849-322A-BBF8-A94816C003D6] @ 7f9f72c000 0xffffff
    dependency: com.apple.iokit.IOUSBHostFamily (1.0.1) [4C8B5BB6-6AE4-313E-B79C-AC07A4E31A2D] @0 x ffffff7f9fab6000
    com.realtek.driver.RtWlanU (1830.2b9) [341CBE7A-D4DF-3A6D-A06E-92B6EE2F4EA4] @0xfff fff7f9fbd4000-> 0xffffff7f9ff46fff
    dependency: (3.2) com.apple.iokit.IONetworkingFamily [848B398F-4D96-3024-8092-6CD3534D2CCA] @0 xffffff7f9fa7e000
    dependency: ffff7f9fb28000 @0xff com.apple.iokit.IOUSBFamily (900.4.1) [7B5AC81A-D0B6-3F3D-87C7-AFD78F4686DB]

    Corresponding to the current thread BSD process name: kernel_task

    Mac OS version:

    15E65

    Kernel version:

    15.4.0 Darwin kernel version: Fri Feb 26 22:08:05 PST 2016; root:XNU-3248.40.184~3/RELEASE_X86_64

    Kernel UUID: 4E7B4496-0B81-34E9-97AF-F316103B0839

    Slide kernel: 0x000000001ec00000

    Text of core base: 0xffffff801ee00000

    Text __HIB base: 0xffffff801ed00000

    Name of system model: Macmini3, 1 (Mac-F22C86C8)

    Availability of the system in nanoseconds: 13927482804366

    last load kext to 13844240430139: com.apple.driver.AppleXsanScheme 3 (addr 0xffffff7fa1bbb000 size 32768)

    Finally unloaded kext to 13907399057741: com.apple.driver.AppleXsanScheme 3 (addr 0xffffff7fa1bbb000 size 32768)

    kexts responsible:

    com.realtek.driver.RtWlanU 1830.2.b9

    com Apple.filesystems.afpfs 11.0

    com Apple.NKE.asp - tcp 8.0.0

    com.apple.driver.AppleHWSensor 1.9.5d0

    com.apple.driver.ApplePlatformEnabler 2.6.0d0

    com.apple.driver.AGPM 110.21.18

    com Apple.filesystems.autofs 3.0

    com.apple.driver.AppleOSXWatchdog 1

    com.apple.driver.AppleUpstreamUserClient 3.6.1

    com.apple.driver.AppleMCCSControl 1.2.13

    com Apple.Driver.pmtelemetry 1

    com.apple.iokit.IOUserEthernet 1.0.1

    com.apple.iokit.IOBluetoothSerialManager 4.4.4f4

    com.apple.Dont_Steal_Mac_OS_X 7.0.0

    com.apple.driver.AppleHV 1

    com.apple.driver.AppleIntelSlowAdaptiveClocking 4.0.0

    com.apple.driver.AppleLPC 3.1

    com.apple.GeForceTesla 10.0.0

    com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport 4.4.4f4

    com.apple.driver.ACPI_SMC_PlatformPlugin 1.0.0

    com.apple.AppleFSCompression.AppleFSCompressionTypeDataless 1.0.0d1

    com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0

    com.apple.BootCache 38

    com.apple.driver.AppleIRController 327,5

    com.apple.driver.AppleUSBStorageCoexistentDriver 3.7.1

    com.apple.iokit.SCSITaskUserClient 3.7.7

    2.8.5 com.apple.iokit.IOAHCIBlockStorage

    com.apple.driver.AirPortBrcm43224 700.36.24

    com.apple.driver.AppleFWOHCI 5.5.2

    com.apple.driver.AppleAHCIPort 3.1.8

    com Apple.nvenet 2.0.22

    com.apple.driver.usb.AppleUSBOHCIPCI 1.0.1

    com.apple.driver.usb.AppleUSBEHCIPCI 1.0.1

    com.apple.driver.AppleRTC 2.0

    com.apple.driver.AppleHPET 1.8

    com.apple.driver.AppleACPIButtons 4.0

    com.apple.driver.AppleSMBIOS 2.1

    com.apple.driver.AppleACPIEC 4.0

    com.apple.driver.AppleAPIC 1.7

    com.apple.driver.AppleIntelCPUPowerManagementClient 218.0.0

    com Apple.NKE.applicationfirewall 163

    com Apple.Security.Quarantine 3

    com.apple.security.TMSafetyNet 8

    com.apple.driver.AppleIntelCPUPowerManagement 218.0.0

    com.apple.security.SecureRemotePassword 1.0

    com.apple.AppleGraphicsDeviceControl 3.12.6

    com Apple.kext.Triggers 1.0

    com.apple.driver.AppleSMBusController 1.0.14d1

    com.apple.iokit.IOSurface 108.2.1

    com.apple.iokit.IOSerialFamily 11

    com.apple.driver.CoreCaptureResponder 1

    com.apple.iokit.IOSlowAdaptiveClockingFamily 1.0.0

    com.apple.nvidia.classic.NVDANV50HalTesla 10.0.0

    com.apple.nvidia.classic.NVDAResmanTesla 10.0.0

    com.apple.driver.AppleHDAController 274.7

    com.apple.iokit.IOHDAFamily 274.7

    com.apple.iokit.IOBluetoothHostControllerUSBTransport 4.4.4f4

    com.apple.iokit.IOBluetoothFamily 4.4.4f4

    com.apple.driver.IOPlatformPluginLegacy 1.0.0

    com.apple.driver.IOPlatformPluginFamily 6.0.0d7

    com.apple.driver.AppleSMC 3.1.9

    com.apple.iokit.IOFireWireIP 2.2.6

    com.apple.iokit.IONDRVSupport 2.4.1

    com.apple.iokit.IOGraphicsFamily 2.4.1

    com.apple.driver.usb.IOUSBHostHIDDevice 1.0.1

    com.apple.driver.AppleUSBAudio 303.3.1

    com.apple.iokit.IOAudioFamily 204.3

    com.apple.vecLib.kext 1.2.0

    com.apple.driver.CoreStorage 517.20.1

    com.apple.iokit.IOUSBHIDDriver 900.4.1

    com.apple.iokit.IOSCSIBlockCommandsDevice 3.7.7

    com.apple.iokit.IOUSBMassStorageClass 4.0.2

    com.apple.iokit.IOUSBMassStorageDriver 1.0.0

    com.apple.iokit.IOSCSIMultimediaCommandsDevice 3.7.7

    com.apple.iokit.IOBDStorageFamily 1.8

    com.apple.iokit.IODVDStorageFamily 1.8

    com.apple.iokit.IOCDStorageFamily 1.8

    com.apple.driver.usb.AppleUSBHub 1.0.1

    com Apple.Driver.USB.cdc 5.0.0

    com.Apple.Driver.USB.Networking 5.0.0

    com.apple.driver.usb.AppleUSBHostCompositeDevice 1.0.1

    com.apple.iokit.IOAHCISerialATAPI 2.6.2

    com.apple.iokit.IOSCSIArchitectureModelFamily 3.7.7

    com.apple.iokit.IO80211Family 1110.26

    com Apple.Driver.corecapture 1.0.4

    com.apple.iokit.IOFireWireFamily 4.6.0

    com.apple.iokit.IOAHCIFamily 2.8.1

    com.apple.iokit.IONetworkingFamily 3.2

    com.apple.driver.usb.AppleUSBOHCI 1.0.1

    com.apple.driver.usb.AppleUSBEHCI 1.0.1

    2.2.9 com.apple.driver.NVSMU

    com.apple.iokit.IOUSBFamily 900.4.1

    com.apple.driver.AppleEFINVRAM 2.0

    com.apple.iokit.IOUSBHostFamily 1.0.1

    com.apple.driver.AppleUSBHostMergeProperties 1.0.1

    com.apple.driver.AppleEFIRuntime 2.0

    com.apple.iokit.IOHIDFamily 2.0.0

    com.apple.iokit.IOSMBusFamily 1.1

    com Apple.Security.sandbox 300.0

    com.apple.kext.AppleMatch 1.0.0d1

    com.apple.driver.AppleKeyStore 2

    com.apple.driver.AppleMobileFileIntegrity 1.0.5

    com.apple.driver.AppleCredentialManager 1.0

    com.apple.driver.DiskImages 417.2

    com.apple.iokit.IOStorageFamily 2.1

    com.apple.iokit.IOReportFamily 31

    com.apple.driver.AppleFDEKeyStore 28.30

    com.apple.driver.AppleACPIPlatform 4.0

    com.apple.iokit.IOPCIFamily 2.9

    com.apple.iokit.IOACPIFamily 1.4

    com.apple.kec.Libm 1

    com Apple.KEC.pthread 1

    com Apple.KEC.corecrypto 1.0

    Model: Macmini3, 1, MM31.00AD.B00 of BootROM, 2 processors, Intel Core 2 Duo, 2.26 GHz, 8 GB, MSC 1.35f1

    Graphics card: NVIDIA GeForce 9400, NVIDIA GeForce 9400, PCI, 256 MB

    Memory module: DIMM0/0 BANK, 4 GB DDR3, 1067 MHz, 0x859B, 0x435434473353313036374D2E4D3136464B44

    Memory module: DIMM0/1 BANK, 4 GB DDR3, 1067 MHz, 0x859B, 0x435434473353313036374D2E4D3136464B44

    Airport: spairport_wireless_card_type_airport_extreme (0x14E4, 0 x 90), Broadcom BCM43xx 1.0 (5.10.131.36.16)

    Bluetooth: Version 4.4.4f4 17685, 3 services, 27 aircraft, 1 incoming serial ports

    Service network: Ethernet, Ethernet, en0

    Network service: Wi - Fi, AirPort, en1

    Serial ATA Device: ST500LM021-1KJ152, 500,11 GB

    Serial ATA Device: OPTIARC DVD RW AD - 5670S

    USB device: USB 2.0 Bus

    USB Device: HDD external

    USB Device: 802.11n NIC

    USB device: USB 2.0 Bus

    USB device: USB Bus

    USB device: USB 2.0 hubs

    USB device: USB keyboard

    USB device: Gaming mouse

    USB Device: IR receiver

    USB device: USB Bus

    USB device: C-Media USB Headphone Set

    USB device: Hub BRCM2046

    USB Device: USB Bluetooth host controller

    Crush Bus:

    The panic was apparently caused by the Realtek USB network device or its software. I suggest that you unplug the unit and then remove the software.

    Any third party software that is not installed on the App Store or by drag-and - drop in the Applications folder and uninstall by drag - move to the trash, is a modification of the system.

    Whenever you delete changes to the system, they must be eliminated completely, and the only way to do this is to use the uninstall tool, if any, provided by the developers, or follow their instructions. If the software has been removed incompletely, you may redownload or reinstall even to finish the job.

    I never install modifications of the system myself, and except as stated in this comment, I do not know how to uninstall them. You'll have to do your own research to find this information.

    Here are some general guidelines to help you get started. Suppose you want to remove the so-called "BrickMyMac" (a hypothetical example). First of all, menu using the product, check if there is one, for instructions. Not finding here, look at the Web site, let's say www.brickmymac.com. (Maybe it's not the name real site, if necessary, search the Web for the name of the product). If you don't find anything on the Web site or in your search, contact the developer. While you are waiting for a response, download BrickMyMac.dmg and open it. There may be a request here as "Uninstall BrickMyMac." If this is not the case, open "BrickMyMac.pkg" and look for an uninstall button. The uninstall program can also accessible by clicking on the button customize, when one exists.

    Back up all data before making any changes.

    Generally, you will need to restart the computer in order to perform an uninstall. Until you do this, there may be no effect, or the unpredictable effects.

    If you can't remove the software in any other way, you will have to erase and install OS X. Never install any third party software, unless you're sure you know how to uninstall in the contrary case, it can create problems which are very difficult to solve.

    Try to remove the complex system of changes by hunting for files by name, often will not work and can make the problem worse. The same goes for 'utilities' as the 'AppCleaner"designed to remove software.

Maybe you are looking for

  • Implementation even account itunes on 2 computers

    I have a second mac (macbook air) that I use on my travels and have setup an account for me on this computer. I have install itunes and tried to install one of the apps I bought previously (version first day which is not available on the app store an

  • Battery Apple pencil level check on iOS10

    Please share how to check control pencil Apple on iOS10 battery level

  • BSOD on Satellite A500

    HelloMy laptop Toshiba A500 with Windows 7 detects a problem and blocking down after a short period. Problemsignature:ISSUE name: BlueScreenOperating system to. : 6.1.7600.2.0.0.768.3-ID: 1031 BCCode: 116BCP1: FFFFFA8004619010BCP2: FFFFF88004E55F90BC

  • Channels of naming when writing to PDM

    I am acquiring several data acquisition systems data and write it in a PDM file. My goal is to have names for each channel that will appear as a header for the data in the PDM file, but I also want to allow the user to change the names of channel if

  • New router BEFSR41 problems installing...

    I just installed a new version of my BEFSR41.  I had a version 2 and now have a version 4.3.  I have Road Runner internet and had no problem, just pick up my old router and hang a new.  A restart of the modem and I was able to connect to internet and