Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.
Free Trial

Alteryx Designer Desktop Discussions

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

How to use sys.date() function in R tool?

sam2
5 - Atom

I am using R tool inside Alteryx and want to populate certain rows with today's date. It is giving me error that it could not find that function. I also tried to use DateTimeToday() inside R but it also shows error. I don't want to use formula tool to add today's date and want to achieve the same inside R. Could someone help me out here?

2 REPLIES 2
SydneyF
Alteryx Alumni (Retired)

Hi @sam2

 

I was able to use the R Sys.Date() function in the R Tool, appending the current date to a new column in a data frame with the following code.

 

##read in data frame
data <- read.Alteryx('#1')

##append new column with today's date
data$date <- Sys.Date()

##write out data frame
write.Alteryx(data, 1)

I've also attached the workflow. Can you please share the error you are getting, along with your code? I would be happy to help you troubleshoot.

 

Thanks!

 

 

sam2
5 - Atom

Hi @SydneyF

 

It turns out that Alteryx is case sensitive. I was using "sys.date()" instead of "Sys.Date()". Thank you for your help on this.

 

Sam

Labels
Top Solution Authors