# Modifying index data for visual based of user entered values?

**URL:** <https://discuss.elastic.co/t/modifying-index-data-for-visual-based-of-user-entered-values/223629>\
**Category:** Kibana\
**Created:** [March 14, 2020, 6:22pm UTC](https://discuss.elastic.co/t/modifying-index-data-for-visual-based-of-user-entered-values/223629 "2020-03-14T18:22:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Farmer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martin_farmer/32/64456_2.png) [@Martin\_Farmer](https://discuss.elastic.co/u/Martin_Farmer)\
**Post date:** [March 14, 2020, 6:22pm UTC](https://discuss.elastic.co/t/modifying-index-data-for-visual-based-of-user-entered-values/223629/1 "2020-03-14T18:22:22Z")

</div>

I have some data I want to graph and display in a table. I want the user to be able to run scenarios where by they can add a "weight" multiplier to some of the values - I need to take the "raw" value and multiple it by the weight - I thought scripted fields may be of help, but I see no way to tie a scripted field to a user parameter - any thoughts ??

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [March 17, 2020, 2:37am UTC](https://discuss.elastic.co/t/modifying-index-data-for-visual-based-of-user-entered-values/223629/2 "2020-03-17T02:37:46Z")

</div>

I am not sure if this is possible.

@flash1293 what do you think?

Thanks,  
Bhavya

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [March 23, 2020, 8:14am UTC](https://discuss.elastic.co/t/modifying-index-data-for-visual-based-of-user-entered-values/223629/3 "2020-03-23T08:14:11Z")

</div>

I can't think of a good way to achieve this in Kibana today - visualizations like table are optimized for reading data, you can't write (like changing a weight multiplier). If I understand you correctly you can achieve something like this by letting your user edit the scripted field definition and adding more clauses to it for the individual weights:

```auto
int weight = 1;
if (doc["myField"].value === "A") {
  weight = 3.4;
} else if (doc["myField"].value === "B") {
  weight = 2.1;
} else ...

return doc["myOtherField"].value * weight;

```

But the user would have to go back and forth from the visualization to the index pattern management page to do that.

This sounds like it's complex enough to justify the development of a custom visualization plugin that includes this logic and does it on the fly on behalf of the user.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 20, 2020, 8:14am UTC](https://discuss.elastic.co/t/modifying-index-data-for-visual-based-of-user-entered-values/223629/4 "2020-04-20T08:14:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
