# Table calculations linked to a slider

**URL:** <https://talk.observablehq.com/t/table-calculations-linked-to-a-slider/8251>\
**Category:** Help\
**Created:** [September 7, 2023, 1:48pm UTC](https://talk.observablehq.com/t/table-calculations-linked-to-a-slider/8251 "2023-09-07T13:48:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nico-dsq](https://avatars.discourse-cdn.com/v4/letter/n/ba8739/32.png) [@nico-dsq](https://talk.observablehq.com/u/nico-dsq)\
**Post date:** [September 7, 2023, 1:48pm UTC](https://talk.observablehq.com/t/table-calculations-linked-to-a-slider/8251/1 "2023-09-07T13:48:42Z")

</div>

Hi there.

I’m a beginner.

I’d like to create graphs using column values (as in the notebook), but with two sliders influencing the calculations of different columns (as below):

> **[Test](https://observablehq.com/d/8e3da4cc8c6c6609)**

fp\_cost = false\_positive _replace(slider value)  
fn\_cost = false\_negative_ repair(slider value)  
tp\_cost = true\_positive _replace(slider value)  
total\_savings = (true\_positive_ repair(slider value)) - tp\_cost - fp\_cost

Is there a way to do this without having to pre-calculate all possible combinations and putting them all in the table?

---

<div class="post-metadata">

**Author:** ![mootari](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mootari/32/581_2.png) [@mootari](https://talk.observablehq.com/u/mootari)\
**Post date:** [September 29, 2023, 9:56am UTC](https://talk.observablehq.com/t/table-calculations-linked-to-a-slider/8251/2 "2023-09-29T09:56:06Z")

</div>

@nico-dsq Sorry, looks like your question fell through the cracks.

To clarify, are you asking how to plot a graph “on the fly” for a given domain and interval?

---

<div class="post-metadata">

**Author:** ![nico-dsq](https://avatars.discourse-cdn.com/v4/letter/n/ba8739/32.png) [@nico-dsq](https://talk.observablehq.com/u/nico-dsq)\
**Post date:** [September 29, 2023, 10:09am UTC](https://talk.observablehq.com/t/table-calculations-linked-to-a-slider/8251/3 "2023-09-29T10:09:31Z")

</div>

Thanks @mootari . No worries. I got it solved in the end… Thanks, though.
