Hi everyone,
I have a table with numbers and I would like to count the number of positive value per row. Do you have an idea of how to do that?
Thanks in advance!
Grace
Solved! Go to Solution.
You could use the multi row formula, add a variable (I named mine [Count]), and add the current formula:
IF [Field1]>=0 Then [Row-1:Count]+1 ELSE [Row-1:Count]+0 ENDIF
this would give you at the end of your file the amount of positive values.
cheers
Hi,
What should I replace "Field1" by excatly?
If I copy paste the code line as it is, Alteryx tells me that "Field1" is unknown.
BR,
Grace
Hello @GraceK_dup_114 ,
On this workflow you will find both methods, count per row and per column, since I really don't know which you were really looking for.
On the join, where I select [Field3], you have to select the last colum with numbers to be included.
PS: [Field1] is for me the coulm which has all the numbers to be counted. (Since I first thought it was a count per Column and not per Row)
Cheers.
Also if you want me adapt it for you I would need at least the table headings so that there is no modification needed by your side.
Cheers
It could be very simple. See flow attached
- Add a Record ID
- Transpose Fields grouping by Record ID
- Add a Formula Tool to flag the positive numbers (IF [[Value] > 0 then 1 else 0)
- Summarize to Count the number of positive flags
- Join it back to your dataset by Record ID
Cheers,