Start Free Trial

Alteryx Designer Desktop Discussions

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

How to Ignore Non-existent fields in the Summarize Tool?

vivaisun11
8 - Asteroid

I need help handling a weekly workflow with dynamic data columns. Some weeks, these columns contain data that needs to be summarized in the output. Other weeks, these same columns may be empty. I want to ensure that:

1) When data is present, it gets summarized
2) When the column is empty, the summarize function should skip it without causing errors

 

Right now, if the column doesn't exist in a certain week, the Summarize tool breaks and causes an error.

 

Thanks!

4 REPLIES 4
flying008
15 - Aurora

Hi, @vivaisun11 

 

Unfortunately, all field columns in the Summarize Tool are manually specified and fixed, so you can either use macros to complete this requirement or pre-set all possible field names (with a value of 0) first, so as not to cause errors in the Summarize Tool
Also, please upload template data to better illustrate your needs. Thank you!

Qiu
21 - Polaris
21 - Polaris

@vivaisun11 
It depends the way you use Summarize tool but normally we can use the combination of Transpose and Cross-Tab as shown below.
https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/dynamic-summarize/td-p/482985

davidskaife
14 - Magnetar

Hi @vivaisun11 

 

A slightly different approach, using a Batch Macro and the Detour tools.

 

davidskaife_1-1761296920863.pngdavidskaife_2-1761296942508.png

 

 

Assume this is your input normally:

davidskaife_0-1761296890923.png

If the summerised 'Count' column is empty, then it generates a 'True' return, otherwise a 'False' return. This is passed into the Batch Macro and updates the Detour tool to either send the data through the left stream (if the return is False) or through the right stream (if the return is True, i.e the summerised 'Count' column is empty)

 

The Summerize tool inside the macro simply groups by Values, and sums Count :

 

davidskaife_3-1761297196963.png

 

If there is no data in Count, then it passes the data straight through:

 

davidskaife_4-1761297263031.png

 

This is obviously an example situation, but you could hopefully tweak it to match your requirements 

 

MinhLO
7 - Meteor

@vivaisun11 
One useful very simple trick you can implement in 5 seconds: have an Ensure Field text input. I have attached the sample workflow.

MinhLO_0-1761304053701.png

 

 

Labels
Top Solution Authors