Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

R (Report) output as a table

Federica_FF
11 - Bolide

Hello everybody,

 

is there any way to have the result of the R output connector of any predictive tool (the report) as a normal table?

 

For example I'd like to have a table of the LeafSummary of a Decision Tree with 1 column for the node number, 1 column for the split, etc....

 

I could scrape the HTML code of the report and get the table, I can do it. But maybe there is a easier way to do that? Maybe adding some R-scripting starting from the O(bject) connector?

 

Do you have any idea how to do it?

 

 

4 REPLIES 4
NickJ
Alteryx Alumni (Retired)

Hi,

 

That information is available in the underlying macro - you just need to expose the contents (after a little coaxing and parsing) into a macro output to make it available as part of the tool output.

 

In the Decision Tree macro, you need to start amending the macro workflow at Select(20) - I've added an attachment to this post to show you a quickly-sketched out version, that you can test out immediately in the Sample Workflow>Predictive Analytics>6. Decision Tree example workflow (use the L output anchor of this tool)

 

Hope this helps!
Nick

Nick Jewell | datacurious.ai
michael_treadwell
ACE Emeritus
ACE Emeritus

By 'normal table' I assume you mean that you can attach a browse tool to the output and get see the results in an Alteryx table.

 

All of the reports that you see from the predictive tools are built in R and the displayed via browse by utilizing the AlteryxGraph() function inside of the R tool.

 

If you wanted this data to display as a table, you would need to edit the underyling R Tool in the predictive macro (right click on the tool and select 'Open Macro:') to combine the data you want into a table using R code inside the R tool and the write it to an output using write.Alteryx().

 

Though this blog isn't relevant to this topic, it does show an example of using write.Alteryx()https://www.interworks.com/blog/mtreadwell/2016/01/12/speed-your-analysis-alteryx-using-r-and-sqlite

Federica_FF
11 - Bolide

Thank you, both of you.

 

The R code "write.Alteryx()" was exactly what I was looking for. Simple, clear and straight.

 

Thanks!

aweldon1
6 - Meteoroid

Hi - Sorry I am late to this thread, but I'm wondering how you were able to write out the leaf summary specifically? I'm looking at the R tool in the decision tree, and I'm not seeing where that data is located in order to use Write.Alteryx to write it out?

Labels