Finding missed sequence numbers and rows from a fact table

Finding missed sequence numbers and rows from a fact table
Hi
I am working on an OLAP date cube with the following schema:
As you can see there is a fact transaction with two dimensions called cardNumber and Sequence. Card dimension contains about three million card numbers. 
Sequence dimension contains a sequence number from 0 to 255. Fact transaction contains about 400 million transactions of those cards.
Each transaction has a sequence number in 0 to 255 ranges. If sequence number of transactions of a card reaches to 255 the next transaction would get 0 as a sequence number.
For example if a card has 1000 transactions then sequence numbers are as follows;
Transaction 1 to transaction 256 with sequences from 0 to 255
Transaction 257 to transaction 512 with sequences from 0 to 255
Transaction 513 to transaction 768 with sequences from 0 to 255
Transaction 769 to transaction 1000 with sequences from 0 to 231
The problem is that:
Sometimes there are several missed transactions. For example instead of sequence from 0 to 255, sequences are from 0 to 150 and then from 160 to 255. Here 10 transactions have been missed.
How can I find all missed transactions of all cards with a MDX QUERY?
I really appreciate for helps

Thank you Liao
I need to find missed numbers, In this scenario I want the query to tell the missed numbers are: 151,152,153,154,155,156,157,158,159
Relative transactions are also missed, so I think it is impossible to get them by your MDX query
Suppose this:
date
time
sequence
20140701
23:22:00
149
20140701
23:44:00
150
20140702
8:30:00
160
20140702
9:30:00
161
20140702
11:30:00
162
20140702
11:45:00
163
As you can see the sequence number of the last transaction at the 20140701 is 150
We expecting that the first transaction of the next day should be 151 but it is 160. Those 10 transactions are totally missed and we just need to
find missed sequence numbers

