Sum of values from Nested field as per the Global filter for Currency unit in Bar chart

I have different types of currency values in each record as per user selects the Currency_unit, Bar chart should make sum of Currency_value. How to acheive this. PFB for the result. If the index data type needs to me modified, please let me know. The outcome should be like if user selects the currency unit as "USD" in control filter USD values should be sum up in Bar chart similarly for EUR.

"hits" : [
      {
        "_index" : "test-currency",
        "_id" : "c4_uk38BnMsXXgDPcQEY",
        "_score" : 1.0,
        "_source" : {
          "model_number" : "QVKC911",
          "calculated_currency" : {
            "EUR" : 70.2,
            "USD" : 90
          }
        }
      },
      {
        "_index" : "test-currency",
        "_id" : "uo_uk38BnMsXXgDPmAG5",
        "_score" : 1.0,
        "_source" : {
          "model_number" : "QVKC91",
          "calculated_currency" : {
            "EUR" : 170.2,
            "USD" : 190
          }
        }
      }
    ]

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