Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.
An R macro for parsing PDFs with images!
View full article
We were recently approached by a concerned client with "Help! I have a model object in a .yxdb but my computer crashed and I need to document the predictor variables!" This naturally led to a discussion on how we can pull these variables back for the client, and what kind of scenarios would lead to this. The first scenario is the most obvious (the case of the client). The model object was created using Alteryx and was stored in a .yxdb.  During another process, my computer crashed and I lost all of my data! Luckily, I still had the model object in a shared location, but I need to document the variables and the model object looks like this: Unfortunately, this does not give us any information about the data or more importantly, the predictor variables. Luckily, a simple script can break down this model object and fill you in on all of the details.   Within Alteryx, attach an R Tool to your data stream (I am using the Forest Model Object that is created from an Alteryx Sample):   Next, copy and paste the following script into your R Tool code builder: model.data <- read.Alteryx("#1") the.obj <- unserializeObject(as.character(model.data$Object[1])) print(the.obj$call) This script states to take the data coming in from Input #1 and label it "model.data".  Next, unserialize (break down) the data in the field Object (specified by "model.data%Object[1]").  Finally, print the results in the Alteryx Output window.  The final results for this particular object are then printed out, as shown. As you can see, the output clearly states that my predictor variables are Chk_Bal, Duration, Credit_Hist, Purpose, etc.  The end result is quick, clean, and can really help get you out of a jam if you lose your data.
View full article
 Alteryx has a full set of integrated predictive tools but even with developers working at full speed, it is hard to keep up with the R community. Sometimes users want to install and utilize their favorite R packages. This post demonstrates how to use and install additional R packages.
View full article
My code runs in R, but not in the R Tool?
View full article
Errors from the R tool, and macros using R, such as the Association Analysis tool, can be a challenge to troubleshoot.
View full article
  With the release of 10.6 came awesome new features, and an upgrade in the underlying R version (from 3.1.3 code named "Smooth Sidewalk," to 3.2.3 code named "Wooden Christmas-Tree").  Using the incompatible R version will cause errors in your R macros.     Simply make sure that your Predictive Tools download is the version compatible with your Alteryx Designer version:     Users on 10.5 should continue to use the R3.1.3 version.   When using Alteryx and Microsoft Revolution R Enterprise, a separate predictive tools install is required (in green). For details, see the Alteryx and Revolution Analytics Integration Guide.   And remember to use the non-Admin Predictive version with non-Admin versions of Alteryx Designer.   To install Predictive Tools for Alteryx 10.0, go to Previous Releases. For Alteryx 9.5, within Designer, go to Help > Install Predictive Tools.    Happy Alteryx-ing!
