--- title: "Escalation Mart Validation Guide" slug: "escalationmartvalidationguide" status: "update" updated: 2026-11-27T06:03:14Z published: 2026-11-27T06:03:14Z canonical: "help.symphonysummitai.com/escalationmartvalidationguide" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.symphonysummitai.com/llms.txt > Use this file to discover all available pages before exploring further. # Escalation Mart Validation Guide ## Purpose This guide gives SQL Server queries to validate each auto-escalated mart table. Use it when a mart looks wrong, to confirm that the rows in the mart match the source tickets and escalation setup. ## Mart Tables Covered | **#** | **Mart table** | **Module** | **Ticket table (driver)** | **Ticket escalation key** | | --- | --- | --- | --- | --- | | 1 | mart_im_auto_escalated_etr_tracking | IM | IM_TicketMaster | ETREscLevellD | | 2 | mart_im_auto_escalated_pending_tasks | IM | IM_TicketMaster | PendingStatusEscLevellD | | 3 | mart_im_auto_escalated_reassignments | IM | IM_TicketMaster | ReAssignEscLevelld | | 4 | mart_im_auto_escalated_resolution_records | IM | IM_TicketMaster | Escalation_Level_ID | | 5 | mart_im_auto_escalated_response_records | IM | IM_TicketMaster | UnAssignedStatusEscLevellD | | 6 | mart_sr_auto_escalated_pending_tasks | SR | SR_Master | PendingStatusEscLevellD | | 7 | mart_sr_auto_escalated_pendingapproval | SR | SR_Master | PendingApprovalEscLevellD | | 8 | mart_sr_auto_escalated_reassignments | SR | SR_Master | ReAssignEscLevelld | | 9 | mart_sr_auto_escalated_resolution_records | SR | SR_Master | Escalation_Level_ID | | 10 | mart_sr_auto_escalated_response_records | SR | SR_Master | UnAssignedStatusEscLevellD | # How to Validate a Mart? **Step 1:** (expected rows): run the query for the mart. It copies the worker's logic, so every row it returns should appear in the mart. **Step 2:** (setup and mapping checks, source only): the first query finds escalation matrices whose configured level count does not match the rows in their levels table. The second query finds tickets that should be in the mart but cannot be mapped, because their level ID is not in an active matrix. **mart_im_auto_escalated_etr_tracking** **Module**: IM **Sources and join keys** | **Role** | **Table** | **Join key** | | --- | --- | --- | | Source (driver) | IM_TicketMaster (delta via deltamatch_im_ticketmaster) | ETREscLevellD | | Escalation matrix | IM_Escalation_Matrix | Escalation_ID | | Escalation levels | IM_ETREsc_Levels | Escalation_ID, Escalation_Level_ID | | Workgroup lookup | IM_WorkGroup_Master | levels.workgroup = wg_Id > wg_name | | User lookup | User_Master | levels.executive = UserID > username | ****Step 1: Expected rows from the source (SQL Server)**** This query copies the worker's logic, so each row it returns should appear in the mart. ```xml WITH lv AS ( SELECT m.Escalation_ID, l.Escalation_Level_ID, ROW_NUMBER() OVER (PARTITION BY m.Escalation_ID ORDER BY l.Escalation_Level_ID) AS lvl, LTRIM(RTRIM( CASE WHEN l.Other_User IS NOT NULL THEN 'Notified : (' + l.Other_User + ')' ELSE '' END + '' + CASE WHEN w.wg_Name IS NOT NULL THEN 'Assigned to WorkGroup : (' + w.wg_Name + ')' ELSE '' END + '' + CASE WHEN u.UserName IS NOT NULL THEN 'Assigned to Analyst : (' + u.UserName + ')' ELSE '' END)) AS detail FROM dbo.IM_Escalation_Matrix m WITH (NOLOCK) JOIN dbo.IM_ETREsc_Levels l WITH (NOLOCK) ON l.Escalation_ID = m.Escalation_ID LEFT JOIN dbo.IM_WorkGroup_Master w WITH (NOLOCK) ON w.wg_Id = l.Workgroup LEFT JOIN dbo.User_Master u WITH (NOLOCK) ON u.UserID = l.Executive WHERE m.Escalation_Levels > 0 AND m.Active = 1 -- adjust if Active is varchar 'true' ) SELECT t.Ticket_ID, t.Updated_Time AS updated_date, 'level' + CAST(c.lvl AS varchar(10)) AS level_col, c.detail, b.lvl AS reached_level FROM dbo.IM_TicketMaster t WITH (NOLOCK) JOIN lv b ON b.Escalation_Level_ID = t.ETREscLevellD -- the level the ticket reached JOIN lv c ON c.Escalation_ID = b.Escalation_ID AND c.lvl <= b.lvl WHERE t.ETREscLevellD > 0; ``` ****Step 2: Check the level setup itself (source only)**** Finds matrices where the configured level count does not match the rows in the levels table: ```xml SELECT m.Escalation_ID, m.TicketsETrEscLevels AS configured, COUNT(l.Escalation_Level_ID) AS actual FROM dbo.IM_Escalation_Matrix m LEFT JOIN dbo.IM_ETREsc_Levels l ON l.Escalation_ID = m.Escalation_ID GROUP BY m.Escalation_ID, m.TicketsETrEscLevels HAVING m.TicketsETrEscLevels <> COUNT(l.Escalation_Level_ID); Finds tickets that should be in the mart but cannot be mapped, because their level ID is not in an active matrix: SELECT t.Ticket_ID, t.ETREscLevellD FROM dbo.IM_TicketMaster t LEFT JOIN dbo.IM_ETREsc_Levels l ON l.Escalation_Level_ID = t.ETREscLevellD LEFT JOIN dbo.IM_Escalation_Matrix m ON m.Escalation_ID = l.Escalation_ID AND m.Active = 1 WHERE t.ETREscLevellD > 0 AND m.Escalation_ID IS NULL; ``` **mart_im_auto_escalated_pending_tasks** Module: IM **Sources and join keys** | **Role** | **Table** | **Join key** | | --- | --- | --- | | Source (driver) | IM_TicketMaster (delta via deltamatch_im_ticketmaster) | PendingStatusEscLevellD | | Escalation matrix | IM_Escalation_Matrix | Escalation_ID | | Escalation levels | IM_PendingTicketsEsc_Levels | Escalation_ID, Escalation_Level_ID | | Workgroup lookup | IM_WorkGroup_Master | levels.workgroup = wg_Id > wg_name | | User lookup | User_Master | levels.executive = UserID > username | ****Step 1: Expected rows from the source (SQL Server)**** This query copies the worker's logic, so each row it returns should appear in the mart. ```xml WITH lv AS ( SELECT m.Escalation_ID, l.Escalation_Level_ID, ROW_NUMBER() OVER (PARTITION BY m.Escalation_ID ORDER BY l.Escalation_Level_ID) AS lvl, LTRIM(RTRIM( CASE WHEN l.Other_User IS NOT NULL THEN 'Notified : (' + l.Other_User + ')' ELSE '' END + '' + CASE WHEN w.wg_Name IS NOT NULL THEN 'Assigned to WorkGroup : (' + w.wg_Name + ')' ELSE '' END + '' + CASE WHEN u.UserName IS NOT NULL THEN 'Assigned to Analyst : (' + u.UserName + ')' ELSE '' END)) AS detail FROM dbo.IM_Escalation_Matrix m WITH (NOLOCK) JOIN dbo.IM_PendingTicketsEsc_Levels l WITH (NOLOCK) ON l.Escalation_ID = m.Escalation_ID LEFT JOIN dbo.IM_WorkGroup_Master w WITH (NOLOCK) ON w.wg_Id = l.Workgroup LEFT JOIN dbo.User_Master u WITH (NOLOCK) ON u.UserID = l.Executive WHERE m.Escalation_Levels > 0 AND m.Active = 1 -- adjust if Active is varchar 'true' ) SELECT t.Ticket_ID, t.Updated_Time AS updated_date, 'level' + CAST(c.lvl AS varchar(10)) AS level_col, c.detail, b.lvl AS reached_level FROM dbo.IM_TicketMaster t WITH (NOLOCK) JOIN lv b ON b.Escalation_Level_ID = t.PendingStatusEscLevellD -- the level the ticket reached JOIN lv c ON c.Escalation_ID = b.Escalation_ID AND c.lvl <= b.lvl WHERE t.PendingStatusEscLevellD > 0; ``` ****Step 2: Check the level setup itself (source only)**** Finds matrices where the configured level count does not match the rows in the levels table: ```xml SELECT m.Escalation_ID, m.PendingTicketsEscLevels AS configured, COUNT(l.Escalation_Level_ID) AS actual FROM dbo.IM_Escalation_Matrix m LEFT JOIN dbo.IM_PendingTicketsEsc_Levels l ON l.Escalation_ID = m.Escalation_ID GROUP BY m.Escalation_ID, m.PendingTicketsEscLevels HAVING m.PendingTicketsEscLevels <> COUNT(l.Escalation_Level_ID); Finds tickets that should be in the mart but cannot be mapped, because their level ID is not in an active matrix: SELECT t.Ticket_ID, t.PendingStatusEscLevellD FROM dbo.IM_TicketMaster t LEFT JOIN dbo.IM_PendingTicketsEsc_Levels l ON l.Escalation_Level_ID = t.PendingStatusEscLevellD LEFT JOIN dbo.IM_Escalation_Matrix m ON m.Escalation_ID = l.Escalation_ID AND m.Active = 1 WHERE t.PendingStatusEscLevellD > 0 AND m.Escalation_ID IS NULL; ``` **mart_im_auto_escalated_reassignments** Module: IM **Sources and join keys** | **Role** | **Table** | **Join key** | | --- | --- | --- | | Source (driver) | IM_TicketMaster (delta via deltamatch_im_ticketmaster) | ReAssignEscLevelld | | Escalation matrix | IM_Escalation_Matrix | Escalation_ID | | Escalation levels | IM_BouncingTicketsEsc_Levels | Escalation_ID, Escalation_Level_ID | | Workgroup lookup | IM_WorkGroup_Master | levels.workgroupowner = wg_Id > wg_name | | User lookup | User_Master | levels.executive = UserID > username | **Step 1: Expected rows from the source (SQL Server)** This query copies the worker's logic, so each row it returns should appear in the mart. WITH lv AS ( SELECT m.Escalation_ID, l.Escalation_Level_ID, ROW_NUMBER() OVER (PARTITION BY m.Escalation_ID ORDER BY l.Escalation_Level_ID) AS lvl, LTRIM(RTRIM( CASE WHEN l.Other_User IS NOT NULL THEN 'Notified : (' + l.Other_User + ')' ELSE '' END + '' + CASE WHEN w.wg_Name IS NOT NULL THEN 'Assigned to WorkGroup : (' + w.wg_Name + ')' ELSE '' END + '' + CASE WHEN u.UserName IS NOT NULL THEN 'Assigned to Analyst : (' + u.UserName + ')' ELSE '' END)) AS detail FROM dbo.IM_Escalation_Matrix m WITH (NOLOCK) JOIN dbo.IM_BouncingTicketsEsc_Levels l WITH (NOLOCK) ON l.Escalation_ID = m.Escalation_ID LEFT JOIN dbo.IM_WorkGroup_Master w WITH (NOLOCK) ON w.wg_Id = TRY_CAST(l.WorkgroupOwner AS int) LEFT JOIN dbo.User_Master u WITH (NOLOCK) ON u.UserID = l.Executive WHERE m.Escalation_Levels > 0 AND m.Active = 1 -- adjust if Active is varchar 'true' ) SELECT t.Ticket_ID, t.Updated_Time AS updated_date, 'level' + CAST(c.lvl AS varchar(10)) AS level_col, c.detail, b.lvl AS reached_level FROM dbo.IM_TicketMaster t WITH (NOLOCK) JOIN lv b ON b.Escalation_Level_ID = t.ReAssignEscLevelld -- the level the ticket reached JOIN lv c ON c.Escalation_ID = b.Escalation_ID AND c.lvl <= b.lvl WHERE t.ReAssignEscLevelld > 0; **Step 2: Check the level setup itself (source only)** Finds matrices where the configured level count does not match the rows in the levels table: SELECT m.Escalation_ID, m.BouncingTicketsEscLevels AS configured, COUNT(l.Escalation_Level_ID) AS actual FROM dbo.IM_Escalation_Matrix m LEFT JOIN dbo.IM_BouncingTicketsEsc_Levels l ON l.Escalation_ID = m.Escalation_ID GROUP BY m.Escalation_ID, m.BouncingTicketsEscLevels HAVING m.BouncingTicketsEscLevels <> COUNT(l.Escalation_Level_ID); Finds tickets that should be in the mart but cannot be mapped, because their level ID is not in an active matrix: SELECT t.Ticket_ID, t.ReAssignEscLevelld FROM dbo.IM_TicketMaster t LEFT JOIN dbo.IM_BouncingTicketsEsc_Levels l ON l.Escalation_Level_ID = t.ReAssignEscLevelld LEFT JOIN dbo.IM_Escalation_Matrix m ON m.Escalation_ID = l.Escalation_ID AND m.Active = 1 WHERE t.ReAssignEscLevelld > 0 AND m.Escalation_ID IS NULL; **mart_im_auto_escalated_resolution_records** **Module**: IM **Sources and join keys** | **Role** | **Table** | **Join key** | | --- | --- | --- | | Source (driver) | IM_TicketMaster (delta via deltamatch_im_ticketmaster) | Escalation_Level_ID | | Escalation matrix | IM_Escalation_Matrix | Escalation_ID | | Escalation levels | IM_Escalation_Levels | Escalation_ID, Escalation_Level_ID | | Workgroup lookup | IM_WorkGroup_Master | levels.workgroup = wg_Id > wg_name | | User lookup | User_Master | levels.executive = UserID > username | ****Step 1: Expected rows from the source (SQL Server)**** This query copies the worker's logic, so each row it returns should appear in the mart. ```xml WITH lv AS ( SELECT m.Escalation_ID, l.Escalation_Level_ID, ROW_NUMBER() OVER (PARTITION BY m.Escalation_ID ORDER BY l.Escalation_Level_ID) AS lvl, LTRIM(RTRIM( CASE WHEN l.Other_User IS NOT NULL THEN 'Notified : (' + l.Other_User + ')' ELSE '' END + '' + CASE WHEN w.wg_Name IS NOT NULL THEN 'Assigned to WorkGroup : (' + w.wg_Name + ')' ELSE '' END + '' + CASE WHEN u.UserName IS NOT NULL THEN 'Assigned to Analyst : (' + u.UserName + ')' ELSE '' END)) AS detail FROM dbo.IM_Escalation_Matrix m WITH (NOLOCK) JOIN dbo.IM_Escalation_Levels l WITH (NOLOCK) ON l.Escalation_ID = m.Escalation_ID LEFT JOIN dbo.IM_WorkGroup_Master w WITH (NOLOCK) ON w.wg_Id = l.Workgroup LEFT JOIN dbo.User_Master u WITH (NOLOCK) ON u.UserID = l.Executive WHERE m.Escalation_Levels > 0 AND m.Active = 1 -- adjust if Active is varchar 'true' ) SELECT t.Ticket_ID, t.Updated_Time AS updated_date, 'level' + CAST(c.lvl AS varchar(10)) AS level_col, c.detail, b.lvl AS reached_level FROM dbo.IM_TicketMaster t WITH (NOLOCK) JOIN lv b ON b.Escalation_Level_ID = t.Escalation_Level_ID -- the level the ticket reached JOIN lv c ON c.Escalation_ID = b.Escalation_ID AND c.lvl <= b.lvl WHERE t.Escalation_Level_ID > 0; ``` ****Step 2: Check the level setup itself (source only)**** Finds matrices where the configured level count does not match the rows in the levels table: ```xml SELECT m.Escalation_ID, m.Escalation_Levels AS configured, COUNT(l.Escalation_Level_ID) AS actual FROM dbo.IM_Escalation_Matrix m LEFT JOIN dbo.IM_Escalation_Levels l ON l.Escalation_ID = m.Escalation_ID GROUP BY m.Escalation_ID, m.Escalation_Levels HAVING m.Escalation_Levels <> COUNT(l.Escalation_Level_ID); Finds tickets that should be in the mart but cannot be mapped, because their level ID is not in an active matrix: SELECT t.Ticket_ID, t.Escalation_Level_ID FROM dbo.IM_TicketMaster t LEFT JOIN dbo.IM_Escalation_Levels l ON l.Escalation_Level_ID = t.Escalation_Level_ID LEFT JOIN dbo.IM_Escalation_Matrix m ON m.Escalation_ID = l.Escalation_ID AND m.Active = 1 WHERE t.Escalation_Level_ID > 0 AND m.Escalation_ID IS NULL; ``` **mart_im_auto_escalated_resolution_records** **Module**: IM **Sources and join keys** | **Role** | **Table** | **Join key** | | --- | --- | --- | | Source (driver) | IM_TicketMaster (delta via deltamatch_im_ticketmaster) | UnAssignedStatusEscLevellD | | Escalation matrix | IM_Escalation_Matrix | Escalation_ID | | Escalation levels | IM_UnAssignedTicketsEsc_Levels | Escalation_ID, Escalation_Level_ID | | Workgroup lookup | IM_WorkGroup_Master | levels.workgroup = wg_Id > wg_name | | User lookup | User_Master | levels.executive = UserID > username | ****Step 1: Expected rows from the source (SQL Server)**** This query copies the worker's logic, so each row it returns should appear in the mart. ```xml WITH lv AS ( SELECT m.Escalation_ID, l.Escalation_Level_ID, ROW_NUMBER() OVER (PARTITION BY m.Escalation_ID ORDER BY l.Escalation_Level_ID) AS lvl, LTRIM(RTRIM( CASE WHEN l.Other_User IS NOT NULL THEN 'Notified : (' + l.Other_User + ')' ELSE '' END + '' + CASE WHEN w.wg_Name IS NOT NULL THEN 'Assigned to WorkGroup : (' + w.wg_Name + ')' ELSE '' END + '' + CASE WHEN u.UserName IS NOT NULL THEN 'Assigned to Analyst : (' + u.UserName + ')' ELSE '' END)) AS detail FROM dbo.IM_Escalation_Matrix m WITH (NOLOCK) JOIN dbo.IM_UnAssignedTicketsEsc_Levels l WITH (NOLOCK) ON l.Escalation_ID = m.Escalation_ID LEFT JOIN dbo.IM_WorkGroup_Master w WITH (NOLOCK) ON w.wg_Id = l.Workgroup LEFT JOIN dbo.User_Master u WITH (NOLOCK) ON u.UserID = l.Executive WHERE m.Escalation_Levels > 0 AND m.Active = 1 -- adjust if Active is varchar 'true' ) SELECT t.Ticket_ID, t.Updated_Time AS updated_date, 'level' + CAST(c.lvl AS varchar(10)) AS level_col, c.detail, b.lvl AS reached_level FROM dbo.IM_TicketMaster t WITH (NOLOCK) JOIN lv b ON b.Escalation_Level_ID = t.UnAssignedStatusEscLevellD -- the level the ticket reached JOIN lv c ON c.Escalation_ID = b.Escalation_ID AND c.lvl <= b.lvl WHERE t.UnAssignedStatusEscLevellD > 0; ``` ****Step 2: Check the level setup itself (source only)**** Finds matrices where the configured level count does not match the rows in the levels table: ```xml SELECT m.Escalation_ID, m.UnAssignedTicketsEscLevels AS configured, COUNT(l.Escalation_Level_ID) AS actual FROM dbo.IM_Escalation_Matrix m LEFT JOIN dbo.IM_UnAssignedTicketsEsc_Levels l ON l.Escalation_ID = m.Escalation_ID GROUP BY m.Escalation_ID, m.UnAssignedTicketsEscLevels HAVING m.UnAssignedTicketsEscLevels <> COUNT(l.Escalation_Level_ID); Finds tickets that should be in the mart but cannot be mapped, because their level ID is not in an active matrix: SELECT t.Ticket_ID, t.UnAssignedStatusEscLevellD FROM dbo.IM_TicketMaster t LEFT JOIN dbo.IM_UnAssignedTicketsEsc_Levels l ON l.Escalation_Level_ID = t.UnAssignedStatusEscLevellD LEFT JOIN dbo.IM_Escalation_Matrix m ON m.Escalation_ID = l.Escalation_ID AND m.Active = 1 WHERE t.UnAssignedStatusEscLevellD > 0 AND m.Escalation_ID IS NULL; ``` **mart_sr_auto_escalated_pending_tasks** **Module**: SR **Sources and join keys** | **Role** | **Table** | **Join key** | | --- | --- | --- | | Source (driver) | SR_Master | PendingStatusEscLevellD | | Escalation matrix | SR_AutoEscalation_Matrix | Escalation_ID | | Escalation levels | SR_PendingTicketsEsc_Levels | Escalation_ID, Escalation_Level_ID | | Workgroup lookup | IM_WorkGroup_Master (as in source) | levels.workgroup = wg_Id > wg_name | | User lookup | User_Master | levels.executive = UserID > username | ****Step 1: Expected rows from the source (SQL Server)**** This query copies the worker's logic, so each row it returns should appear in the mart. ```xml WITH lv AS ( SELECT m.Escalation_ID, l.Escalation_Level_ID, ROW_NUMBER() OVER (PARTITION BY m.Escalation_ID ORDER BY l.Escalation_Level_ID) AS lvl, LTRIM(RTRIM( CASE WHEN l.Other_User IS NOT NULL THEN 'Notified : (' + l.Other_User + ')' ELSE '' END + '' + CASE WHEN w.wg_Name IS NOT NULL THEN 'Assigned to WorkGroup : (' + w.wg_Name + ')' ELSE '' END + '' + CASE WHEN u.UserName IS NOT NULL THEN 'Assigned to Analyst : (' + u.UserName + ')' ELSE '' END)) AS detail FROM dbo.SR_AutoEscalation_Matrix m WITH (NOLOCK) JOIN dbo.SR_PendingTicketsEsc_Levels l WITH (NOLOCK) ON l.Escalation_ID = m.Escalation_ID LEFT JOIN dbo.IM_WorkGroup_Master w WITH (NOLOCK) ON w.wg_Id = l.Workgroup LEFT JOIN dbo.User_Master u WITH (NOLOCK) ON u.UserID = l.Executive WHERE m.Escalation_Levels > 0 AND m.Active = 1 -- adjust if Active is varchar 'true' ) SELECT t.Ticket_ID, t.Updated_Time AS updated_date, 'level' + CAST(c.lvl AS varchar(10)) AS level_col, c.detail, b.lvl AS reached_level FROM dbo.SR_Master t WITH (NOLOCK) JOIN lv b ON b.Escalation_Level_ID = t.PendingStatusEscLevellD -- the level the ticket reached JOIN lv c ON c.Escalation_ID = b.Escalation_ID AND c.lvl <= b.lvl WHERE t.PendingStatusEscLevellD > 0; ``` ****Step 2: Check the level setup itself (source only)**** Finds matrices where the configured level count does not match the rows in the levels table: ```xml SELECT m.Escalation_ID, m.PendingTicketsEscLevels AS configured, COUNT(l.Escalation_Level_ID) AS actual FROM dbo.SR_AutoEscalation_Matrix m LEFT JOIN dbo.SR_PendingTicketsEsc_Levels l ON l.Escalation_ID = m.Escalation_ID GROUP BY m.Escalation_ID, m.PendingTicketsEscLevels HAVING m.PendingTicketsEscLevels <> COUNT(l.Escalation_Level_ID); Finds tickets that should be in the mart but cannot be mapped, because their level ID is not in an active matrix: SELECT t.Ticket_ID, t.PendingStatusEscLevellD FROM dbo.SR_Master t LEFT JOIN dbo.SR_PendingTicketsEsc_Levels l ON l.Escalation_Level_ID = t.PendingStatusEscLevellD LEFT JOIN dbo.SR_AutoEscalation_Matrix m ON m.Escalation_ID = l.Escalation_ID AND m.Active = 1 WHERE t.PendingStatusEscLevellD > 0 AND m.Escalation_ID IS NULL; ``` **mart_sr_auto_escalated_pendingapproval** Module: SR **Sources and join keys** | **Role** | **Table** | **Join key** | | --- | --- | --- | | Source (driver) | SR_Master | PendingApprovalEscLevellD | | Escalation matrix | SR_AutoEscalation_Matrix | Escalation_ID | | Escalation levels | SR_PendingApprovalTicketsEsc_Levels | Escalation_ID, Escalation_Level_ID | | Workgroup / user lookup | None (worker sets workgroup and executive to NULL) | — | ****Step 1: Expected rows from the source (SQL Server)**** This query copies the worker's logic, so each row it returns should appear in the mart. ```xml WITH lv AS ( SELECT m.Escalation_ID, l.Escalation_Level_ID, ROW_NUMBER() OVER (PARTITION BY m.Escalation_ID ORDER BY l.Escalation_Level_ID) AS lvl, LTRIM(RTRIM(CASE WHEN l.Other_User IS NOT NULL THEN 'Notified : (' + l.Other_User + ')' ELSE '' END)) AS detail FROM dbo.SR_AutoEscalation_Matrix m WITH (NOLOCK) JOIN dbo.SR_PendingApprovalTicketsEsc_Levels l WITH (NOLOCK) ON l.Escalation_ID = m.Escalation_ID WHERE m.Escalation_Levels > 0 AND m.Active = 1 -- adjust if Active is varchar 'true' ) SELECT t.Ticket_ID, t.Updated_Time AS updated_date, 'level' + CAST(c.lvl AS varchar(10)) AS level_col, c.detail, b.lvl AS reached_level FROM dbo.SR_Master t WITH (NOLOCK) JOIN lv b ON b.Escalation_Level_ID = t.PendingApprovalEscLevellD -- the level the ticket reached JOIN lv c ON c.Escalation_ID = b.Escalation_ID AND c.lvl <= b.lvl WHERE t.PendingApprovalEscLevellD > 0; ``` ****Step 2: Check the level setup itself (source only)**** Finds matrices where the configured level count does not match the rows in the levels table: ```xml SELECT m.Escalation_ID, m.PendingApprovalEscLevels AS configured, COUNT(l.Escalation_Level_ID) AS actual FROM dbo.SR_AutoEscalation_Matrix m LEFT JOIN dbo.SR_PendingApprovalTicketsEsc_Levels l ON l.Escalation_ID = m.Escalation_ID GROUP BY m.Escalation_ID, m.PendingApprovalEscLevels HAVING m.PendingApprovalEscLevels <> COUNT(l.Escalation_Level_ID); Finds tickets that should be in the mart but cannot be mapped, because their level ID is not in an active matrix: SELECT t.Ticket_ID, t.PendingApprovalEscLevellD FROM dbo.SR_Master t LEFT JOIN dbo.SR_PendingApprovalTicketsEsc_Levels l ON l.Escalation_Level_ID = t.PendingApprovalEscLevellD LEFT JOIN dbo.SR_AutoEscalation_Matrix m ON m.Escalation_ID = l.Escalation_ID AND m.Active = 1 WHERE t.PendingApprovalEscLevellD > 0 AND m.Escalation_ID IS NULL; ``` **mart_sr_auto_escalated_reassignments** **Module**: SR **Sources and join keys** | **Role** | **Table** | **Join key** | | --- | --- | --- | | Source (driver) | SR_Master | ReAssignEscLevelld | | Escalation matrix | SR_AutoEscalation_Matrix | Escalation_ID | | Escalation levels | SR_BouncingTicketsEsc_Levels | Escalation_ID, Escalation_Level_ID | | Workgroup lookup | IM_WorkGroup_Master (as in source) | levels.workgroupowner = wg_Id > wg_name | | User lookup | User_Master | levels.executive = UserID > username | ****Step 1: Expected rows from the source (SQL Server)**** This query copies the worker's logic, so each row it returns should appear in the mart. ```xml WITH lv AS ( SELECT m.Escalation_ID, l.Escalation_Level_ID, ROW_NUMBER() OVER (PARTITION BY m.Escalation_ID ORDER BY l.Escalation_Level_ID) AS lvl, LTRIM(RTRIM( CASE WHEN l.Other_User IS NOT NULL THEN 'Notified : (' + l.Other_User + ')' ELSE '' END + '' + CASE WHEN w.wg_Name IS NOT NULL THEN 'Assigned to WorkGroup : (' + w.wg_Name + ')' ELSE '' END + '' + CASE WHEN u.UserName IS NOT NULL THEN 'Assigned to Analyst : (' + u.UserName + ')' ELSE '' END)) AS detail FROM dbo.SR_AutoEscalation_Matrix m WITH (NOLOCK) JOIN dbo.SR_BouncingTicketsEsc_Levels l WITH (NOLOCK) ON l.Escalation_ID = m.Escalation_ID LEFT JOIN dbo.IM_WorkGroup_Master w WITH (NOLOCK) ON w.wg_Id = TRY_CAST(l.WorkgroupOwner AS int) LEFT JOIN dbo.User_Master u WITH (NOLOCK) ON u.UserID = l.Executive WHERE m.Escalation_Levels > 0 AND m.Active = 1 -- adjust if Active is varchar 'true' ) SELECT t.Ticket_ID, t.Updated_Time AS updated_date, 'level' + CAST(c.lvl AS varchar(10)) AS level_col, c.detail, b.lvl AS reached_level FROM dbo.SR_Master t WITH (NOLOCK) JOIN lv b ON b.Escalation_Level_ID = t.ReAssignEscLevelld -- the level the ticket reached JOIN lv c ON c.Escalation_ID = b.Escalation_ID AND c.lvl <= b.lvl WHERE t.ReAssignEscLevelld > 0; ``` ****Step 2: Check the level setup itself (source only)**** Finds matrices where the configured level count does not match the rows in the levels table: ```xml SELECT m.Escalation_ID, m.BouncingTicketsEscLevels AS configured, COUNT(l.Escalation_Level_ID) AS actual FROM dbo.SR_AutoEscalation_Matrix m LEFT JOIN dbo.SR_BouncingTicketsEsc_Levels l ON l.Escalation_ID = m.Escalation_ID GROUP BY m.Escalation_ID, m.BouncingTicketsEscLevels HAVING m.BouncingTicketsEscLevels <> COUNT(l.Escalation_Level_ID); Finds tickets that should be in the mart but cannot be mapped, because their level ID is not in an active matrix: SELECT t.Ticket_ID, t.ReAssignEscLevelld FROM dbo.SR_Master t LEFT JOIN dbo.SR_BouncingTicketsEsc_Levels l ON l.Escalation_Level_ID = t.ReAssignEscLevelld LEFT JOIN dbo.SR_AutoEscalation_Matrix m ON m.Escalation_ID = l.Escalation_ID AND m.Active = 1 WHERE t.ReAssignEscLevelld > 0 AND m.Escalation_ID IS NULL; ``` **mart_sr_auto_escalated_resolution_records** **Module**: SR **Sources and join keys** | **Role** | **Table** | **Join key** | | --- | --- | --- | | Source (driver) | SR_Master | Escalation_Level_ID | | Escalation matrix | SR_AutoEscalation_Matrix | Escalation_ID | | Escalation levels | SR_AutoEscalation_Levels | Escalation_ID, Escalation_Level_ID | | Workgroup lookup | IM_WorkGroup_Master | levels.workgroup = wg_Id > wg_name | | User lookup | User_Master | levels.executive = UserID > username | ****Step 1: Expected rows from the source (SQL Server)**** This query copies the worker's logic, so each row it returns should appear in the mart. ```xml WITH lv AS ( SELECT m.Escalation_ID, l.Escalation_Level_ID, ROW_NUMBER() OVER (PARTITION BY m.Escalation_ID ORDER BY l.Escalation_Level_ID) AS lvl, LTRIM(RTRIM( CASE WHEN l.Other_User IS NOT NULL THEN 'Notified : (' + l.Other_User + ')' ELSE '' END + '' + CASE WHEN w.wg_Name IS NOT NULL THEN 'Assigned to WorkGroup : (' + w.wg_Name + ')' ELSE '' END + '' + CASE WHEN u.UserName IS NOT NULL THEN 'Assigned to Analyst : (' + u.UserName + ')' ELSE '' END)) AS detail FROM dbo.SR_AutoEscalation_Matrix m WITH (NOLOCK) JOIN dbo.SR_AutoEscalation_Levels l WITH (NOLOCK) ON l.Escalation_ID = m.Escalation_ID LEFT JOIN dbo.IM_WorkGroup_Master w WITH (NOLOCK) ON w.wg_Id = l.Workgroup LEFT JOIN dbo.User_Master u WITH (NOLOCK) ON u.UserID = l.Executive WHERE m.Escalation_Levels > 0 AND m.Active = 1 -- adjust if Active is varchar 'true' ) SELECT t.Ticket_ID, t.Updated_Time AS updated_date, 'level' + CAST(c.lvl AS varchar(10)) AS level_col, c.detail, b.lvl AS reached_level FROM dbo.SR_Master t WITH (NOLOCK) JOIN lv b ON b.Escalation_Level_ID = t.Escalation_Level_ID -- the level the ticket reached JOIN lv c ON c.Escalation_ID = b.Escalation_ID AND c.lvl <= b.lvl WHERE t.Escalation_Level_ID > 0; ``` ****Step 2: Check the level setup itself (source only)**** Finds matrices where the configured level count does not match the rows in the levels table: ```xml SELECT m.Escalation_ID, m.Escalation_Levels AS configured, COUNT(l.Escalation_Level_ID) AS actual FROM dbo.SR_AutoEscalation_Matrix m LEFT JOIN dbo.SR_AutoEscalation_Levels l ON l.Escalation_ID = m.Escalation_ID GROUP BY m.Escalation_ID, m.Escalation_Levels HAVING m.Escalation_Levels <> COUNT(l.Escalation_Level_ID); Finds tickets that should be in the mart but cannot be mapped, because their level ID is not in an active matrix: SELECT t.Ticket_ID, t.Escalation_Level_ID FROM dbo.SR_Master t LEFT JOIN dbo.SR_AutoEscalation_Levels l ON l.Escalation_Level_ID = t.Escalation_Level_ID LEFT JOIN dbo.SR_AutoEscalation_Matrix m ON m.Escalation_ID = l.Escalation_ID AND m.Active = 1 WHERE t.Escalation_Level_ID > 0 AND m.Escalation_ID IS NULL; ``` **mart_sr_auto_escalated_response_records** Module: SR **Sources and join keys** | **Role** | **Table** | **Join key** | | --- | --- | --- | | Source (driver) | SR_Master | UnAssignedStatusEscLevellD | | Escalation matrix | SR_AutoEscalation_Matrix | Escalation_ID | | Escalation levels | SR_UnAssignedTicketsEsc_Levels | Escalation_ID, Escalation_Level_ID | | Workgroup lookup | IM_WorkGroup_Master | levels.workgroup = wg_Id > wg_name | | User lookup | User_Master | levels.executive = UserID > username | ****Step 1: Expected rows from the source (SQL Server)**** This query copies the worker's logic, so each row it returns should appear in the mart. ```xml WITH lv AS ( SELECT m.Escalation_ID, l.Escalation_Level_ID, ROW_NUMBER() OVER (PARTITION BY m.Escalation_ID ORDER BY l.Escalation_Level_ID) AS lvl, LTRIM(RTRIM( CASE WHEN l.Other_User IS NOT NULL THEN 'Notified : (' + l.Other_User + ')' ELSE '' END + '' + CASE WHEN w.wg_Name IS NOT NULL THEN 'Assigned to WorkGroup : (' + w.wg_Name + ')' ELSE '' END + '' + CASE WHEN u.UserName IS NOT NULL THEN 'Assigned to Analyst : (' + u.UserName + ')' ELSE '' END)) AS detail FROM dbo.SR_AutoEscalation_Matrix m WITH (NOLOCK) JOIN dbo.SR_UnAssignedTicketsEsc_Levels l WITH (NOLOCK) ON l.Escalation_ID = m.Escalation_ID LEFT JOIN dbo.IM_WorkGroup_Master w WITH (NOLOCK) ON w.wg_Id = l.Workgroup LEFT JOIN dbo.User_Master u WITH (NOLOCK) ON u.UserID = l.Executive WHERE m.Escalation_Levels > 0 AND m.Active = 1 -- adjust if Active is varchar 'true' ) SELECT t.Ticket_ID, t.Updated_Time AS updated_date, 'level' + CAST(c.lvl AS varchar(10)) AS level_col, c.detail, b.lvl AS reached_level FROM dbo.SR_Master t WITH (NOLOCK) JOIN lv b ON b.Escalation_Level_ID = t.UnAssignedStatusEscLevellD -- the level the ticket reached JOIN lv c ON c.Escalation_ID = b.Escalation_ID AND c.lvl <= b.lvl WHERE t.UnAssignedStatusEscLevellD > 0; ``` ****Step 2: Check the level setup itself (source only)**** Finds matrices where the configured level count does not match the rows in the levels table: ```plaintext SELECT m.Escalation_ID, m.UnAssignedTicketsEscLevels AS configured, COUNT(l.Escalation_Level_ID) AS actual FROM dbo.SR_AutoEscalation_Matrix m LEFT JOIN dbo.SR_UnAssignedTicketsEsc_Levels l ON l.Escalation_ID = m.Escalation_ID GROUP BY m.Escalation_ID, m.UnAssignedTicketsEscLevels HAVING m.UnAssignedTicketsEscLevels <> COUNT(l.Escalation_Level_ID); Finds tickets that should be in the mart but cannot be mapped, because their level ID is not in an active matrix: SELECT t.Ticket_ID, t.UnAssignedStatusEscLevellD FROM dbo.SR_Master t LEFT JOIN dbo.SR_UnAssignedTicketsEsc_Levels l ON l.Escalation_Level_ID = t.UnAssignedStatusEscLevellD LEFT JOIN dbo.SR_AutoEscalation_Matrix m ON m.Escalation_ID = l.Escalation_ID AND m.Active = 1 WHERE t.UnAssignedStatusEscLevellD > 0 AND m.Escalation_ID IS NULL; ```