Finding missing records.

Hi, I have a table that contains a person contact for a given centre. There may be many types of contact at a centre. However there maybe only say2 mandatory type of contact that must be setup for a centre. If one of these mandatory contacts is not setup then the SQL should list out this centre and the missing mandatory contact type.
For example, imagine there are 10 sales offices. There can be all types of people work there, receptionist, cleaner, CEO, finance manager(FM) etc. However we just want to check each centre if there is a missing CEO or FM.
I managed to write two SQL statements.
1.     This is a Cartesian/equi-join that shows who SHOULD be at each centre eg
select *
from CENTRES c, staff_roles sr
where sr.STAFF_ROLE in ('CEO','FM', )
order by c.centre_no
Centre     Person Role Code
‘001’     CEO
‘001’      FM
‘002’     CEO
‘002’     FM
Etc.
2.     I then managed to write another SQL to show who is ACTUALLY there, eg
select distinct centre_no, staff_role
from centrestaff
where staff_role in ('CEO','FM', )
order by centre_no, staff_role
‘001’     CEO
‘002’     CEO
‘002’     FM
So you can see centre 001 is missing a Finance Manager ‘FM’ and should be shown on the final report.
3.     My last thing was to find a way to link these two SQL together in some type of OUTER join and to do a select on the right side where the centre and role code are NULL values.
select *
from (select *
from CENTRES c, staff_roles sr
where sr.STAFF_ROLE in ('CEO','FM', )
order by c.centre_no)
right OUTER JOIN centrestaff NCS ON c.CENTRE_NO = ncs.CENTRE_NO
and ncs.staff_role in ('CEO','FM', )
order by ncs.centre_no, ncs.staff_role
However I keep getting message ORA-00942: table or view does not exist.
Possible the problem is I am trying to refer to the centre_no in the encapsulating SQL FROM statement. Is there a way round this?
thanks

Hi,
You can do that with a Partitioned Outer Join , like this:
WITH  target_staff_roles     AS
     SELECT     staff_role
     FROM     staff_roles
     WHERE     staff_role     IN ('CEO', 'FM')
SELECT    t.staff_role
,       a.*
FROM           target_staff_roles     t
LEFT OUTER JOIN      (
                       SELECT  c.*
               ,          s.staff_role
               FROM    centres          c
               JOIN    staff_roles     s  ON     c.centre_no     = s.centre_no
                   )               a     PARTITION BY (a.centro_no)
                               ON t.staff_role = a.staff_role
WHERE     a.staff_role     IS NULL
ORDER BY  a.centre_no
,            t.staff_role
;If you'd care to post CREATE TABLE and INSERT statements for your sample data, then I could test it.
The reason you were getting that error was that you referenced c.centro_no in the join condition of the main query, but table c is not used in hte main query. The only "tables" in the main query are ncs and the unnamed in-line view.
Edited by: Frank Kulash on Mar 9, 2012 10:52 AM

