--- title: "Source to Mart Record Count Validation Guide" slug: "sourcetomartrecordcountvalidationguidedraft" status: "update" updated: 2026-11-26T07:35:31Z published: 2026-11-26T07:35:31Z canonical: "help.symphonysummitai.com/sourcetomartrecordcountvalidationguidedraft" --- > ## 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. # Source to Mart Record Count Validation Guide ## 1. Overview The **Source to Mart Record Count Validation Guide** describes SQL-based procedures for validating record counts between application source tables and their corresponding reporting mart tables. Use these checks to confirm that records are transferred and represented as expected in the reporting layer. **The Source to Mart Record Count Validation Guide covers the following mart categories**: - Bounce marts for **Incident Management** (IM) and **Service Request** (SR). - Approval action detail marts for **Incident Management** (IM), **Change Management** (CM), and **Service Request** (SR). - Manual escalation marts for **Incident Management** (IM) and **Service Request** (SR). - Custom attribute marts for **Administration** (ADM), **Change Management** (CM), **CMDB**, **Incident Management** (IM), **Knowledge Management** (KM), **Problem Management** (PM), **Service Request** (SR), and **Asset Management** (AM). - Hierarchy validation considerations, including orphan records and root-node parent values. ## 2. Audience This **Source to Mart Record Count Validation Guide**is intended for Operations, DevOps, Implementation, and Support teams responsible for investigating reporting data discrepancies and validating source-to-mart record counts. ## 3. User roles and responsibilities | **Role** | **Responsibility** | | --- | --- | | Operations / Support | Run the applicable validation queries, compare source and mart counts, capture results, and perform the initial checks described in this guide. | | DevOps / Engineering | Investigate confirmed data discrepancies, review mart processing and mapping behavior, and resolve defects when the validation evidence indicates a product or pipeline issue. | | Implementation | Assist with customer-environment access and coordinate validation when source-to-mart reconciliation is required. | ## 4. Benefits - Provides a repeatable method for reconciling source and mart record counts. - Helps identify missing, duplicate, inactive, or orphaned records. - Separates source-system checks from reporting-mart checks. - Provides module-specific SQL references for common reporting marts. - Helps teams collect validation evidence before escalating a suspected defect. ## 5. How source-to-mart validation works Source-to-mart validation compares a count from the application source tables with a count from the corresponding reporting mart table. The source query applies the business and mapping conditions required for the mart. The mart query counts the active records available for reporting. 1. Identify the module and mart table that requires validation. 2. Run the source query in the execution environment specified for that validation. 3. Run the corresponding mart count query. 4. Compare the results and record the query, environment, execution time, and counts. 5. If the counts differ, review the applicable notes in this guide before raising a defect. **Important:** A source count and mart count are comparable only when the source query applies the same eligibility rules used by the mart. Do not remove joins, filters, mapping conditions, or active-record conditions when performing the comparison. ## 6. Prerequisites and execution guidelines - Confirm the customer environment, module, and exact mart table being investigated. - Use an account with permission to access the required source database or Reporting SQL Lab. - Use the correct query execution location. The custom-attribute source queries are intended for the customer SQL Server instance. Approval and escalation source queries identified below must be checked in Reporting SQL Lab only. - Retain the query output and note the source and mart counts for the same environment and validation window. - Apply the active-record filter shown in the mart query where specified. - Do not assume that configuration or mapping tables must contain records whenever a mart contains records; follow the specific escalation guidance in this document. **Query handling:** The SQL below is transcribed from the supplied internal references and formatted for readability. Validate object names and syntax against the target environment before execution. Do not change business filters or joins merely to make counts match. ## 7. Bounce mart validation Bounce mart validation compares the distinct ticket count in the source elapsed-time-by-workgroup table with the active record count in the corresponding bounce mart. ### 7.1 Incident Management (IM) ```sql Source query: SELECT COUNT(DISTINCT ticketid) FROM im_elapsedtimebyworkgroup WHERE ticketid IS NOT NULL; Mart query: SELECT COUNT(1) FROM mart_im_workgroup_bounce_details WHERE COALESCE(is_record_active, TRUE) = TRUE; ``` ### 7.2 Service Request (SR) ```sql Source query: SELECT COUNT(DISTINCT ticketid) FROM sr_elapsedtimebyworkgroup WHERE ticketid IS NOT NULL; Mart query: SELECT COUNT(1) FROM mart_sr_workgroup_bounce_details WHERE COALESCE(is_record_active, TRUE) = TRUE; Validation note: A Level = 1 mapping must exist for bounce mart validation. ``` ## 8. Approval mart validation Approval mart validation compares source approval records at levels configured in the dynamic column mapping table with active records in the approval action detail mart. **Execution restriction:** Run the following approval source queries in Reporting SQL Lab only. ### 8.1 Incident Management (IM) approval ```sql Source query: SELECT COUNT(DISTINCT a.ticket_id) FROM im_incidentapproval a WHERE a.ticket_id IS NOT NULL  AND CAST(a.approvallevel AS STRING) IN (      SELECT DISTINCT CAST(level AS STRING)      FROM mapper_dynamiccolumn_table      WHERE LOWER(mart_table) = 'mart_im_approval_action_details'        AND level IS NOT NULL  ); Mart query: SELECT COUNT(1) FROM mart_im_approval_action_details WHERE COALESCE(is_record_active, TRUE) = TRUE; ``` ### 8.2 Change Management (CM) approval ```sql Source query: SELECT COUNT(DISTINCT a.cr_id) FROM cm_cr_approvals a WHERE a.cr_id IS NOT NULL  AND CAST(a.approvallevel AS STRING) IN (      SELECT DISTINCT CAST(level AS STRING)      FROM mapper_dynamiccolumn_table      WHERE LOWER(mart_table) = 'mart_cm_approval_action_details'        AND level IS NOT NULL  ); Mart query: SELECT COUNT(1) FROM mart_cm_approval_action_details WHERE COALESCE(is_record_active, TRUE) = TRUE; ``` ### 8.3 Service Request (SR) approval ```sql Source query: SELECT COUNT(DISTINCT a.serviceticketid) FROM sr_serviceticketapproval a WHERE a.serviceticketid IS NOT NULL  AND CAST(a.approvallevel AS VARCHAR) IN (      SELECT DISTINCT CAST(level AS VARCHAR)      FROM mapper_dynamiccolumn_table      WHERE LOWER(mart_table) = 'mart_sr_approval_action_details'        AND level IS NOT NULL  ); Mart query: SELECT COUNT(1) FROM mart_sr_approval_action_details WHERE COALESCE(is_record_active, TRUE) = TRUE; Validation note: The source query includes only approval levels configured for the corresponding mart in mapper_dynamiccolumn_table. Validate the mapper entry and level values if the counts differ. ``` ## 9. Escalation mart validation Escalation mart validation compares source tickets that meet the manual escalation conditions with active records in the corresponding manual escalation mart. **Important:** For both IM and SR escalation marts, the mart can contain records based on ticket_id even when the escalation-level or escalation-matrix tables contain no data. Do not expect the escalation configuration tables to always contain records whenever mart records exist. Base validation primarily on the source ticket records and the conditions in the supplied query. **Execution restriction:** Run the following escalation source queries in Reporting SQL Lab only. ### 9.1 Incident Management (IM) escalation ```sql Source query: SELECT COUNT(DISTINCT t.ticket_id) FROM im_ticketmaster t JOIN im_manualescalation_levels l  ON l.escalation_level_id = t.manualescalationlevelid JOIN im_manualescalation_matrix m  ON m.escalation_id = l.escalation_id WHERE IFNULL(t.manualescalationlevelid, 0) > 0  AND IFNULL(m.escalation_levels, 0) > 0  AND IFNULL(m.active, 0) = 1; Mart query: SELECT COUNT(1) FROM mart_im_manual_escalation_records WHERE COALESCE(is_record_active, TRUE) = TRUE; ``` ### 9.2 Service Request (SR) escalation ```sql Source query: SELECT COUNT(DISTINCT t.ticket_id) FROM sr_master t JOIN sr_manualescalation_levels l  ON l.escalation_level_id = t.manualescalationlevelid JOIN sr_manualescalation_matrix m  ON m.escalation_id = l.escalation_id WHERE IFNULL(t.manualescalationlevelid, 0) > 0  AND IFNULL(m.escalation_levels, 0) > 0  AND IFNULL(m.active, 0) = 1; Mart query: SELECT COUNT(1) FROM mart_sr_manual_escalation_records WHERE COALESCE(is_record_active, TRUE) = TRUE; ``` ## 10. Custom attributes mart validation Use the following queries to reconcile record counts between source custom-attribute tables and their corresponding custom-attribute mart tables. **Execution restriction:** The source SELECT statements in this section are intended to run only on the customer's SQL Server instance. The mart count statements are run against the reporting mart environment. The supplied reference also provides Reporting SQL Lab variants for IM and SR catalog custom attributes; use those variants when validating through Reporting SQL Lab. **Scope:** The source queries select single-valued custom attributes by applying the relevant IsMultivalued = 0 or equivalent false condition. Asset Management queries also apply active-record conditions and include duplicate checks where provided. ### 10.1 Administration (ADM) customer custom attributes ```sql Source query: SELECT COUNT(1) FROM adm_customerattributes_details ad WITH (NOLOCK) INNER JOIN adm_customer_attributes a WITH (NOLOCK)  ON a.adm_ctmattribute_id = ad.attributeid INNER JOIN adm_customer_attributegroups b WITH (NOLOCK)  ON a.adm_ctmgroup_id = b.adm_ctmgroup_id INNER JOIN common_master c WITH (NOLOCK)  ON a.adm_ctmattribute_displaymode = c.cm_id INNER JOIN adm_customtabs ac WITH (NOLOCK)  ON ac.uid = b.adm_ctmgroup_id WHERE ISNULL(b.IsMultivalued, 0) = 0; Mart query: SELECT COUNT(1) FROM mart_adm_customer_customercustomattributes_sv; ``` **Note**: The query statement should be run only on SQL Server/Report Builder/web services customer instance. ### 10.2 Administration (ADM) user custom attributes ```sql Source query: SELECT COUNT(1) FROM adm_customattributes_details ad WITH (NOLOCK) INNER JOIN adm_custom_attributes a WITH (NOLOCK)  ON a.adm_ctmattribute_id = ad.attributeid INNER JOIN adm_custom_attributegroups b WITH (NOLOCK)  ON a.adm_ctmgroup_id = b.adm_ctmgroup_id INNER JOIN common_master c WITH (NOLOCK)  ON a.adm_ctmattribute_displaymode = c.cm_id INNER JOIN adm_customtabs ac WITH (NOLOCK)  ON ac.uid = b.adm_ctmgroup_id WHERE ISNULL(b.IsMultivalued, 0) = 0; Mart query: SELECT COUNT(1) FROM mart_adm_user_usercustomattributes_sv; ``` **Note**: The query statement should be run only on SQL Server/Report Builder/web services customer instance. ### 10.3 Change Management (CM) custom attributes ```sql Source query: SELECT COUNT(1) FROM cm_customattributes_details ad WITH (NOLOCK) INNER JOIN dbo.cm_custom_attributes c WITH (NOLOCK)  ON c.cm_ctmattribute_id = ad.attributeid INNER JOIN dbo.cm_custom_attributegroups b WITH (NOLOCK)  ON c.cm_ctmgroup_id = b.cm_ctmgroup_id WHERE ISNULL(b.IsMultivalued, 0) = 0; Reporting SQL Lab select count(1) from cm_customattributes_details ad inner join cm_custom_attributes c on c.cm_ctmattribute_id = ad.attributeid inner join cm_custom_attributegroups b on c.cm_ctmgroup_id = b.cm_ctmgroup_id where lower(ifnull(b.ismultivalued,'false')) = 'false' Mart query: SELECT COUNT(1) FROM mart_cm_customattributes_sv; ``` ### 10.4 CMDB custom attributes ```sql Source query: SELECT COUNT(1) FROM cmdb_customattributes_details ad WITH (NOLOCK) INNER JOIN dbo.cmdb_custom_attributes a WITH (NOLOCK)  ON a.cmdb_ctmattribute_id = ad.attributeid INNER JOIN dbo.cmdb_custom_attributegroups b WITH (NOLOCK)  ON b.cmdb_ctmgroup_id = a.cmdb_ctmgroup_id INNER JOIN dbo.cmdb_classification_master c WITH (NOLOCK)  ON b.classification_id = c.classification_id LEFT OUTER JOIN dbo.common_master cm WITH (NOLOCK)  ON cm.cm_id = a.cmdb_ctmattribute_displaymode WHERE cm.cm_value IN ('textbox', 'dropdownlist', 'textarea', 'date', 'checkbox',  'fileupload', 'formula', 'datetime', 'usersearchbox',  'checkboxlist', 'radiobuttonlist', 'autofill')  AND ISNULL(b.IsMultivalued, 0) = 0; Reporting SQL Lab select count(1) from cmdb_customattributes_details ad inner join cmdb_custom_attributes a on a.cmdb_ctmattribute_id = ad.attributeid inner join cmdb_custom_attributegroups b on b.cmdb_ctmgroup_id = a.cmdb_ctmgroup_id inner join cmdb_classification_master c on b.classification_id = c.classification_id left outer join common_master cm on cm.cm_id = a.cmdb_ctmattribute_dispalymode where lower(cm.cm_value) in ('textbox','dropdownlist','textarea','date','checkbox','fileupload','formula','datetime','usersearchbox','checkboxlist','radiobuttonlist','autofill') and lower(ifnull(b.ismultivalued,'false')) = 'false' Mart query: SELECT COUNT(1) FROM mart_cmdb_customattributes_sv; ``` ### 10.5 Incident Management (IM) custom attributes ```sql Source query for the customer SQL Server instance: SELECT COUNT(1) FROM im_customattributes_details ad WITH (NOLOCK) INNER JOIN IM_Custom_Attributes a WITH (NOLOCK)  ON a.IM_CtmAttribute_ID = ad.attributeid INNER JOIN IM_Custom_AttributeGroups b WITH (NOLOCK)  ON a.IM_CtmGroup_ID = b.IM_CtmGroup_ID INNER JOIN common_master c WITH (NOLOCK)  ON a.IM_CtmAttribute_DisplayMode = c.CM_ID WHERE c.CM_Value IN ('TextBox', 'DropdownList', 'TextArea', 'Date', 'CheckBox',  'FileUpload', 'Formula', 'DateTime', 'UserSearchBox',  'CheckBoxList', 'RadioButtonList', 'Autofill')  AND ISNULL(b.IsMultivalued, 0) = 0; Source query for Reporting SQL Lab: SELECT COUNT(1) FROM im_customattributes_details ad INNER JOIN im_custom_attributes a  ON a.im_ctmattribute_id = ad.attributeid INNER JOIN im_custom_attributegroups b  ON a.im_ctmgroup_id = b.im_ctmgroup_id INNER JOIN common_master c  ON a.im_ctmattribute_displaymode = c.cm_id WHERE LOWER(c.cm_value) IN ('textbox', 'dropdownlist', 'textarea', 'date', 'checkbox',  'fileupload', 'formula', 'datetime', 'usersearchbox',  'checkboxlist', 'radiobuttonlist', 'autofill')  AND LOWER(IFNULL(b.ismultivalued, 'false')) = 'false'; Mart query: SELECT COUNT(1) FROM mart_im_customattributes_sv; ``` ### 10.6 Knowledge Management (KM) custom attributes ```sql Source query: SELECT COUNT(1) FROM km_customattributes_details ad WITH (NOLOCK) INNER JOIN dbo.KM_Custom_Attributes a WITH (NOLOCK)  ON ad.attributeid = a.KM_CtmAttribute_ID INNER JOIN dbo.KM_Custom_AttributeGroups b WITH (NOLOCK)  ON a.KM_CtmGroup_ID = b.GroupID INNER JOIN dbo.ADM_CustomTabs d WITH (NOLOCK)  ON d.UID = b.TabID AND d.Module = 'KM' INNER JOIN dbo.common_Master c WITH (NOLOCK)  ON a.KM_CtmAttribute_DisplayMode = c.CM_ID WHERE c.CM_Value IN ('TextBox', 'DropdownList', 'TextArea', 'Date', 'CheckBox',  'FileUpload', 'Formula', 'DateTime', 'UserSearchBox',  'CheckBoxList', 'RadioButtonList', 'Autofill')  AND ISNULL(b.IsMultivalued, 0) = 0; REPORTING SQL LAB select count(1) from km_customattributes_details ad inner join km_custom_attributes a on ad.attributeid = a.km_ctmattribute_id inner join km_custom_attributegroups b  on a.km_ctmgroup_id = b.groupid inner join adm_customtabs d on d.uid = b.tabid and lower(d.module)='km' inner join common_master c on a.km_ctmattribute_dispalymode = c.cm_id where lower(c.cm_value) in ('textbox','dropdownlist','textarea','date','checkbox','fileupload','formula', 'datetime','usersearchbox','checkboxlist','radiobuttonlist','autofill') and lower(ifnull(b.ismultivalued,'false')) = 'false' Mart query: SELECT COUNT(1) FROM mart_km_customattributes_sv; ``` ### 10.7 Problem Management (PM) custom attributes ```sql Source query: SELECT COUNT(1) FROM pm_customattributes_details ad WITH (NOLOCK) INNER JOIN PM_Custom_Attributes a WITH (NOLOCK)  ON a.PM_CtmAttribute_ID = ad.attributeid INNER JOIN PM_Custom_AttributeGroups b WITH (NOLOCK)  ON a.PM_CtmGroup_ID = b.PM_CtmGroup_ID INNER JOIN common_master c WITH (NOLOCK)  ON a.PM_CtmAttribute_DisplayMode = c.CM_ID LEFT OUTER JOIN Summit_Formbuilder_OptionTypes d WITH (NOLOCK)  ON d.UID = a.PM_CtmAttribute_DDTypeID LEFT OUTER JOIN Summit_Formbuilder_OptionSubTypes e WITH (NOLOCK)  ON CAST(e.UID AS NVARCHAR(50)) = a.PM_CtmAttribute_DDSubTypeID WHERE c.CM_Value IN ('TextBox', 'DropdownList', 'TextArea', 'Date', 'CheckBox',  'FileUpload', 'Formula', 'DateTime', 'UserSearchBox',  'CheckBoxList', 'RadioButtonList', 'Autofill')  AND ISNULL(b.IsMultivalued, 0) = 0; REPORTING SQL LAB select count(1) from pm_customattributes_details ad inner join pm_custom_attributes a on a.pm_ctmattribute_id = ad.attributeid inner join pm_custom_attributegroups b  on a.pm_ctmgroup_id = b.pm_ctmgroup_id inner join common_master c  on a.pm_ctmattribute_dispalymode = c.cm_id   where lower(c.cm_value) in ('textbox','dropdownlist','textarea','date','checkbox','fileupload','formula', 'datetime','usersearchbox','checkboxlist','radiobuttonlist','autofill') and lower(ifnull(b.ismultivalued,'false')) = 'false' Mart query: SELECT COUNT(1) FROM mart_pm_customattributes_sv; ``` ### 10.8 Service Request (SR) catalog custom attributes ```sql Source query for the customer SQL Server instance: SELECT COUNT(1) FROM sr_serviceticket_details ad WITH (NOLOCK) INNER JOIN dbo.SR_ServiceCatalogAttributes a WITH (NOLOCK)  ON a.SR_CtAttribute_ID = ad.attribute_id INNER JOIN dbo.SR_ServiceCatalog b WITH (NOLOCK)  ON a.SR_Catalog_ID = b.CatalogID INNER JOIN dbo.SR_ServiceCategory c WITH (NOLOCK)  ON b.CategoryID = c.CategoryID INNER JOIN dbo.SR_ServiceCatalog_CustomAttributeGroup g WITH (NOLOCK)  ON g.UID = a.Group_ID LEFT JOIN dbo.common_master cm WITH (NOLOCK)  ON cm.cm_type = 'Control' AND cm.CM_ID = a.SR_CtAttribute_DisplayMode WHERE cm.CM_Value IN ('TextBox', 'DropdownList', 'TextArea', 'Date', 'CheckBox',  'FileUpload', 'Formula', 'DateTime', 'UserSearchBox',  'CheckBoxList', 'RadioButtonList', 'Autofill')  AND ISNULL(g.IsMultivalued, 0) = 0; Source query for Reporting SQL Lab: SELECT COUNT(1) FROM sr_serviceticket_details ad INNER JOIN sr_servicecatalogattributes a  ON a.sr_ctattribute_id = ad.attribute_id INNER JOIN sr_servicecatalog b  ON a.sr_catalog_id = b.catalogid INNER JOIN sr_servicecategory c  ON b.categoryid = c.categoryid INNER JOIN sr_servicecatalog_customattributegroup g  ON g.uid = a.group_id LEFT JOIN common_master cm  ON LOWER(cm.cm_type) = 'control' AND cm.cm_id = a.sr_ctattribute_displaymode WHERE LOWER(cm.cm_value) IN ('textbox', 'dropdownlist', 'textarea', 'date', 'checkbox',  'fileupload', 'formula', 'datetime', 'usersearchbox',  'checkboxlist', 'radiobuttonlist', 'autofill')  AND LOWER(IFNULL(g.ismultivalued, 'false')) = 'false'; Mart query: SELECT COUNT(1) FROM mart_sr_catalogcustomattributes_sv; ``` ### 10.9 Service Request (SR) custom attributes ```sql Source query: SELECT COUNT(1) FROM sr_customattributes_details ad WITH (NOLOCK) INNER JOIN dbo.SR_Custom_Attributes a WITH (NOLOCK)  ON a.IM_CtmAttribute_ID = ad.AttributeID INNER JOIN dbo.SR_Custom_AttributeGroups b WITH (NOLOCK)  ON a.IM_CtmGroup_ID = b.IM_CtmGroup_ID LEFT OUTER JOIN dbo.Common_Master c WITH (NOLOCK)  ON c.CM_ID = a.IM_CtmAttribute_DisplayMode WHERE c.CM_Value IN ('TextBox', 'DropdownList', 'TextArea', 'Date', 'CheckBox',  'FileUpload', 'Formula', 'DateTime', 'UserSearchBox',  'CheckBoxList', 'RadioButtonList', 'Autofill')  AND ISNULL(b.IsMultivalued, 0) = 0; REPORTING SQL LAB select count(1) from sr_customattributes_details ad inner join sr_custom_attributes a on a.im_ctmattribute_id = ad.attributeid inner join sr_custom_attributegroups b on a.im_ctmgroup_id = b.im_ctmgroup_id   left outer join common_master c on c.cm_id = a.im_ctmattribute_dispalymode   where lower(c.cm_value) in ('textbox','dropdownlist','textarea','date','checkbox','fileupload','formula', 'datetime','usersearchbox','checkboxlist','radiobuttonlist','autofill') and lower(ifnull(b.ismultivalued,'false')) = 'false' Mart query: SELECT COUNT(1) FROM mart_sr_customattributes_sv; ``` ### 10.10 Asset Management (AM) custom attributes Run the duplicate check first to identify repeated asset and attribute combinations. ```sql SELECT asset_id, attribute_id, COUNT(1) FROM am_asset_details GROUP BY asset_id, attribute_id HAVING COUNT(1) > 1; Source query: SELECT COUNT(1) FROM am_asset_details ad WITH (NOLOCK) INNER JOIN am_asset_master am WITH (NOLOCK)  ON am.asset_id = ad.asset_id INNER JOIN AM_CategoryAttributes a WITH (NOLOCK)  ON a.AM_CtAttribute_ID = ad.Attribute_ID AND a.AM_Category_ID = am.Category_ID INNER JOIN common_master c WITH (NOLOCK)  ON a.AM_CtAttribute_DisplayMode = c.CM_ID WHERE c.CM_Value IN ('TextBox', 'DropdownList', 'TextArea', 'Date', 'CheckBox',  'FileUpload', 'Formula', 'DateTime', 'UserSearchBox',  'CheckBoxList', 'RadioButtonList', 'Autofill')  AND ISNULL(ad.active, 1) = 1; REPORTING SQL LAB select count(1) from am_asset_details ad inner join am_asset_master am on am.asset_id = ad.asset_id inner join am_categoryattributes a on a.am_ctattribute_id = ad.attribute_id and a.am_category_id = am.category_id inner join common_master c on a.am_ctattribute_dispalymode = c.cm_id where lower(c.cm_value) in ('textbox','dropdownlist','textarea','date','checkbox','fileupload','formula', 'datetime','usersearchbox','checkboxlist','radiobuttonlist','autofill') and LOWER(IFNULL(ad.active,'true')) = 'true' Mart query: SELECT COUNT(1) FROM mart_am_customattributes_sv; ``` ### 10.11 Asset Management (AM) non-financial custom attributes **Run the duplicate check first**: ```plaintext SELECT asset_id, attribute_id, COUNT(1) FROM am_nf_asset_details GROUP BY asset_id, attribute_id HAVING COUNT(1) > 1; Source query: SELECT COUNT(1) FROM am_nf_asset_details ad WITH (NOLOCK) INNER JOIN am_nf_asset_master am WITH (NOLOCK)  ON am.asset_id = ad.asset_id INNER JOIN AM_CategoryAttributes a WITH (NOLOCK)  ON a.AM_CtAttribute_ID = ad.Attribute_ID AND a.AM_Category_ID = am.Category_ID INNER JOIN common_master c WITH (NOLOCK)  ON a.AM_CtAttribute_DisplayMode = c.CM_ID WHERE c.CM_Value IN ('TextBox', 'DropdownList', 'TextArea', 'Date', 'CheckBox',  'FileUpload', 'Formula', 'DateTime', 'UserSearchBox',  'CheckBoxList', 'RadioButtonList', 'Autofill')  AND ISNULL(ad.active, 1) = 1; REPORTING SQL LAB select count(1) from am_nf_asset_details ad inner join am_nf_asset_master am on am.asset_id = ad.asset_id inner join am_categoryattributes a on a.am_ctattribute_id = ad.attribute_id and a.am_category_id = am.category_id inner join common_master c  on a.am_ctattribute_dispalymode = c.cm_id where lower(c.cm_value) in ('textbox','dropdownlist','textarea','date','checkbox','fileupload','formula', 'datetime','usersearchbox','checkboxlist','radiobuttonlist','autofill') and LOWER(IFNULL(ad.active,'true')) = 'true' Mart query: SELECT COUNT(1) FROM mart_am_nf_customattributes_sv; ``` ### 10.12 Asset allocation custom attributes ```sql Source query: SELECT COUNT(1) FROM am_allocation_asset_details ad WITH (NOLOCK) INNER JOIN am_asset_master am WITH (NOLOCK)  ON am.asset_id = ad.asset_id INNER JOIN AM_CategoryAttributes a WITH (NOLOCK)  ON a.AM_CtAttribute_ID = ad.Attribute_ID AND a.AM_Category_ID = am.Category_ID INNER JOIN common_master c WITH (NOLOCK)  ON a.AM_CtAttribute_DisplayMode = c.CM_ID WHERE c.CM_Value IN ('TextBox', 'DropdownList', 'TextArea', 'Date', 'CheckBox',  'FileUpload', 'Formula', 'DateTime', 'UserSearchBox',  'CheckBoxList', 'RadioButtonList', 'Autofill')  AND ISNULL(ad.active, 1) = 1; REPORTING SQL LAB select count(1) from am_allocation_asset_details ad inner join am_asset_master am on am.asset_id = ad.asset_id inner join am_categoryattributes a on a.am_ctattribute_id = ad.attribute_id and a.am_category_id = am.category_id inner join common_master c  on a.am_ctattribute_dispalymode = c.cm_id where lower(c.cm_value) in ('textbox','dropdownlist','textarea','date','checkbox','fileupload','formula', 'datetime','usersearchbox','checkboxlist','radiobuttonlist','autofill') and LOWER(IFNULL(ad.active,'true')) = 'true' Mart query: SELECT COUNT(1) FROM mart_am_allocation_customattributes_sv; ``` ### 10.13 Asset transaction custom attributes ```sql Source query: SELECT COUNT(1) FROM am_mc_asset_transaction_details ad WITH (NOLOCK) INNER JOIN am_mc_asset_transaction_master am WITH (NOLOCK)  ON am.transaction_id = ad.guid INNER JOIN AM_CategoryAttributes a WITH (NOLOCK)  ON a.AM_CtAttribute_ID = ad.Attribute_ID AND a.AM_Category_ID = am.Category_ID INNER JOIN common_master c WITH (NOLOCK)  ON a.AM_CtAttribute_DisplayMode = c.CM_ID WHERE c.CM_Value IN ('TextBox', 'DropdownList', 'TextArea', 'Date', 'CheckBox',  'FileUpload', 'Formula', 'DateTime', 'UserSearchBox',  'CheckBoxList', 'RadioButtonList', 'Autofill')  AND ISNULL(ad.Active, 1) = 1; REPORTING SQL LAB select count(1) from am_mc_asset_transaction_details ad inner join am_mc_asset_transaction_master am on am.transaction_id = ad.guid inner join am_categoryattributes a on a.am_ctattribute_id = ad.attribute_id and a.am_category_id = am.category_id inner join common_master c  on a.am_ctattribute_dispalymode = c.cm_id where lower(c.cm_value) in ('textbox','dropdownlist','textarea','date','checkbox','fileupload','formula', 'datetime','usersearchbox','checkboxlist','radiobuttonlist','autofill') and LOWER(IFNULL(ad.active,'true')) = 'true' Mart query: SELECT COUNT(1) FROM mart_am_mc_asset_transaction_customattributes_sv; Duplicate check: SELECT ad.uid, COUNT(1) FROM am_mc_asset_transaction_details ad WITH (NOLOCK) INNER JOIN am_mc_asset_transaction_master am WITH (NOLOCK)  ON am.transaction_id = ad.guid INNER JOIN AM_CategoryAttributes a WITH (NOLOCK)  ON a.AM_CtAttribute_ID = ad.Attribute_ID AND a.AM_Category_ID = am.Category_ID INNER JOIN common_master c WITH (NOLOCK)  ON a.AM_CtAttribute_DisplayMode = c.CM_ID WHERE c.CM_Value IN ('TextBox', 'DropdownList', 'TextArea', 'Date', 'CheckBox',  'FileUpload', 'Formula', 'DateTime', 'UserSearchBox',  'CheckBoxList', 'RadioButtonList', 'Autofill')  AND ISNULL(ad.Active, 1) = 1 GROUP BY ad.uid HAVING COUNT(1) > 1; ``` ## 11. Hierarchy validation considerations The source reference identifies the following checks for hierarchy-related data: - Check for orphan hierarchy records when source and mart counts do not reconcile. - Validate that the required hierarchy mapping exists before escalating a discrepancy. - Root nodes should use NULL parent values. **Scope note:** The supplied PDF mentions these hierarchy checks but does not provide a dedicated hierarchy source-to-mart SQL query. Do not infer or create a hierarchy query from this guide; obtain the approved query from the responsible engineering team. ## 12. Validation checklist and escalation 1. Confirm the customer environment and the mart table under investigation. 2. Select the matching source and mart queries from this guide. 3. Confirm the query execution location before running the source query. 4. Run the source query and record the result. 5. Run the mart query and record the result. 6. Confirm that the applicable active-record, single-value, mapping, and escalation conditions are included. 7. Check the module-specific notes, including bounce Level = 1 mapping, approval mapper levels, escalation configuration behavior, and hierarchy checks. 8. If counts still differ, capture the executed SQL, source count, mart count, environment, timestamp, and relevant mapping or duplicate-check results before escalating. ## 13. Important notes - Apply COALESCE(is_record_active, TRUE) = TRUE when the supplied mart validation query specifies it. - Validate approval levels against mapper_dynamiccolumn_table for the corresponding mart_table. - Bounce mart validation requires a Level = 1 mapping. - For IM and SR escalation marts, mart records may exist even if escalation-level or escalation-matrix tables contain no data; validate primarily against eligible source ticket records. - Check for orphan hierarchy records. - Root hierarchy nodes should use NULL parent values. - Validate mapper levels before raising defects. - Custom-attribute source SELECT queries are intended for the customer SQL Server instance. Approval and escalation source queries are identified for Reporting SQL Lab only. The IM and SR catalog custom-attribute sections also provide Reporting SQL Lab query variants. - Do not expose customer data or credentials when sharing validation evidence.