# Substitute custom variable strings to compile analyses

**URL:** <https://discourse.getdbt.com/t/substitute-custom-variable-strings-to-compile-analyses/9511>\
**Category:** Help\
**Tags:** variables\
**Created:** [August 10, 2023, 3:21pm UTC](https://discourse.getdbt.com/t/substitute-custom-variable-strings-to-compile-analyses/9511 "2023-08-10T15:21:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgroesbeck](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@pgroesbeck](https://discourse.getdbt.com/u/pgroesbeck)\
**Post date:** [August 10, 2023, 3:21pm UTC](https://discourse.getdbt.com/t/substitute-custom-variable-strings-to-compile-analyses/9511/1 "2023-08-10T15:21:17Z")

</div>

## The problem I’m having

I need to compile a set of analysis that substitute variables with strings of text that are proprietary to a vendor. For example I have a variable field called “client” with a value like “walmart” which I need to substitute with “&:client”. Due to query introspection I will get errors when I try and substitute an unrecognized string:

[https://docs.getdbt.com/faqs/warehouse/db-connection-dbt-compile](https://docs.getdbt.com/faqs/warehouse/db-connection-dbt-compile)

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

The proprietary software Matik uses a specific syntax for their own variable substitution. For testing I use a series of normal values however when I want to upload my queries to the vendor software I need to substitute unrecognized values like so:

dbt compile --vars ‘{“start\_date”: “&:start\_date”, “client”: “&:client”}’

## What I’ve already tried

This will fail:

dbt compile --vars ‘{“start\_date”: “&:start\_date”, “client”: “&:client”}’

## Some example code or error messages

```auto
botocore.errorfactory.InvalidRequestException: An error occurred (InvalidRequestException) when calling the StartQueryExecution operation: line 3:106: mismatched input 'year'. Expecting: ')', <expression>, <query>

```

I would ideally like for the query to compile using the variables in my dbt\_project.yml file however use the overrides when outputting the compiled query to the target folder.
