I am trying to do sentiment analysis on a table that I have.
I want each row of string data to be passed to the R script, but the problem is that Tableau is accepting only aggregate data as params for:
SCRIPT_STR(
'output <- .arg1; output', [comments]
)
This gives me an error message:
# All fields must be aggregate or constant.
From the Tableau and R Integration documentation:
In your case you could do:
ATTR()is a special Tableau aggregate that does the following:It’s really useful when building visualizations and you’re not sure of the level of detail of data and what’s being sent
Note: It can be significantly slower than
MIN()orMAX()in large data sets, so once you get confident your results are accurate then you can switch to one of the other functions for performance.