Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Dynamic Summarise: Error - 'No fields have been selected for output'

patel_bm
8 - Asteroid

I am trying to build an application to help user select a file and select dimension and measure to produce summary.

 

See attached screenshots for the tools used. I am using a List Box each to select dimension and measures.

 

List Box tool uses 'Generate Custom List' option and has following configuration:

Start Text: <SummarizeField field="

Separator: " action="GroupBy" /> <SummarizeField field="

EndText: " action="GroupBy" />

 

Same configuration with Sum instead of GroupBy on Measure List Box.

 

The action tool has this formula and using 'Update Raw XML with Formula' and 'Update inner Xml' options.

 

if [#1] = '<SummarizeField field="" action="GroupBy" />' then '' else [#1] endif+'
'+

 

if [#2] = '<SummarizeField field="" action="Sum" />' then '' else [#2] endif

 

This causes error 'No fields have been selected for output'.

 

Please note if I change action tool option to 'Update outer XML' it leads to error 'This tool has not been configuredWorkflowWorkflowErrorError

4 REPLIES 4
CharlieS
17 - Castor
17 - Castor

The List Box tool output may not be what you expect. it outputs a concatenated string of all fields with a true/false value like this:

 

Revenue=True,Quantity=False,Gross Margin=True

 

The Summarize tool is expecting this syntax (for an Inner XML update):

 

<SummarizeField field="Retailer_Type" action="GroupBy" rename="Retailer_Type" />
<SummarizeField field="Product" action="GroupBy" rename="Product" />
<SummarizeField field="Revenue" action="Sum" rename="Sum_Revenue" />
<SummarizeField field="Gross_Margin" action="Sum" rename="Sum_Gross_Margin" />

The necessary steps to convert the question output to that syntax would make for one crazy formula, I suggest using multiple tools to produce the necessary XML string and feeding that into another macro to update the Summarize tool. 

 

Check out the example solution attached and let me know if you have any questions.

patel_bm
8 - Asteroid

Hi Charlie,

 

I have tried executing this workflow but getting some error. 'Control parameter must be mapped to a field.'

 

However I have reused one of the sample(reattached in this post) shared by Ben Moss in community post:

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Remove-a-field-from-summarize-in-a-mac...

 

The sample uses custom input option and is able to run successfully. However it uses List selection only for Dimension and a  dropdown for measure. I want user to select multiple measures and not just one. I also want this to work with any file.

The sample is able to generate XML for summarise tool. I have only extended it to use list tool for measures but somehow it keeps failing.

 

CharlieS
17 - Castor
17 - Castor

@patel_bm wrote:

I have tried executing this workflow but getting some error. 'Control parameter must be mapped to a field.'


That's odd, but an easy fix. On the "Questions" tab of the macro interface, make sure the "Concat_XMLString" field is selected in that drop down. 

 

For this to work with any file, chained wizards might be necessary to make sure the user interface for variable selection is built correctly each time. 

patel_bm
8 - Asteroid

Hi Charlie

 

This works now.

 

however I have also managed to get the application workflow to work with List tool.

 

List Box tool uses 'Generate Custom List' option and has following configuration:

Start Text: <SummarizeField field="

Separator: " action="GroupBy" /> <SummarizeField field="

EndText: " action="GroupBy" />

 

Same configuration with Sum instead of GroupBy on Measure List Box.

 

The action tool has this formula and using 'Update Raw XML with Formula' and 'Update inner Xml' options.

if [#1] = '<SummarizeField field="" action="GroupBy" />' then '' else [#1] endif+'
'+

 

if [#2] = '<SummarizeField field="" action="GroupBy" />' then '' else [#2] endif

 

It seem to be working fine now.

 

Here's the screenshot.

DynamicSummarise.JPG

 

 

 

Labels