# is\_incremental not triggering upstream from incremental model

**URL:** <https://discourse.getdbt.com/t/is-incremental-not-triggering-upstream-from-incremental-model/13652>\
**Category:** Help\
**Tags:** incremental\
**Created:** [June 4, 2024, 5:10am UTC](https://discourse.getdbt.com/t/is-incremental-not-triggering-upstream-from-incremental-model/13652 "2024-06-04T05:10:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![richard](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@richard](https://discourse.getdbt.com/u/richard)\
**Post date:** [June 4, 2024, 5:10am UTC](https://discourse.getdbt.com/t/is-incremental-not-triggering-upstream-from-incremental-model/13652/1 "2024-06-04T05:10:28Z")

</div>

Hello everyone,  
I’m new to this forum. I took over a relatively complex dbt project where there are a lot of transformations going on.

## The problem I’m having

I set up incremental refresh on the main fact table and I want to do the filtering by timestamp upstream where I load in the raw data. However the macro is\_incremental is not triggering upstream.

## The context of why I’m trying to do this

I"m following the advice on: [Configure incremental models | dbt Developer Hub](https://docs.getdbt.com/docs/build/incremental-models)  
“In some warehouses, filtering your records early can vastly improve the run time of your query!”

## What I’ve already tried

I set the below code in both the incremental model and the upstream model where I want to filter. The Snowflake query history shows that the test comment is only visible for the incremental model but not for the upstream model where I want to to the filtering.  
{% if is\_incremental() %}  
– test is\_incremental  
{% endif %}

Please help. 🙂

Thanks and best regards,  
Richard

---

<div class="post-metadata">

**Author:** ![DataNath](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/datanath/32/4070_2.png) [@DataNath](https://discourse.getdbt.com/u/DataNath)\
**Post date:** [June 4, 2024, 1:33pm UTC](https://discourse.getdbt.com/t/is-incremental-not-triggering-upstream-from-incremental-model/13652/2 "2024-06-04T13:33:57Z")

</div>

Hey @richard, have you made sure to go through the checklist for the macro triggering as true?

- The model must already exist in the database
- The destination table already exists in the database
- The `full-refresh` flag _is not_ passed
- The running model is configured with `materialized='incremental'`

The fact that your upstream model isn’t showing the comment suggests that one of these might not be satisfied. Particularly `materiazlied='incremental'` to override any model settings you might have defined elsewhere in a schema.yml/project.yml file.

---

<div class="post-metadata">

**Author:** ![richard](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@richard](https://discourse.getdbt.com/u/richard)\
**Post date:** [June 5, 2024, 1:56am UTC](https://discourse.getdbt.com/t/is-incremental-not-triggering-upstream-from-incremental-model/13652/3 "2024-06-05T01:56:18Z")

</div>

Hi @DataNath,  
The problem is that checklist item 4 is not fulfilled because I want to do the filtering upstream of the incremental model.

I worked around the issue by using variables:  
{% if var(‘is\_incremental\_custom’, false) %}  
…  
{% endif %}

And then for the incremental refresh runs building the project like this: dbt build --vars ‘{is\_incremental\_custom: true}’

If you have a better solution please let me know.

Thanks and best regards,  
Richard
