Forum Discussion
jkraush1
9 years agoFrequent Visitor
Query Editor R Script errors
I uploaded a .xlsx file into Power BI desktop and tried to run a simple R script on it in query editor as a test run. Specifically the script I ran was: # 'dataset' holds the input data for this ...
- 9 years ago
Hi jkraush1,
I got the same error when using above script. In my test, the Date column is set to DateTime, formatted as "1/1/2017 5:20:20AM".
Please try below code.
Hour=format(as.POSIXct(dataset$Date, format="%Y-%m-%d %H:%M:%S"), format="%H")
Regards,
Yuliana Gu
jkraush1
9 years agoFrequent Visitor
For clarification that line was all the code I had written in the script.