View full article
This error is displayed on current workflows with R and then if you put a new R tool on a blank canvas
View full article
How to troubleshoot Predictive Tools or R-Tool missing in Designer
View full article
As a best practice, a data frame should always be defined before using write.Alteryx(). If this step is omitted, data may not be output correctly.
View full article
Error while installing additional R packages in Alteryx Designer - "GenericTool (1): Can't find plugin "AlteryxRPluginEngine.dll""
View full article
This error may occur when using the AlteryxGraph device. The reason for this is that the AlteryxGraph device creates a pipe between Alteryx and R. If creating graphs in a loop, a pipe has to be created for each loop which slows down the processing. As a result, Alteryx ends up trying to create the next graph before the previous one is completed. To avoid this, it is best practice when creating multiple graphs within a loop to keep the AlteryxGraph device statement outside of the loop.
View full article
If you ran across this error: Logistic Regression: Error in searchDir(dbDir, lang) : Logistic Regression: Expecting a single string value: [type=NULL; extent=0] read this article!
View full article
Troubleshooting the Error: The R.exe exit code (n) indicated an error
View full article
Issue   Saving or running the workflow in the Designer causes the following error to occur:   An Unhandled Exception occurred. A previous action may not have completed successfully. Click OK to send the development team the error log so that we can fix this error in a subsequent release.   Environment   Alteryx Designer   Diagnosis    Checking the logs from %PROGAMFILES%\Alteryx\ErrorLogs\AlteryxGUI shows the following error:   Alteryx Designer x64 - 2019.2.5.62427 Type: System.ArgumentException Message: Cannot have ']]>' inside an XML CDATA block. Source: System.Xml OS Version: Microsoft Windows NT 6.2.9200.0 OS Is x64 Capable: True Selected Plugin: LockInGui.LockInSelect.LockInSelect Processor: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz Private Memory: 380923904 -------------------------------------------- at System.Xml.XmlTextWriter.WriteCData(String text) at System.Xml.XmlElement.WriteElementTo(XmlWriter writer, XmlElement e) at System.Xml.XmlElement.WriteContentTo(XmlWriter w)   Cause   The use of "]]>" in the following tools (not an exhaustive list) causes the error: Formula tool Filter tool Report text tool R tool Python tool   Solution   Avoid using "]]>" in the tool or escape the ">" to "&gt;".
View full article
SPSS Output   Overview   When working with SPSS, values can have both a Text label and a numeric representation of the categories (equivalent of string factors in R). Columns can also have an encoded name ex. Q_1 and a longer descriptive name that maps Q_1 to the original question that was asked (closest thing in R is the data frame attribute on the column).   Alteryx reads .sav files and loads either the numeric representation or the textual representation of values based on the user’s selection. It also reads the variable labels into the Alteryx Field Description.  When writing .sav output, Alteryx will write either the text or the numeric values (depending on what was used in the workflow) as well as the SPSS variable labels which were displayed in the description field. However sometimes to maintain the integrity of the whole SPSS file, clients will want the value labels, value levels, and variable labels to appear in the output file. For these cases, using the Alteryx tools and a few lines of R code (while leveraging the thousands of R packages on CRAN) wrapped in a macro gives us the needed functionality. Attached is a macro which will write the data, variable & value labels back into SPSS.     Macro Process In this section, we will explain the R code logic that is specific to this macro. You can get an introduction to writing custom R code in Alteryx here.      Before we can do anything, we will need to pass the data to the tools inside the macro (more details on macros here). The raw numeric data should be connected to the D input of the macro. In addition, and because the data frames created in R don’t contain the Field Description data, we need to pass Field Description values to the M input (M for Metadata) of the macro. We’re using the Field Info Tool to extract the description into the rows and send it to the macro. With that done we can now look inside the macro.   Inside the Macro       Inside the macro, we are using the R Tool to contain the main functionality. We connect it to the Interface tools (Macro Inputs, File Browse, Action Tool) to get the data, metadata, and output file path from the user. Finally, we’re using the API tool to pass a message back to the user in the Alteryx Execution Messages.   The R Tool contains the code to properly format the input data and write it out to the .sav file. The majority of the work is already done for us in the ‘sjmisc' package from CRAN (R users know that most of the time they can find a package that does what they want). This package, among other features, implements reading and writing .sav files with both variable and value labels. We will first check if the package is not already installed and we’ll attempt to install it.   This workflow installs the additional sjmisc package. To avoid package version and dependency issues, it is possible to use Microsoft R Client as the base R. More details here.   if(!require(sjmisc)){ install.packages("sjmisc") require(sjmisc) }   If you would like to install the package separately you can use the R install packages App from the Alteryx Gallery.   filePath <- "c:\\temp\\outputRAlteryx.sav" inputData <- read.Alteryx("#1", mode="data.frame") ColumnLabels <- as.vector(read.Alteryx("#2", mode="data.frame")$Description)   Within the R code we also define a static ‘filepath ‘ pointing to where the output data should be written. The Action Tool that we previously mentioned will update this filepath to the one chosen by the user while at the same time correctly escaping the backslashes to work in R.   inputData <- read.Alteryx("#1", mode="data.frame") ColumnLabels <- as.vector(read.Alteryx("#2", mode="data.frame")$Description)   We then read the data that we pass to the macro from input ‘#1’ into an R data frame. In this case we are depending on R’s default behavior of transforming text to factors to get the Value encodings for all columns ex Male(1), Female(2). In addition, we read the metadata from input ‘#2’ into R. The sjmisc function, set_label, that applies the variable names to the data frame expects the variable names to be passed as an object of type vector. To make it work, we have to convert the Description column of the data frame we’re reading in into a vector with the as.vector() base R function. For more details about ‘sjmisc’, you can find the documentation here.   labeledData <- sjmisc::set_label(inputData,ColumnLabels) sjmisc::write_spss(labeledData,filePath)   Finally we label inputData with the labels we just created and we store the result in the labeledData dataframe and then write it to the user’s filepath using the sjmisc’s write_spss function.   MessageOut <- paste("file written to: ",filePath) names(MessageOut) <- "Output File Path" write.Alteryx(MessageOut, 1)   We also pass the filepath as a message to the R Tool output to be displayed to the user.     Edit: It was brought to our attention that the macro has an issue writing out text columns that are longer than 120 characters. Unfortunately this is a defect in the underlying R package. As a workaround for now, the macro was modified to trim all text fields to 120 characters. Please keep this in mind when writing out data.   Mandatory Note: This macro and sample code were developed by the authors as a proof of concept to show what's possible. This is not a production-ready macro and is not supported by Alteryx. Do ask questions on this thread - BUT use at your own risk!   WriteSPSSWithLabels_sjlabelled.yxzp has been updated from using the R package sjmisc because the set_label command has been deprecated from sjmisc and is now in sjlabelled.
View full article
With the release of 11.0, we see numerous changes to many tools in the Designer. The Linear Regression Tool gets a UI makeover and some cool new features are added that we will explore in this article. If you are new to performing regression analysis in Alteryx, I highly recommend checking out the Tool Mastery article which goes into everything there is to the old tool. Everything presented in that article remains valid as no features were removed. In this article, we will delve into the changes and new features.
View full article
This article has been archived. Please reach out to community@alteryx.com if you have any questions.
View full article
Symptoms   “Unhandled Exception occurred” error is thrown when you copy and paste text (Ctrl-V) using the R Tool.     Now, to witness it happening:     Diagnosis   Looking at the error log you will see error message below:   Default Log path - C:\ProgramData\Alteryx\ErrorLogs\AlteryxGUI         If you look at the log, you can see the error is directly related to the FIPS cryptographic algorithms. According to Wikipedia, FIPS stands for Federal Information Processing Standards and it is a “standard developed by the United States federal government for use in computer systems by non-military government agencies and government contractors”.   As of right now, “Unhandled Exception occurred” error will be thrown in the R Tool if FIPS compliance is turned on .    Solution   Our Development team is fully aware of the problem with the FIPS compliance and is planning to sort this out in the future releases. As for temporary solution, you can consider turning off the FIPS compliance, of course after checking and making sure your IT manager is okay with it, and this should resolve the “Unhandled Exception occurred” error.   Here’s how you can turn off FIPS compliance:   There are other ways to turn on/off FIPS compliance and you can find them here:   https://www.howtogeek.com/245859/why-you-shouldnt-enable-fips-compliant-encryption-on-windows/   Eddie Wong Alteryx CSE
View full article