Timeline for Capture row with highest value from each percentile
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 18, 2021 at 0:56 | history | edited | Erwin Brandstetter | CC BY-SA 4.0 |
format. tag, denoise, title
|
Mar 18, 2021 at 0:50 | answer | added | Erwin Brandstetter | timeline score: 0 | |
Mar 17, 2021 at 19:25 | comment | added | Anonimeishon | @AdamKG I didn't know that array_agg function existed, it saved my life, thanks! you just remove buckets from the order by clause and it works just as I need it to! | |
Mar 17, 2021 at 19:21 | comment | added | Anonimeishon | @AdamKG It's still showing all of the rows, I just want the last of every Ntile iteration. I.E. if there are 20 rows, I don't want it to show every Ntile Like 1,1,2,2,3,3,4,4........ Instead I need it to just show me the last one of each iteration, like 1,2,3,4. | |
Mar 17, 2021 at 18:08 | comment | added | AdamKG |
You need to aggregate the buckets field to turn it from a SETOF to a single row. (array_agg($X ORDER BY $Y))[1] should do what you want; use the ORDER BY to control which of the rows in that ntile group is used. db-fiddle.com/f/myA71qS3du4EyTjJwo1e8p/0
|
|
Mar 17, 2021 at 17:36 | comment | added | nbk | can you show us the wanted result for your fiddle? | |
Mar 17, 2021 at 16:04 | review | First posts | |||
Mar 17, 2021 at 16:57 | |||||
Mar 17, 2021 at 16:00 | history | asked | Anonimeishon | CC BY-SA 4.0 |