How to add a default row for all the unique rows

Hi @Vasudev , what you have done is exactly how I have done it.

It’s probably the fastest and most efficient way to do this, though I can’t see what your metanode “Add Default Value columns” is doing. If it just to sort the columns, it’s not really needed. You can just invert the Concatenate input, that is put the original data at the top and the groupby at the bottom, the concatenate will automatically take the structure of the first input first. Also, it is not necessary to manually add Feature 2 following the GroupBy. Just do an aggregation that results in 0, for example count of missing value.

I put a quick demo for this:
image

Input:
image

Results:
image

Here’s the workflow: Add a default row for all the unique rows.knwf (10.4 KB)

1 Like