Similar Messages

  • How to find out the missing records

    Dear all,
    I feel that there is some Inconsistent records between R/3 and the extracted records BI for the data source 2LIS_03_BF. some of the records may not be updated through delta.. Is this possible? as we have created  Zkey figures to capture the diffrent unit of measure's quantity from the table MSEGO2 and updated to IC_c03 cube.
    Can any one tell me how to go about the missed records..where to find them.. and how to extract them.
    Poits will be assigned
    Regards
    venu

    hi,
    inventory scenario is difficult to handle as this have non cumulative key figures which can be viewed at the repors.
    extreme care is required while compression and intila loads and their compression.
    run the report or ask the user to run the report and sort out the missing records.
    chk out the document and chk if the procedure done by you is correct.
    inventory management
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f83be790-0201-0010-4fb0-98bd7c01e328
    Ramesh

  • How to get missing records from one table

    I have one table with many records in the table. Each time a record is entered the date the record was entered is also saved in the table.
    I need a query that will find all the missing records in the table.
    so if I have in my table:
    ID          Date          Location
    1           4/1/2015        bld1
    2           4/2/2015        bld1
    3           4/4/2015        bld1
    I want to run a query like
    Select Date, Location FROM [table] WHERE (Date Between '4/1/2015' and '4/4/2015') and (Location = bld1)
    WHERE Date not in
    (Select Date, Location FROM [table])
    and the results would be:
    4/3/2015   bld1
    Thank you

    Do you have a table with all possible dates in it?  You can do a left join from that to your above mentioned table where the right side of the join is null.  If you don't have a table with all possible dates you could user a numbers table.
    Below is one way to achieve what you want with a numbers table...
    DECLARE @Table table (ID Int, DateField Date, Location VarChar(4))
    DECLARE @RunDate datetime
    SET @RunDate=GETDATE()
    IF OBJECT_ID('dbo.Numbers') IS NOT NULL 
    DROP TABLE NUMBERS
    SELECT TOP 10000 IDENTITY(int,1,1) AS Number
       into Numbers
        FROM sys.objects s1
        CROSS JOIN sys.objects s2
    ALTER TABLE Numbers ADD CONSTRAINT PK_Numbers PRIMARY KEY CLUSTERED (Number)
    INSERT INTO @Table (ID, DateField, Location)
    VALUES ('1','20150401','bld1')
    ,('1','20150402','bld1')
    ,('1','20150404','bld1');
    WITH AllDates
    as
    SELECT DATEADD(dd,N.Number,D.StartDate) as Dates
    FROM Numbers N
    cross apply (SELECT CAST('20150101' as Date) as StartDate) as D
    select * 
    from AllDates AD
    left join @Table T on AD.Dates = T.DateField
    where ad.Dates between '20150401' and '20150404'
    AND T.ID IS NULL
    LucasF

  • Finding Missing Time Interval in SQL

    All 
     Need help with SQL to find Missing Time Interval. 
    My query returns data as given below  
    Data1
     Column      StartTime    EndTime
    =======   =======   ======= 
    T2               9:00          18:00T3               20:00         23:00 
    Data2
     Column      StartTime    EndTime
    =======   =======   ======= T1               15:00          20:00
    T3               20:00          07:00 
    Take above output, I want to find Time Not on my Data in 24 hours from First StartTime on each Data Set.
    Example: Data1
    First StartTime: 9:00 AM (T2 record)
    Add 24 hours, which will be 9:00AM Next day.
    Expected Result to get missing time interval for Data1
    18:00 - 20:00
    23:00 - 9:00 (next day)
    For Data2 Expected result
    7:00 - 15:00 Next Day
    Database version: 11g
    Anyone come across to calculate missing time interval? Can I use PL/SQL for this like pipeline function?
    Any help/directions/references I highly appreciate.
    Thanks in advance.
    Karth

    One way of finding Missing Intervals:
    alter session set nls_date_format = 'DD-Mon-YYYY HH24:MI:SS';
    with data as
      select to_date('28-Jun-2013 09:00', 'DD-Mon-YYYY HH24:MI') start_time, to_date('28-Jun-2013 18:00', 'DD-Mon-YYYY HH24:MI') end_time from dual union all
      select to_date('28-Jun-2013 20:00', 'DD-Mon-YYYY HH24:MI') start_time, to_date('28-Jun-2013 23:00', 'DD-Mon-YYYY HH24:MI') end_time from dual
    select start_time, end_time,
           case when lead(to_char(start_time, 'HH24'), 1, (select min(to_char(start_time, 'HH24')) from data)) over (order by to_char(start_time, 'HH24')) not between to_char(start_time, 'HH24') and to_char(end_time, 'HH24')
                  then to_char(end_time, 'HH24:MI') || ' - ' || lead(to_char(start_time, 'HH24:MI'), 1, (select min(to_char(start_time, 'HH24:MI')) from data)) over (order by to_char(start_time, 'HH24:MI'))
                else
                  null
           end period
      from data
    START_TIME                END_TIME                  PERIOD      
    28-Jun-2013 09:00:00      28-Jun-2013 18:00:00      18:00 - 20:00
    28-Jun-2013 20:00:00      28-Jun-2013 23:00:00      23:00 - 09:00
    Time information need not be stored in additional Varchar fields, if you have Date Column. You can use Date fields that store Date and time both.
    Another way of approaching this problem is with Connect By Clause or Model Clause. Use the search functionality to find solutions using those methods too. However, in my opinion, this method is the quickest of all.

  • How to find missed data

    hi friend,
    i did not find the data for the last two days in the info provider manage screen and in the process chain maintanance also.
    we r getting data from crm and r/3
    can anyone help me how to find the missed records?
    Thanks in advance
    sridath

    Hi,
    The first step is to check in the extractor checker (RSA3) in the source system...
    Then you ahve to check the delta queue...also the missing of record can happen on the delta option that you have chosen...generally unserialized V3 update is preferred so that we do not miss any records....
    Thanks
    santo

  • 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

  • How to find missing documnets

    Hi Experts,
    My collegue says some material documents were missing oic_c03 cube.. How can i validate this?? what tcode and what search criteria shld i use to find those missing material documnet nos..
    Thanks
    DV

    Hi DVMC,
      Did you already check if the data really missing on the infocube(RSA1-Manage Infocube)? Did you already check if the data will be extracted by your datasource from R/3 (RSA3 transaction)? Did you check your update rules if there is an start routine that delete records base on a certain criteria (open update rules of infocube)? Check records on the PSA if the PSA Table contains the missing records?

  • The row was not found at the Subscriber error keeps popup and stopped synchronization even after inserting missing record at subscriber - transcational replication.

    The row was not found at the Subscriber error keeps popup and stopped synchronization even after inserting missing record at subscriber - transcational replication.
    first error throws: Grab exact sequence number, find row and inserted at subscriber...
    Start synchronizing, ran fine for a while, stopped again with error with different exact sequence number, repeat again same as step 1.......
    how can we stop this and make it run without this error?
    Please advise!!!

    Hi,
    This means that your database is out of sync. You can use the continue on data consistency error profile to skip errors. However, Microsoft recommends that you use -SkipErrors parameter cautiously and only when you have a good understanding of the following:
    What the error indicates.
    Why the error occurs.
    Why it is better to skip the error instead of solving it.
    If you do not know the answers to these items, inappropriate use of the
    -SkipErrors parameter may cause data inconsistency between the Publisher and Subscriber. This article describes some problems that can occur when you incorrectly use the
    -SkipErrors parameter.
    Use the "-SkipErrors" parameter in Distribution Agent cautiously
    http://support.microsoft.com/kb/327817/en-us
    Here are two similar threads you may refer to:
    http://social.technet.microsoft.com/Forums/en-US/af531f69-6caf-4dd7-af74-fd6ebe7418da/sqlserver-replication-error-the-row-was-not-found-at-the-subscriber-when-applying-the-replicated
    http://social.technet.microsoft.com/Forums/en-US/f48c2592-bad7-44ea-bc6d-7eb99b2348a1/the-row-was-not-found-at-the-subscriber-when-applying-the-replicated-command
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Query help to find missing rows

    Hi,
    Create tableA (
    columname varchar2;
    Insert into tableA ('a3');
    Insert into tableA ('dd');
    Select * from tablename where column in ( a3, b12,c34, dd ); -- 4 Values provided
    Need a query to return b12,c34 ie I have to find which records or not returning from a table for a given values.
    Please help
    Thanks
    Arvy
    Edited by: ARVY on Jun 19, 2012 11:10 AM
    Edited by: ARVY on Jun 19, 2012 11:16 AM

    ARVY wrote:
    I am using Oracle 9i versionFollowing is query that should be compatible on 9i.
    Please test it,since I am not able to do it due to unavailability of Oracle 9i with me.
    with data as
      select 'a,b,c,d' || ',' col from dual
    isolated_data as
      select trim(both ',' from (substr(col,
                  DECODE(level,
                          1, 1,
                          instr(col, ',', 1, level - 1) + 1
                  DECODE(level,
                          1, instr(col, ',', 1, level),
                          instr(col, ',', 1, level) - instr(col, ',', 1, level - 1)
                 ) ))col1
        from data
       connect by level <= length(col) - length(replace(col, ','))
    select a.col1
      from isolated_data a
    where a.col1 NOT IN (select col from test_Table);Regards,
    P.

  • "Open VI Reference" Option "Prompt user to find missing subVIs"

    I am using "Open VI Reference" to dynamically load a VI. For the "option" control of the "Open VI Reference" node, I pass "0x10" or "10" in hexadecimal, which supposedly "prompt user to find missing subVIs." Nevertheless, I don't get a prompt message dialog when I intentionally pass an invalid or missing VI path. Instead I just get an Error Code 7. What does this option "Prompt user..." suppose to do?

    Make sure you set the properties on the integer input into the “options” control to the “Open VI Reference” to be a Hexadecimal format (right-click on the “options” control input, select Format and Precision…, then select Hexadecimal). Now, if you re-run your VI and wire in a VI with a missing subVI, the Open VI Reference will appear with a dialog that will prompt you to browse to the missing subVI. This is exactly the same message LabVIEW displays when it attempts to open a VI and cannot find its subVIs.
    I’ve attached a simple example program to demonstrate. Enter the path to the “number extractor.vi” as the VI to open. You should see a dialog prompt appear asking for the “Search 1D Array – Complete.vi”.
    Hope this helps!
    Attachments:
    openVIRefExample.zip ‏20 KB

  • How to identify missing records in a single-column table?

    How to identify missing records in a single-column table ?
    Column consists of numbers in a ordered manner but the some numbers are deleted from the table in random manner and need to identify those rows.

    Something like:
    WITH t AS (
               SELECT 1 ID FROM DUAL UNION ALL
               SELECT 2 ID FROM DUAL UNION ALL
               SELECT 3 ID FROM DUAL UNION ALL
               SELECT 5 ID FROM DUAL UNION ALL
               SELECT 8 ID FROM DUAL UNION ALL
               SELECT 10 ID FROM DUAL UNION ALL
               SELECT 11 ID FROM DUAL
    -- end of on-the-fly data sample
    SELECT  '[' || (id + 1) || ' - ' || (next_id - 1) || ']' gap
      FROM  (
             SELECT  id,
                     lead(id,1,id + 1) over(order by id) next_id
               FROM  t
      where id != next_id - 1
    GAP
    [4 - 4]
    [6 - 7]
    [9 - 9]
    SQL> SY.
    P.S. I assume sequence lower and upper limits are always present, otherwise query needs a little adjustment.

  • How to find a record in PSA

    hi all,
    tell me the steps how to find a record in PSA.suppose there are >20 data packages..how can i find out that specific record from those datapackages with out knowing datapackage..
    thanks,
    jack

    Hi Jack,
    It so happens that when data is pulled into the PSA there will be no specific order. Hence it is impossible to know which record is present in which data package.
    But if you want to know how many error records are there and what are those there are always options of selecting all the packets and display only erraneous records.
    Regards,
    Pramod

  • Insert missing records dynamically in SQL Server 2008 R2

    Hi, I am working on a requirement where I will have to work on some % calculations for 2 different states where we do business. The task that I am trying to accomplish is technically we need to have any Product sales in both the states if not for instance
    in the following example ProductC does not have sales in OR so I need to insert a record for ProductC - OR with 0. This is an intermediary resultset of all the calculations that I am working with.
    Example Dataset:
    CREATE TABLE [dbo].[Product](
    [Product] [varchar](18) NOT NULL,
    [State] [varchar](5) NOT NULL,
    [Area1] [int] NOT NULL,
    [Area2] [int] NOT NULL,
    [Area3] [int] NOT NULL,
    [Area4] [int] NOT NULL,
    [Area5] [int] NOT NULL,
    [Area6] [int] NOT NULL,
    [Area7] [int] NOT NULL,
    [Area8] [int] NOT NULL,
    [Area9] [int] NOT NULL,
    [Area10] [int] NOT NULL,
    [Total] [int] NULL
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductA','OR',0,0,2,0,2,0,0,0,0,0,4)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductA','WA',0,0,1,0,0,0,0,0,0,0,1)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductA','Total',0,0,3,0,2,0,0,0,0,0,5)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductB','OR',0,0,5,0,0,0,0,0,0,0,5)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductB','WA',0,0,2,0,0,1,0,0,0,0,3)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductB','Total',0,0,7,0,0,1,0,0,0,0,8)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductC','WA',0,0,0,0,0,0,0,0,0,1,1)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductC','Total',0,0,0,0,0,0,0,0,0,1,1)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductD','OR',5,2,451,154,43,1,0,0,0,0,656)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductD','WA',0,20,102,182,58,36,0,1,0,0,399)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductD','Total',5,22,553,336,101,37,0,1,0,0,1055)
    How to accomplish this in SQL Server 2008 R2.
    Insert missing record:
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductC','OR',0,0,0,0,0,0,0,0,0,0,0)
    Thanks in advance......
    Ione

    CREATE TABLE [dbo].[Products](
    [Product] [varchar](18) NOT NULL,
    [State] [varchar](5) NOT NULL,
    [Area1] [int] NOT NULL,
    [Area2] [int] NOT NULL,
    [Area3] [int] NOT NULL,
    [Area4] [int] NOT NULL,
    [Area5] [int] NOT NULL,
    [Area6] [int] NOT NULL,
    [Area7] [int] NOT NULL,
    [Area8] [int] NOT NULL,
    [Area9] [int] NOT NULL,
    [Area10] [int] NOT NULL,
    [Total] [int] NULL
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductA','OR',0,0,2,0,2,0,0,0,0,0,4)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductA','WA',0,0,1,0,0,0,0,0,0,0,1)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductA','Total',0,0,3,0,2,0,0,0,0,0,5)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductB','OR',0,0,5,0,0,0,0,0,0,0,5)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductB','WA',0,0,2,0,0,1,0,0,0,0,3)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductB','Total',0,0,7,0,0,1,0,0,0,0,8)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductC','WA',0,0,0,0,0,0,0,0,0,1,1)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductC','Total',0,0,0,0,0,0,0,0,0,1,1)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductD','OR',5,2,451,154,43,1,0,0,0,0,656)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductD','WA',0,20,102,182,58,36,0,1,0,0,399)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductD','Total',5,22,553,336,101,37,0,1,0,0,1055)
    ;WIth mycte as (
    Select Product,State From (Select distinct Product from Products) p, (
    Select distinct State from Products) s
    Insert into [Products](Product,State,[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])
    Select m.Product,m.State
    ,0,0,0,0,0,0,0,0,0,0,0
    from mycte m Left Join Products p on m.[Product]=p.Product and m.State=p.State
    WHERE p.Product is null and p.State is null
    select * from Products
    Order by Product
    ,Case when State='Total' Then 2 else 1 End
    Drop table Products

  • Journal Import finds no records in GL_INTERFACE for processing.

    Hi,
    I'm using the Oracle Web ADI (11i) to upload journal entries form a spreedsheat to GL.
    When the request is finished, this message is shown on the out put :
    Journal Import finds no records in GL_INTERFACE for processing.
    Check SET_OF_BOOKS_ID, USER_JE_SOURCE_NAME, and GROUP_ID of import records.
    If no GROUP_ID is specified, then only data with no GROUP_ID will be retrieved.  Note that most data
    from the Oracle subledgers has a GROUP_ID, and will not be retrieved if no GROUP_ID is specified.
    Can you help me to reslove it.
    Thx.

    Hi Msk;
    You have below errors,
    LEZL0008: Found no interface records to process.
    LEZL0009: Check LEDGER_ID, GROUP_ID, and USER_JE_SOURCE_NAME of interface records.Journal Import Finds No Records in gl_interface for Processing [ID 141824.1]
    Journal Import Finds No Records in GL_INTERFACE For Processing For AX and AP Sources [ID 360994.1]
    GLMRCU does not populate GL_INTERFACE to produce journal for reporting sob [ID 1081808.6]
    Regards
    Helios

  • 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

Maybe you are looking for

  • Closing an email window bug

    I like to close open email messages by double clicking the small envelope in the upper left hand corner just above the "File" tab. A single click brings up options for restore, move, size, minimize, maximize, close. Close is the default option on a d

  • Which Is The Best Free Video Converter Software?

    Which is the best FREE software for encrypting dvd's for Ipod and which is the best FREE software for converting encrypted dvd videos to my Ipod, or is there out a FREE software that can do both thing?   Windows XP Pro  

  • Lost Views & Callouts converting from toolkit to PDF

    I'm looking for a way to keep the numbered bubble callouts and veiws created in toolkit. When I pull up the file, either in 3DU or RH, my callouts and views are shown in the model tree. But after converting to PDF, the model tree no longer shows the

  • Flickr Plugin - can't authorize

    Hi, I have Lightroom 4.4 on a macbook pro with Yosemite v 10.10.1. When i try to authorize Flickr to then later upload photos it won't authorize. I am logged in to flickr in my Safari and Chrome browsers. Its says after i click 'authorize' in the Lig

  • How do I switch back and forth between phones

    My daughter has a new phone (no data) and she wants to switch back to her old phone temporarily.  I logged into my Verizon, picked the activate a device option, and then when I get to the next screen it automatically picks MY phone to activate even t