# Generate TS function backed chart that bucket values and handle 2 separate stages of aggregations

**URL:** <https://community.palantir.com/t/generate-ts-function-backed-chart-that-bucket-values-and-handle-2-separate-stages-of-aggregations/933>\
**Category:** Ask the Community\
**Tags:** code-repositories, osdk, functions\
**Created:** [August 5, 2024, 3:12pm UTC](https://community.palantir.com/t/generate-ts-function-backed-chart-that-bucket-values-and-handle-2-separate-stages-of-aggregations/933 "2024-08-05T15:12:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DSK](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/dsk/32/1071_2.png) [@DSK](https://community.palantir.com/u/DSK)\
**Post date:** [August 5, 2024, 3:12pm UTC](https://community.palantir.com/t/generate-ts-function-backed-chart-that-bucket-values-and-handle-2-separate-stages-of-aggregations/933/1 "2024-08-05T15:12:04Z")

</div>

As mentioned above, trying to bucket and order column a in asc and then segment by column b value and also order aolumn b in asc order.  
Is this possible to do on foundry currently to generate a chart?

---

<div class="post-metadata">

**Author:** ![JulioM](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/juliom/32/248_2.png) [@JulioM](https://community.palantir.com/u/JulioM)\
**Post date:** [August 5, 2024, 6:15pm UTC](https://community.palantir.com/t/generate-ts-function-backed-chart-that-bucket-values-and-handle-2-separate-stages-of-aggregations/933/2 "2024-08-05T18:15:21Z")

</div>

Out of curiosity, does doing both sorts for a and b before bucketting achieve the desired result?

---

<div class="post-metadata">

**Author:** ![Joel](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/joel/32/3579_2.png) [@Joel](https://community.palantir.com/u/Joel)\
**Post date:** [August 6, 2024, 1:42pm UTC](https://community.palantir.com/t/generate-ts-function-backed-chart-that-bucket-values-and-handle-2-separate-stages-of-aggregations/933/3 "2024-08-06T13:42:38Z")

</div>

Can you please provide a screenshot or some sample values for column a and column b? What data types are these? It might be possible to solve this using Workshop’s chart configuration panel without TS.

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/system/32/3_2.png) [@system](https://community.palantir.com/u/system)\
**Post date:** [January 13, 2025, 8:21pm UTC](https://community.palantir.com/t/generate-ts-function-backed-chart-that-bucket-values-and-handle-2-separate-stages-of-aggregations/933/4 "2025-01-13T20:21:31Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/system/32/3_2.png) [@system](https://community.palantir.com/u/system)\
**Post date:** [July 2, 2025, 6:09am UTC](https://community.palantir.com/t/generate-ts-function-backed-chart-that-bucket-values-and-handle-2-separate-stages-of-aggregations/933/5 "2025-07-02T06:09:43Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/system/32/3_2.png) [@system](https://community.palantir.com/u/system)\
**Post date:** [September 12, 2026, 3:06pm UTC](https://community.palantir.com/t/generate-ts-function-backed-chart-that-bucket-values-and-handle-2-separate-stages-of-aggregations/933/6 "2026-09-12T15:06:27Z")

</div>


