Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Crosstab and Dynamically name Columns


Hi again, 

I need my output to split out Yes and No Flag counts by Country.  I built a Crosstab workflow (attached), but I would like the country to be appended to the Y or N flag, per the following image.  At times there will be over 100 questions, but only 6 countries, and 6 veh.

Your help is appreciated.



Alteryx Certified Partner

Hey @LincolnMike,


The easiest way to do this is create a formula which concatenates your country and Y/N flag, this can the be used as your header:


Country Headers.PNG




Thank you LNL.  Is there a way to sort so TotN and TotY would list before the other countries?

Alteryx Certified Partner



Absolutely... a couple of ways would be to use a select tool just before the output and manually move the totals to the where you want them. Or if you want it be more dynamic then add an "a" to the total header (which will then sort it first in the crosstab) and use Dynamic Rename (or Multifield) to remove that "a" after the crosstab


Country Headers Dynamic.PNG


Hi LNL, thanks for the solution.  One last question on this same query:

Is there a way to dynamically Data Cleanse?  As countries get added,  I would need to manually check their boxes in the Data Cleanse tool.

Alteryx Certified Partner
I think Multifield would be the tool here with something like:

If IsNull([_currentfield_]) then 0 else [_currentfield_] endif

On all numeric fields