1 of 1 people found this helpful
This are the functions available in tableau to integrate R
SCRIPT_BOOL(), SCRIPT_INT(), SCRIPT_REAL(), and SCRIPT_STR() based on the datatype O/P you can use the relevant function.
Coming to your point (Assuming the O/P is integer Before "," use the function and after the "," provide the field which you want to use in x variable
in the function instead of x replace with .arg1
sapply(kp, function ( .arg1 ) stringdist(.arg1,c("Michelin::"),method = "jw")),<Column Name>
Check the below link it will help you:
Hope this helps.
Plz mark this answer as correct and helpful to close the thread.
thank you for your response , do you have please a woorkbook with a example
I install the package "stringdist"
and use the library "library(stringdist)"
m <- stringdistmatrix(c(.arg1),list_brand()$name, method = "jw")
a <- list_brand()$name[apply(m, 1, which.min)]',ATTR([Brand]))
Now i have this error
When i replace arg1 whith static value it's working
Thank you for your help
I figure it out
thank you all for your help
m <- stringdistmatrix(.arg1,list_brand()$name, method = "jw")
a <- list_brand()$name[
tmp <- which.min(X)
; ifelse(length(tmp), tmp, NA)