Similar Messages

  • To find missing sequence numbers in a table

    Hi ,
    I populate the primary key column of a table using sequence which starts with 1 and increments by 1. I need to find the sequence numbers which have been skipped while inserting.

    Hi,
    Please refere the similar thread.
    Re: Identifying the missing record in a series
    Regards

  • Hi I have a Iphone4 in using. I couldn't find Safary, E-mail and notes from my phone one day. I made this mistake when I want to delete some programe from my phone. Who can help I recovery my phone please.

    Hi
    I have a Iphone4 in using. I couldn't find Safary, E-mail and notes from my phone one day. I made this mistake when I want to delete some programe from my phone. Who can help I recovery my phone please.
    Thanks

    Hello, HenryWang2103.
    Thank you for visiting Apple Support Communities.
    The Safari, Email and Notes applications are native to the iOS and is unable to be deleted.  Since this is the case, they are either in a folder on the iPhone, on another page or Restrictions are enabled.  You can also search for these Apps on the iPhone by touching the screen and sliding your finger down.  Here is some information regarding these features.  The information about folders is located in the user guide below.
    iPhone User Guide
    iOS: Understanding Restrictions (Parental Controls)
    http://support.apple.com/kb/HT4213
    Cheers,
    Jason H.

  • Missing all menus and buttons from Folio Builder

    I had a problem with Folio Builder panel when change ID password. I re instal both plugin again( FP and FProdTool), but this did not help. After reading the forum about solving the problem >
    1) Quit InDesign and any other CS apps
    2) Use the Activity Monitor to quit the CS5ServiceManager or CS5.5Service Manager
    3) Next delete this file based on version:
    /Users/lnegi/Library/Application Support/Adobe/CS5ServiceManager/preference/csxs2.pref
    /Users/lnegi/Library/Application Support/Adobe/CS5.5ServiceManager/preference/csxs2.pref
    4) Then remove this item from the Keychain Access based on version:
    Adobe-CS-5-renga
    Adobe-CS-5.5-renga
    To remove from the keychain:
    Navigate to /Applications/Utilities and launch the Keychain Access.app
    If the lock icon in the upper left appears locked, click on it and enter your password to unlock it.
    Select the “login” item in the Keychains list in the top left.
    Select “Passwords” from the category list.
    Type “renga” in the search field in the top right.
    Select any matches and press the delete key.
    >>>>I followed the advice. But after that , Folio Builder panel has stopped working, missing all menus and buttons from FBpanel. Please help solve the problem!!!

    i'm disappoint ...after the second day, I can not work with my DPS.. afte trying this:
    1. Uninstall Folio Builder Panel and Folio producer Tools ( Seems you might have already followed this step). Use Spotlight to serach for Uninstall Folio builder Panel and Uninstall Folio producer Tools and then uninstall repectively.
    2. Uninstall Adobe Air.
    3. Restart your Machine.
    4. Reinstall Adobe Air from get.adobe.com/air
    5. Reinstall Folio Builder Panel and Folio Producer Tools.
    >>> Folio Builder panel again does not appear!!! The Panel yesterday behaved strangely, one moment disappeared, then appeared( but with а blank window)....what am i doing wrong!? ...When I first time instal DPS, it also had problem after a older versions of DPS, but the problem eventually decided. Now I instal the last versions plugins HEEEEELPPPP!!!!

  • Does LabView program behave differentl​y under Traditiona​l Chinese version from regular English version. The program reads in numbers and characters from input files.

    Does LabView program behave differently under Traditional Chinese version from regular English version. The program reads in numbers and characters from input files.

    Hope this helps,
    Ankita

  • I have purchased pages numbers and keynote from itunes and want to know how to transfer the files from my laptop to my ipad

    i have purchased pages, numbers and keynote from itunes and want to transfer files from my laptop on to my ipad and can't work it out.
    pdf's is easy you just drop and drag.

    File Sharing.
    http://i1224.photobucket.com/albums/ee374/Diavonex/Album%208/7a32eea61b42c623ad5 e4e29900a3d47.jpg

  • How do i transfer pages, numbers and keynote from 10.6 to 10.7

    How do I transfer Pages, Numbers and Keynote from 10.6 to 10.7?

    I partitioned my hard disk into a Snow Leopard volume and a Lion volume.  I could not transfer Pages, Numbers or keynote from the Snow Leopard hard drive into the Lion hard drive.

  • Randomly selecting some rows from the database table

    Hi can some one help me in selecting some rows from a database table which has around 90,000 rows.
    Thanks.

    One thing you might try is the "sample" clause if you have 8i which is supposed to return a random percentage of the table. Say for example, you have a sequence number on your table as the pkey. Then you might try:
    select * from <table_name> where pkey in(select pkey from <table_name> sample(10));
    This should give you a random 10 percent of the rows in the table but I tried this once and the results seemed unpredictable. For example it returned a different number of rows each time even though the number of rows in the table didn't change.
    Hope this works for you.

  • How to freeze column and row headers of a table

    How to freeze column and row headers of a table in jsp and javascript. An example is available in
    http://www.massless.org/_tests/grid1/ pls help to find a solutionj
    Thanks in anticipation
    Sreejesh

    At least I don't stop you from that. I also don't see any benefits in this topic.
    Success.

  • Extract Multiple Rows from a Single Table into a Single Row in a New Table

    I have a table in a database that contains contact data like name, address, phone number, etc.
    The folks who designed the database and wrote the application wrote it so that all contact records are placed in that table, regardless of contact type. In fact, the contacts table does not even have a column for "type" even though there are many
    different types of contacts present in that table.
    I am trying to write a mail merge style report in SRSS, that gets sent to a specific type of contact, based on criteria provided that must be obtained from another table, and that data is then used to get back to a specific set of contacts from the contacts
    table.
    The attached file directly below describes my problem and all related information in an extremely detailed way.
    SRSSMailMergeIssue.pdf
    Unless there is a way to make a SRSS Tablix point to two different data sets in SRSS, it looks like I have to combine multiple rows from the same table into a new table.
    If anyone can review the details in the attached pdf file and possibly point me in the direction I need to run to solve this probelm, I would greatly appreciate it.
    I also included a document (below) that shows the tables I reference in the probelm description.
    dbtables.pdf

    I found a solution.... and posted it below
    select
    dk.ucm_docketnumber [UCM DocketNumber],
    dk.ucm_docketid [UCM DocketID],
    vc.FirstName [Victim FirstName],
    vc.MiddleName [Victim MiddleName],
    vc.LastName [Victim LastName],
    vc.Suffix [Victim Suffix],
    vc.Address1_Line1 [Victim AddressLine1],
    vc.Address1_Line2 [Victim AddressLine2],
    vc.Address1_Line3 [Victim AddressLine3],
    vc.Address1_City [Victim City],
    vc.Address1_StateOrProvince [Victim StateProvince],
    vc.Address1_PostalCode [Victim Postalcode],
    oc.FirstName [Offender FirstName],
    oc.MiddleName [Offender MiddleName],
    oc.LastName [Offender LastName],
    oc.Suffix [Offender Suffix],
    oc.Address1_Line1 [Offender AddressLine1],
    oc.Address1_Line2 [Offender AddressLine2],
    oc.Address1_Line3 [Offender AddressLine3],
    oc.Address1_City [Offender City],
    oc.Address1_StateOrProvince [Offender StateProvince],
    oc.Address1_PostalCode [Offender Postalcode],
    pc.FirstName [Arresting Officer FirstName],
    pc.MiddleName [Arresting Officer MiddleName],
    pc.LastName [Arresting Officer LastName],
    pc.Address1_Line1 [Arresting Officer AddressLine1],
    pc.Address1_Line2 [Arresting Officer AddressLine2],
    pc.Address1_Line3 [Arresting Officer AddressLine3],
    pc.Address1_City [Arresting Officer City],
    pc.Address1_StateOrProvince [Arresting Officer StateProvince],
    pc.Address1_PostalCode [Arresting Officer Postalcode]
    FROM ucm_docket dk
    left outer join ucm_victim v on dk.ucm_docketid = v.ucm_docketnumber
    left outer join contact vc on vc.contactid = v.ucm_victimlookup
    left outer join ucm_offender o on o.ucm_offenderid = dk.ucm_offenderlookup
    left outer join contact oc on oc.contactid = o.ucm_individualid
    left outer join contact pc on pc.contactid = dk.ucm_ArrestingOfficerLookup
    WHERE (dk.ucm_docketnumber = @DocketNUM)

  • Deleting a row from a UIData table

    I am trying to select a row from a jsf table then call a backing bean method to delete it using this backing bean method.
    void deleterow(){
    dataitem =(item) dataTable.getrowdata();
    List newlist = new ArrayList();
    table = model.getwrappeddata();
    for (int i=0; i<table.size(); i++){
        product = (product)table.get(i);
       if (!product.name.equals(dataitem.name)){
          newlist.add(product);
    model.setwrappeddata(newlist);
    }all the getter/setter methods are set and it does seem to work.However the results are very inconsistent,sometimes rows are deleted and then magically reappear on the the table latter! Anyone knows of a fail proof method of achieving this?
    Ta.

    A decent IDE ships with a code debugger which allows you tracking variables and running code step by step. If you don't use an IDE or you're unable to use it, then just add some sysouts which prints the desired variables at strategic locations and/or moments.

  • Deleting a row from the item table

    Hi All,
    I have a requirement where I need to put a button to delete the selected row from the item table and for this I have written the following code:
    DATA lo_nd_t_bseg TYPE REF TO if_wd_context_node.
        DATA lo_el_t_bseg TYPE REF TO if_wd_context_element.
        DATA ls_t_bseg TYPE wd_this->element_t_bseg.
        data: it_tab type table of wd_this->element_t_bseg.
      lo_nd_t_bseg = wd_context->path_get_node( path = `Z.T_BSEG` ).
      lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
      lo_el_t_bseg->get_static_attributes(
        IMPORTING
          static_attributes = ls_t_bseg ).
        lo_nd_t_bseg = wd_context->path_get_node( path = `Z.T_BSEG` ).
        lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
        IF lo_el_t_bseg IS not INITIAL.
          lo_nd_t_bseg->remove_element( lo_el_t_bseg ).
        ENDIF.
    Now the problem is although it's deleteing the selected line correctly but because of this I am losing one line on the screen for the user to enter... my form has a fixed number of lines and in my case it's 10... so everytime I am using deleting a line item I am losing one line to enter..... can you please tell me how can I avoid this?
    Edited by: rajatg on Aug 4, 2011 3:12 PM

    lets say...
    i have 1,2,3 documents
    i have cleared , document 2....
    1. when the user selects this record.... you can read the context_element....using the context element you can get the values and clear those values and set the blank values...
    when the user click on save ...you can have only those two records in the table.
    2. conitnue with your logic .... remove_element. once it is done ,,, create_element at the deleted index...
    3. when clicked on delete ...remove_element ( current code).... bind the table to the node... and you will have ur values

  • SUM two fileds from different rows from the same table

    I would like to SUM two fileds from different rows from the same table but I don't know how to do that.
    E.g.
    BillingTransactionsIndex      CreateDate      UserType      UserIndex      TransType      Reference      Total      Balance
    2      6/5/2008 15:02      1      51      1      150      -288.2      -288.2
    5      6/8/2008 11:55      1      51      1      157      -1.58674      -289.787
    In the table above I want SUM fields Total and Balance for the first row and the the next row SUM 2nd row Total with 1st row Balance
    Please help
    Thanks

    SQL> with tbl as
      2  (select 1 as ID,  90 as total from dual
      3          union all
      4  select 2 as ID,  23 as total  from dual
      5          union all
      6  select 3 as ID,  15 as total  from dual
      7          union all
      8  select 4 as ID,  20 as total  from dual)
      9  select id , total, sum(total) over (order by ID) as balance from tbl
    10  /
            ID      TOTAL    BALANCE
             1         90         90
             2         23        113
             3         15        128
             4         20        148
    SQL>

  • Resukt:Get number of rows from 3 different table...?

    Hi All,
    I need to find out number of rows from 3 different table for the same conditions. Instead of writing 3 queries, is it possible to get it thru one query?
    For example, i need to find out number of rows in tables where name = 'Ameet' from 3 different table, i will end writing 3 queries.
    1. select count(1) from table_a where name = 'Ameet';
    1. select count(1) from table_b where name = 'Ameet';
    1. select count(1) from table_c where name = 'Ameet';
    Is it possible to write a single query to get result of all above 3 queries?
    result:
    table_a table_b table_c
    34 44 2

    One way:
    SELECT      (SELECT     COUNT(*) AS CNT FROM TABLE_A WHERE name='Ameet') AS TABLE_A
    ,     (SELECT     COUNT(*) AS CNT FROM TABLE_B WHERE name='Ameet') AS TABLE_B
    ,     (SELECT     COUNT(*) AS CNT FROM TABLE_C WHERE name='Ameet') AS TABLE_C
    FROM DUALIf you want the total:
    SELECT     SUM(CNT)
    FROM
         SELECT     COUNT(*) AS CNT FROM TABLE_A WHERE name='Ameet'
         UNION ALL
         SELECT     COUNT(*) FROM TABLE_B WHERE name='Ameet'
         UNION ALL
         SELECT     COUNT(*) FROM TABLE_C WHERE name='Ameet'
    )

  • Abap logic not fetching multiple rows from master data table

    Hi
    I just noticed that my logic is fetching only 1 row from master data table.
    ProdHier table
    PRODHIERACHY            Level
    1000                                  1
    1000011000                      2
    10000110003333              3
    10000110004444              3
    '10000110005555              3*
    logic only fetches one row of level 3, I would like to fetch all level 3 rows.
    DATA: ITAB type table of /BI0/PPROD_HIER,
          wa like line of ITAB.
    Select * from /BI0/PPROD_HIER INTO wa where /BIC/ZPRODHTAS = 3.
    IF wa-PROD_HIER(10) = SOURCE_FIELDS-PRODH2.
         RESULT = wa-PROD_HIER.
         ELSEIF wa-PROD_HIER(5) = SOURCE_FIELDS-PRODH1.
         RESULT = wa-PROD_HIER.
    ENDIF.
    ENDSELECT.
    thanks

    Hi,,
    I have implemented the logic in end routine and it still reads only the first row.
    I am loading only PRODH1 and PROD2 but now I want to get all values of PRODH3 from the master data table.
    The first 5 values are PRODH1 and first 10 values belongs to PRODH2.
    Whenever PRODH2 = 1000011000 in source I should get the following values
    10000110001110
    10000110001120
    10000110001130
    I have multiple rows of 1000011000 so my result should be
      1000011000               10000110001110
      1000011000               10000110001120
      1000011000               10000110001130
    DATA: ITAB type table of /BI0/PPROD_HIER,
    wa like line of ITAB.
    data rp type _ty_s_TG_1.
    Select  * from /BI0/PPROD_HIER INTO table itab where /BIC/ZPRODHTAS = 3.
    LOOP AT RESULT_PACKAGE INTO rp.
    read table itab into wa with key PROD_HIER(5) = rp-PRODH1.
    IF sy-subrc EQ 0.
         rp-PRODH3 = wa-PROD_HIER.
         ELSE.
    read table itab into wa with key PROD_HIER(10) = rp-PRODH2.
    IF sy-subrc EQ 0.
         rp-PRODH3 = wa-PROD_HIER.
    ENDIF.
    ENDIF.
    MODIFY RESULT_PACKAGE FROM rp.
    ENDLOOP.
    Edited by: Bhat Vaidya on Sep 10, 2010 11:27 AM
    Edited by: Bhat Vaidya on Sep 10, 2010 11:37 AM

Maybe you are looking for