Filtering sometimes alters existing row order

Hi, I found that filtering results will be ordered if you filter by <,<=,> or >=. See pic:

image

Where
Order1 = thisTable.Filter(Value<4)
Order2 = thisTable.Filter(Value!=4)

Desired outcome would be Order1 = [a,c,b]

I suppose this for performance reasons, but it breaks usability for cases where you need to keep strict row ordering (like tasks dependencies).

2 Likes

Still happens, moved to Bugs.(?)

1 Like

Hello Dalmo, thank you for recall on this.

I can’t find the issue around this, the filter formula is sorting your data based on the same column you’re filtering.

To get it sorted using a different column you can add Sort() at the end of the formula specifying your desired column to sort on, I would recommend to use Rank() column which will allows you to maintain a real id of the column you are tracking.
I have created this demo doc for you: https://coda.io/d/Filtering-sometimes-alters-existing-row-order_dvjNb64uBlh/Section-1_suXLh#Filtering_tuSwU

Let me know any doubt or comment you have.

Thanks @Jesus_Guzman,

The issue is twofold:

  1. I don’t expect Filter to sort. These actions should be decoupled.

  2. The sorting is inconsistent.

the filter formula is sorting your data based on the same column you’re filtering.
sorted

It does and it doesn’t. Look at Order 2 in my post again. It’s not sorted. Filtering with == or != or other expressions don’t sort. It only sorts when using <,<=,> or >=. What about using multiple criteria for filtering? I haven’t checked that.

Either way, for data consistency, I’d expect filter to preserve the initial ordering.

In your previous post, I don’t see any row with the value of 4,
Were you using any filter for the table?
In any case it should works, 04%20PM

Feel free to edit the doc above, so I can see the issue there.
Thanks.

You gif proves my point exactly.

In your gif, Order2 preserves the row order without you having to sort after. That’s the expected outcome. It should be the same for Order1.

I see, I got your point, thanks.

I will file this bug in our internal tracker.

Appreciate your help.
Best Regards!

1 Like