We have extended our Early Bird Tickets for Inspire 2023! Discounted pricing goes until February 24th. Save your spot!

Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer and Intelligence Suite.

Error when running Dynamic Input - replacement context does not exist in the template

FreeRangeDingo
10 - Fireball
10 - Fireball

I have a workflow that queries finance data.  For data that is 6 months old or younger, I want to get the line item detail.  For data that is older, I don't need that much detail.  To make this work, I am performing 2 queries, and then unioning the data together.  I am using dynamic input to build the query.   

As you can see in my workflow below, I start with a datetime input.  Then, I calculate 6 months backward.  Then I calculate the month end for whatever that date is.  That month end date is what I want to feed into the dynamic input.  

 

workflow.png

HEre is the query used as the template.I have circled the bits that I want to replace.  

query.png

 

 

When, I have only one modification setup here, it works, but the data is wrong because it only modifies one of my where clauses.  When I add in a second modification, I get an error that says the replacement context "2019-10-31" does not exist in the template.  It does exist.  

modify.png

 

Does anyone know why I can't modify both of the where clauses?  Also, I have confirmed that the query used as the template is correct and works.

 

 

4 REPLIES 4
CFGuy
5 - Atom

There are a couple of possible ways to accomplish what you're after. 

 

1. Instead of using the 'Update Where Clause', you could use a 'Replace Specific String' and build the portion of the query you'd like to change (dynamically) ahead of the dynamic input tool.

2. In your particular example below, it looks like you could consolidate your query into a single set of criteria. After which, the dynamic replace as you have it should work fine.

 

Hope this helps!

Analopes2007
6 - Meteoroid

Dear Alteryx Community,

 

This is my query

Analopes2007_0-1659649939292.png

I cannot make this work :-)

Analopes2007_1-1659649996575.png

 

the error is:

Analopes2007_2-1659650046153.png

 

Can you please help?

Thanks :-)

FreeRangeDingo
10 - Fireball
10 - Fireball

It's been a long time, but I believe the solution suggested was correct.  I needed to Replace a Specific String. Have you tried that?

Analopes2007
6 - Meteoroid

Hello,

 

Thanks for supporting me, I cannot use that solution because I'm dynamically replacing a date.

But I've done the selection of the columns in a different way and now it works.

Thanks,

Ana

Labels