How to pass each row as an argument to R script from Tableau calculated field -


i trying sentiment analysis on table have.

i want each row of string data passed r script, problem tableau accepting aggregate data params for:

script_str(   'output <- .arg1; output', [comments] ) 

this gives me error message:

# fields must aggregate or constant. 

from tableau , r integration documentation:

given script_*() functions work table calculations, require aggregate measures or tableau parameters work properly. aggregate measures include min(), max(), attr(), sum(), median(), , table calculations or r measures. if want use specific non-aggregated dimension, needs wrapped in aggregate function.

in case do:

script_str(   'output <- .arg1; output', attr([comments]) ) 

attr() special tableau aggregate following:

if min([dimension]) = max([dimension])  [dimension] else * (a special version of null) end 

it’s useful when building visualizations , you’re not sure of level of detail of data , what’s being sent

note: can slower min() or max() in large data sets, once confident results accurate can switch 1 of other functions performance.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -