Forum Discussion
Query Editor R Script errors
- 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
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
Hello v-yulgu-msft,
I used that code and thankfully it does not return the same error as before. However, it seems to result in PowerBI outputting an empty table. In fact, I have tried a few other lines of code in R script and the result seems to always be a blank table with only empty columns for 'name' and 'value'. Any idea why this is happening?