Description Usage Arguments Value Note See Also Examples
The core parameter replacement function accepting a list of parameter names to replace and replacing all the occurances in x that have @......
1 | updateSQLwithParams(x, dataConfig)
|
x |
A string that represents a query with @paramName to be replaced. |
dataConfig |
The configuration list, where the names represent the parameter and the values are what will be replaced. |
A string that represents an SQL query.
Dates have to use the format that is expected by SQL.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | updateSQLwithParams("select * from @table", list(table = "blah"))
query.txt<-"
select
sum(total_sales_amount) as spend
,transaction_date
from
cedwdm.transaction_product_vw
where
transaction_date > '@start.date'
group by
transaction_date
"
my.query<-updateSQLwithParams(
query.txt
, list(start.date = format(Sys.Date() - 7, "%d-%b-%Y" ))
)
print(my.query)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.