# Vega, Cross reference between 2 indexes

**URL:** <https://discuss.elastic.co/t/vega-cross-reference-between-2-indexes/339391>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [July 27, 2023, 7:06am UTC](https://discuss.elastic.co/t/vega-cross-reference-between-2-indexes/339391 "2023-07-27T07:06:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bandodkarD](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@bandodkarD](https://discuss.elastic.co/u/bandodkarD)\
**Post date:** [July 27, 2023, 7:06am UTC](https://discuss.elastic.co/t/vega-cross-reference-between-2-indexes/339391/1 "2023-07-27T07:06:40Z")

</div>

Scenario:  
-- 2 different indexes  
-- current\_Id in IndexA and doc\_Id in IndexB  
I have a use case where i have to display data, when a condition **current\_id equals doc\_Id**  
It should retrieve all records for which this condition is true.

I am using a Vega Sankey Visialisation.  
Attempted approach:  
I have 2 data sets specified,

**IndexA**

 ![Screenshot 2023-07-27 at 12.27.11 PM](https://us1.discourse-cdn.com/elastic/original/3X/7/5/75ed4dcc1d7d9425af8af929f047be67caad76ad.png)

**IndexB**

 ![Screenshot 2023-07-27 at 12.27.57 PM](https://us1.discourse-cdn.com/elastic/original/3X/b/2/b22412dfc5a8357347d7d7c8a7ae764aa93baac1.png)

Index A gives an array of stk3 bucket

 ![Screenshot 2023-07-27 at 12.31.49 PM](https://us1.discourse-cdn.com/elastic/original/3X/9/2/921a0df1144a3e3f7f1da0704528f18c8014073d.png)

I want stk3 values to be matched against the current\_id of IndexB, so that it filters out those records that matches that condition and further aggregation is performed on those selected records.

Error I am currently facing,  
'\* Infinite extent for field "y1": [Infinity, -Infinity]'

How do I go about this use case?

---

<div class="post-metadata">

**Author:** ![bandodkarD](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@bandodkarD](https://discuss.elastic.co/u/bandodkarD)\
**Post date:** [July 27, 2023, 9:05am UTC](https://discuss.elastic.co/t/vega-cross-reference-between-2-indexes/339391/2 "2023-07-27T09:05:07Z")

</div>

How do I access the stk3 variable in the second index ??

---

<div class="post-metadata">

**Author:** ![bandodkarD](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@bandodkarD](https://discuss.elastic.co/u/bandodkarD)\
**Post date:** [July 28, 2023, 5:55am UTC](https://discuss.elastic.co/t/vega-cross-reference-between-2-indexes/339391/3 "2023-07-28T05:55:27Z")

</div>

Any Suggestions ??

---

<div class="post-metadata">

**Author:** ![bandodkarD](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@bandodkarD](https://discuss.elastic.co/u/bandodkarD)\
**Post date:** [August 3, 2023, 9:13am UTC](https://discuss.elastic.co/t/vega-cross-reference-between-2-indexes/339391/4 "2023-08-03T09:13:07Z")

</div>

hi  
does anyone know this?

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [August 3, 2023, 2:05pm UTC](https://discuss.elastic.co/t/vega-cross-reference-between-2-indexes/339391/5 "2023-08-03T14:05:56Z")

</div>

Hi @bandodkarD. Can you post the Vega code that you currently have? It might help us understand better.

---

<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:** [August 31, 2023, 2:06pm UTC](https://discuss.elastic.co/t/vega-cross-reference-between-2-indexes/339391/6 "2023-08-31T14:06:49Z")

</div>

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