Alteryx Designer Desktop Discussions

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

Table error when records are missing

Jake5
8 - Asteroid

I have a workflow that in some instances will have records with values and other instances with no records.  Attached is a mocked up example where my initial input has two fields - Category A & Category B - but no underlying data.  And for additional context, the subsequent tools are used for instances where these fields have values, the data will list first and any null values will sort last.   Thereafter, the New Field column is no longer needed and should not be written to the table.  However, when unselecting New Field within the table, the table produces an error.  For this scenario where no records are present, is there a way to have Alteryx bypass this table and only write when records are available?   

10 REPLIES 10
Felipe_Ribeir0
16 - Nebula

Hi @Jake5 

 

You can summarize with count rows + append, so when you have no rows, the append tool will not let the table tool be feed:

 

summarize.png

Jake5
8 - Asteroid

Hi Felipe.  When I downloaded your workflow it still displays the error message.  I'm reattaching your version for reference along with a screen capture of the error when I'm viewing it.  Am I missing something?

Felipe_Ribeir0
16 - Nebula

Ohh sorry, now i undertood what you said. You dont want any column selected on the table tool for some reason. There is no other way around for you to let the rest of the workflow do what it need to do with a column selected on the table tool?

 

Forget my workflow, it will not handle this situation.

Felipe_Ribeir0
16 - Nebula

@Jake5 

 

See if this version will make sense. Maybe it is overkill, but i used a macro to manipulate wich fields should be selected on the table tool.

 

1)if there is now row with data, the output will be a field called "Table"m without data.

table.png

 

 

2)If there is some row with data, the output will be the table.

table2.png

Jake5
8 - Asteroid

See updated, attached workflow.  Container 1 is the scenario with no data.  The good news for this container, even if I select New Field within the Basic Table tool, the workflow completes and no table is written out (desired).  However, for the scenario with data (Container 2), not only do I get the expected table values for Category A and Category B, it also includes New Field since it's selected (not desired).  Is there a way to have New Field not appear in the output when this scenario arises?

Jake5
8 - Asteroid

Thanks - but it's the display of the New Field when data is present that I'm trying to avoid.  

Felipe_Ribeir0
16 - Nebula

@Jake5 

 

With this version you can control what to display or not with this filter for example (or any other way, just be sure to provide only the columns that you need to the control):

 

Screenshot 2023-08-23 114259.png

Jake5
8 - Asteroid

Thank you, Felipe!  This seems to work as expected.  

Jake5
8 - Asteroid

Sorry - another follow-up question.  I'm not too familar with macros but if I wanted the table columns left justified, how would I accomplish using the workflow you shared?  Currently the values are center justified.  Normally I would do this within the table tool itself but not sure how to access or is there a different way I should go about this now that it's a macro?

Labels