# Nested Expression Lookup

**URL:** <https://forum.inductiveautomation.com/t/nested-expression-lookup/41699>\
**Category:** General Discussion\
**Created:** [December 21, 2020, 7:06pm UTC](https://forum.inductiveautomation.com/t/nested-expression-lookup/41699 "2020-12-21T19:06:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathieurleblanc33](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@mathieurleblanc33](https://forum.inductiveautomation.com/u/mathieurleblanc33)\
**Post date:** [December 21, 2020, 7:06pm UTC](https://forum.inductiveautomation.com/t/nested-expression-lookup/41699/1 "2020-12-21T19:06:44Z")

</div>

Hi,

I need to do a nested lookup on a query tag of datatype Dataset.  
I want to pull back a datatype string from Tag type Expression.  
My expression will do lookup()  
My data has a bay number column and preset number column. I want to look for bay number X AND preset number Y. This correlation should only give me 1 row and then i want to return the value in column “file\_code”.  
Is there a simple way using expression language?

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [December 22, 2020, 12:26am UTC](https://forum.inductiveautomation.com/t/nested-expression-lookup/41699/2 "2020-12-22T00:26:36Z")

</div>

Don't think it's possible,

> [@Lookup with multiple lookup values](http://forum.inductiveautomation.com/t/lookup-with-multiple-lookup-values/11558):
>
> Is it possible to use the lookup function with more than one lookup value? I have a DataSet with six columns. I would like to return the value of one column based on a lookup value match in two other columns. Based on the lookup function parameters this does not seem possible. Is there a better way to do this? I would like to use a DataSet instead of a database table for this because it is critical and can’t rely on a database server connection always being up.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 22, 2020, 3:52am UTC](https://forum.inductiveautomation.com/t/nested-expression-lookup/41699/3 "2020-12-22T03:52:11Z")

</div>

> [@jlandwerlen](#):
>
> Don’t think it’s possible

If you exclude my answer in that topic. My `view()` expression function certainly _can_ perform multiple comparisons in a WHERE clause.

---

<div class="post-metadata">

**Author:** ![mathieurleblanc33](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@mathieurleblanc33](https://forum.inductiveautomation.com/u/mathieurleblanc33)\
**Post date:** [December 22, 2020, 2:57pm UTC](https://forum.inductiveautomation.com/t/nested-expression-lookup/41699/4 "2020-12-22T14:57:08Z")

</div>

Much Appreciated.  
Installed the module, tried a few versions of the view() code and got it working!!!  
Thanks for the quick answer!
