Segments sorting on same field but different sense (ASC VS DESC)

Feature(s) impacted

Segments sorting

Observed behavior

We have an Event view with 2 segments. Past events & Upcoming events. We want to filter Upcoming events on start_date descending & Past events on start_date ascending.
While sorting can be independent from segment to segment on different fields, it doesn’t on the same field.
Hence, we find ourselves having to pick one or the other that will apply to both view, making one of them hard to understand.

Expected behavior

I have 2 segments, I sort one with start_date asc & one with start_date desc, and both segments are independently sorted.

Failure Logs

Context

Project: Platform
Team: Operations
Environment: Staging, Preprod, Production
“meta”: {
“liana”: “forest-express-sequelize”,
“liana_version”: “7.12.3”,
“stack”: {
“database_type”: “postgres”,
“engine”: “nodejs”,
“engine_version”: “12.22.7”,
“orm_version”: “5.22.5”
}
}

Hello @MaximeRobion,

I’m just gonna rephrase your problem just to make sure I have correctly understood your need.

You have a table Event containing the column start_date.
You would like to create 2 segments for this table, where the start_date is present and you would like to sort them as follow:

  • Segment Past event: sort on start_date ascending
  • Segment Upcoming event: sort on start_date descending

Have I correctly understood your problem?
Mia

Hey @anon23361380 , thanks for your fast answer :slight_smile:
That’s it!

Actually, we already have the segments, and we already sort them like this in the code. It doesn’t work…
We tried everything we could with the Forest UI as well, doesn’t work neither.

to make it short: having segments of the same view using different sorting on the same field doesn’t work.

@MaximeRobion Indeed, I tried to reproduce your problem and we have a bug!
We are working on a fix.
I will let you know as soon as it is deployed :slight_smile:

Cool, thanks @anon23361380 , have a great day! :slight_smile: