community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

Radio Button Not Working

Fireball

Hello,

 

I'm trying to use a radio button to update the distribution of my piece wise linear regression macro. I copied the glm tool macro language to pull in the distribution of the glm as such:

is.XDF <- FALSE 
if (!is.XDF) {
if ('%Question.Quasipoisson%' == "True")
the.family <- "quasipoisson(link='log')"
if ('%Question.Gamma%' == "True")
the.family <- "gamma(link='log')"
} else {
the.family <- "quasipoisson(link='log')"
}
# Create a string of the potential predictors seperated by plus signs
the_preds <- paste(names(the_data)[-1], collapse = " + ")
# Get the name of the target field
the_target <- names(the_data)[1]
# Create a formula expression from the names of the target and predictors
the_form <- as.formula(paste(the_target, the_preds, sep = " ~ "))
# Run the model
fit1 <- glm(the_form, "family = " the.family , data = the_data)
#

And I do not have the radio buttons connected to anything (like the count regression tool has it set up):

radio button.JPG

I'm not sure why the code is not working.  The error I get is unexpected symbol in "fit1 <- glm(the_form, "family =" the.family

 

Alteryx Certified Partner

@jbh1128d1

 

If you added those radio button yourself, my guess is that you didn't update the tool name, and not referring to the question to be displayed.

 

Click on the radio button and in the configuration screen, select the "Annotation" icon. Name this to what you'll want to use in your R script.

image.png 

 

This is the value that you'd use in '%Question.<ToolName>%'.

 

Hope this helps!

Fireball

Thank you @jrgo.  Worked like a charm. 

Labels