counting filled slection of columns per row

Dear all,

I have a result table from pivot that you can find in attached workflow.
test.knwf (19.4 KB)

In a new column I have to count the number of filled columns
1.0+first(a)
2.0+first(a)

20.0+first(a)

in pseudocode:
gn_count = 0
for i = 1 to 20
if column(i & “first(a)” is not null
gn_count = gn_count +1
endif
next i
column(“count)”=gn_count

I tried with column aggregator but I foundno way to define the condition.

Any idea?

Thx for help!

BR,

Heinz

Hi @Heinz , I didn’t understand how the test workflow you posted related to what you wrote in your post, so I wonder if you posted the correct workflow?

If you are wanting to count, for each row, the number of columns that contain an entry, the Column Aggregator should be able to do that for you.

Specify the columns that you wish to include in the Columns tab, and then on the Options tab specify Count and untick the “Missing” option so that only non-missing entries are counted.

1 Like