cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Online Help Survey

Help shape the future of Alteryx Technical Documentation by sharing your feedback!

LEARN MORE
Announcement | Looking to expand your Alteryx skillset?! Check out the latest set of interactive lessons in Alteryx Academy: Creating Analytic Apps
SOLVED

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

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?

Highlighted
Alteryx
Alteryx

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!

 

 

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