diff --git a/definitions/staging/stg_agent_status_history_report.sqlx b/definitions/staging/stg_agent_status_history_report.sqlx index 1b7eed8..da4a4da 100644 --- a/definitions/staging/stg_agent_status_history_report.sqlx +++ b/definitions/staging/stg_agent_status_history_report.sqlx @@ -7,9 +7,9 @@ config { nonNull: ["AGENT_ID", "TIMESTAMP", "STATE"], rowConditions: [ 'STATE_GROUP <> "NOT_MAPPED"', - 'AGENT_ID <> "0" AND AGENT_NAME <> "NOT_MAPPED"', + 'AGENT_ID = "0" or (AGENT_ID <> "0" AND AGENT_NAME <> "NOT_MAPPED")', 'STATE_ID <> 0', - 'REASON_CODE is not null and REASON_CODE_ID <> 0' + 'REASON_CODE is null or (REASON_CODE is not null and REASON_CODE_ID <> 0)' ] }, tags: ["agent_status_report"], diff --git a/definitions/staging/stg_agent_status_report.sqlx b/definitions/staging/stg_agent_status_report.sqlx index 6568b87..9174c56 100644 --- a/definitions/staging/stg_agent_status_report.sqlx +++ b/definitions/staging/stg_agent_status_report.sqlx @@ -7,9 +7,9 @@ config { nonNull: ["AGENT_ID", "TIMESTAMP", "STATE"], rowConditions: [ 'STATE_GROUP <> "NOT_MAPPED"', - 'AGENT_ID <> "0" AND AGENT_NAME <> "NOT_MAPPED"', + 'AGENT_ID = "0" or (AGENT_ID <> "0" AND AGENT_NAME <> "NOT_MAPPED")', 'STATE_ID <> 0', - 'REASON_CODE is not null and REASON_CODE_ID <> 0' + 'REASON_CODE is null or (REASON_CODE is not null and REASON_CODE_ID <> 0)' ] }, tags: ["agent_status_report"],