       AND excluded_geo_entities_ids @> taxon_concepts_mview.countries_ids_ary
     )
     THEN FALSE
-    WHEN ARRAY_UPPER(excluded_taxon_concept_ids, 1) IS NOT NULL 
+    WHEN ARRAY_UPPER(excluded_taxon_concept_ids, 1) IS NOT NULL
     -- if taxon or any of its ancestors is excluded from this listing
     AND excluded_taxon_concept_ids && ARRAY[
       affected_taxon_concept_id,

      AND hi.excluded_geo_entities_ids @> taxon_concepts_mview.countries_ids_ary
    )
    THEN FALSE
    WHEN ARRAY_UPPER(hi.excluded_taxon_concept_ids, 1) IS NOT NULL 
    -- if taxon or any of its ancestors is excluded from this listing
    AND hi.excluded_taxon_concept_ids && ARRAY[
      hi.affected_taxon_concept_id,

    ]
    THEN FALSE
    ELSE
    TRUE
    END AS is_applicable
    FROM ' || LOWER(designation_name) || '_all_listing_changes_mview all_listing_changes_mview
    JOIN cites_eu_tmp_taxon_concepts_mview taxon_concepts_mview
    ON all_listing_changes_mview.affected_taxon_concept_id = taxon_concepts_mview.id
    WHERE all_listing_changes_mview.affected_taxon_concept_id = $1
    AND timeline_position = 1

