Missed the Q4 Fall Release Product Update? Watch the on-demand webinar for more info on the latest in Designer 24.2, Auto Insights Magic Reports, and more!
Free Trial

Alteryx Designer Desktop Discussions

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

How to replicate Horizontal countif formula in alteryx in formula tool ??

Desaisid
7 - Meteor

Below is the formula which I wanted to replicate

=COUNTIF(A1:Z1,"A")

 

I wanted to put this formula in formula tool. Is it possible to do so?

7 REPLIES 7
DanielG
12 - Quasar

@Desaisid - You can flip the data around with a Transpose Tool run the calculation and flip it back with the Cross Tab Tool.  Check out the examples within the help areas.  If you want to provide a sample dataset/workflow, someone can do some quick mock-up for you.

 

https://help.alteryx.com/20231/designer/transpose-tool

 

https://help.alteryx.com/20231/designer/cross-tab-tool

 

 

acarter881
12 - Quasar

Hello, @Desaisid.

 

Please see the screenshot and the attached workflow.

 

I would do this with a Transpose tool followed by a Summarize tool. You can get all combinations of COUNTIF values as well, instead of just A.

 

acarter881_0-1685990416922.png

 

Desaisid
7 - Meteor

I can't flip the data as the horizontal arrey which I have to take contains 98 fields. Will it be possible to get the required details using formula tool??

Desaisid
7 - Meteor

I have added new 98 column using formula and next to those columns I have to get the count using countif where I can get the number of items in each row.

DanielG
12 - Quasar

@Desaisid - Building off of the Summarize that @acarter881 suggestion you can bring the data back together with the "Count of A" included onto the original dataset for each row.  Alot easier than trying to force-fit something in the Formula tool.  Especially with 98 columns.

acarter881
12 - Quasar

Hey, @Desaisid. I hope the workflow in my previous reply gives you an idea of a potential solution. I'm not sure what you mean by not being able to flip the data. If you need additional assistance, feel free to post sample data and a sample output. 👍

flying008
15 - Aurora

Hi,@Desaisid 

 

If you won't use tools of transpose + crosstab or transpose + summarize to get like countif  cross multiple columns. maybe you can see that use formula :

 

录制_2023_06_06_10_30_37_869.gif

Labels
Top Solution Authors