# Chart with Data and sort by year

**URL:** https://community.glideapps.com/t/chart-with-data-and-sort-by-year/26283
**Category:** Ask for Help
**Created:** [May 2, 2021, 1:42am UTC](https://community.glideapps.com/t/chart-with-data-and-sort-by-year/26283 "2021-05-02T01:42:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dmcrabby](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dmcrabby/32/19959_2.png) [@dmcrabby](https://community.glideapps.com/u/dmcrabby)
#### Post date: [May 2, 2021, 1:42am UTC](https://community.glideapps.com/t/chart-with-data-and-sort-by-year/26283/1 "2021-05-02T01:42:39Z")

</div>

So.  
I have data in one sheet that charts pull from on a page. I want to be able to allow a user to sort by year and have the charts reflect the data.

I have found a way to get the year… but can’t figure out how to get the data to change with maybe a choice or drop down menu. Thoughts?

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [May 2, 2021, 2:19am UTC](https://community.glideapps.com/t/chart-with-data-and-sort-by-year/26283/2 "2021-05-02T02:19:16Z")

</div>

What do you want to use a choices in the drop down? Do you want them to filter by year?

---

<div class="post-metadata">

### Author: ![dmcrabby](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dmcrabby/32/19959_2.png) [@dmcrabby](https://community.glideapps.com/u/dmcrabby)
#### Post date: [May 2, 2021, 2:50am UTC](https://community.glideapps.com/t/chart-with-data-and-sort-by-year/26283/3 "2021-05-02T02:50:34Z")

</div>

Yes by year.  
I have 2 tabs. One that has the input form and charts,  
2nd tab is a list of details about the input.

I have 2 sheets.

My app, inputs the number of swipes of a metro card by the reason for the travel.

A total amount of metro expenses is then adjusted to show a percentage and amount per category of travel.

I added a math column to pull the year out of 1 sheet and tried a relation column to the other. But can’t figure out how to have the user select a year (from a a dropdown is fine) and have the charts update to the year selected and have the data for that year appear (which is in the other tab)

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [May 2, 2021, 9:01am UTC](https://community.glideapps.com/t/chart-with-data-and-sort-by-year/26283/4 "2021-05-02T09:01:05Z")

</div>

Without knowing the specific structure you are having, I’m guessing you can have a choice component pointing to a user-specific column, then use that column’s value to feed a relation to the other sheet, then that relation can be used as the source value for the chart.
