Pass Variable to RsiteCatalyst

Hi ,
I am new to R and trying to pass a variable to QueueTrended() to pull data from Adobe and i am getting this error:
Error in ApiRequest(body = report.description, func.name = "Report.Validate") : ERROR: date_invalid - "startdtvar" is not a valid date.
Here is the code
#create variable

startdtVar=paste0("select start_dt from p_ent.fiscal_week f
where f.week_nbr in ( select week_nbr
from p_ent.DAY_CALENDAR c3
where c3.date_dt = date-2)" )
#sqlQuery(channel, startdtVar)
startdtVar=gsub("[\r\n]", " ", startdtVar)
startdtVar=sqlQuery(channel, startdtVar)

EnddtVar=paste0("select end_dt from p_ent.fiscal_week f
where f.week_nbr in ( select week_nbr
from p_ent.DAY_CALENDAR c3
where c3.date_dt = date-2)" )

EnddtVar<-gsub("[\n]", " ", EnddtVar)
EnddtVar=sqlQuery(channel, EnddtVar)

#Pull data from adobe
RSiteCatalyst::SCAuth(legacyauth,sharedsecret,company= companyn)
report_suites <- RSiteCatalyst::GetReportSuites()

Saving <- QueueTrended(reportsuiteid,
date.from="startdate",
date.to="enddate",
c(metric2),c(platform),
start=1,date.granularity = "week"
#segment.id = segmentid2
)

Thank you,
Mattie

Hi Mattie, welcome!

To help us help you, could you please turn this into a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.