# Configurator Lookup Table, can I do this?

**URL:** <https://www.epiusers.help/t/configurator-lookup-table-can-i-do-this/89607>\
**Category:** Kinetic ERP\
**Tags:** epicor\
**Created:** [April 20, 2022, 2:59pm UTC](https://www.epiusers.help/t/configurator-lookup-table-can-i-do-this/89607 "2022-04-20T14:59:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian\_Mepham](https://www.epiusers.help/user_avatar/www.epiusers.help/adrian_mepham/32/6960_2.png) [@Adrian\_Mepham](https://www.epiusers.help/u/Adrian_Mepham)\
**Post date:** [April 20, 2022, 2:59pm UTC](https://www.epiusers.help/t/configurator-lookup-table-can-i-do-this/89607/1 "2022-04-20T14:59:49Z")

</div>

I have a simple configurator lookup table, a small snippet of which is below;

![image](https://www.epiusers.help/uploads/default/original/3X/b/3/b3cfc2da5854591935b4d4b4e1abae291967183d.png)

I have a value from the configurator, and what I want to do is; if this value is \>= MIN-VAL and \<= MAX-VAL I want to return the BLADE-QTY.

Is this something that is possible?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Mark\_Wonsil](https://www.epiusers.help/user_avatar/www.epiusers.help/mark_wonsil/32/51594_2.png) [@Mark\_Wonsil](https://www.epiusers.help/u/Mark_Wonsil)\
**Post date:** [April 21, 2022, 12:49pm UTC](https://www.epiusers.help/t/configurator-lookup-table-can-i-do-this/89607/2 "2022-04-21T12:49:51Z")

</div>

Hello Adrian,

It is possible but you’ll have to write some code to do it. I would recommend writing a BAQ to show what the record structure is like for Configurator Look-Up tables for guidance. Each record in that table represents a table name, a row, and a column - basically a cell in the table. Once you filter for the table name, then you’ll search for the values for the columns you’re interested in. AND THEN, you use those values to find the column(s) for the blade qty.

There are some helper functions but I don’t recall any that do ranges though.

---

<div class="post-metadata">

**Author:** ![MikeGross](https://www.epiusers.help/user_avatar/www.epiusers.help/mikegross/32/14500_2.png) [@MikeGross](https://www.epiusers.help/u/MikeGross)\
**Post date:** [April 21, 2022, 1:33pm UTC](https://www.epiusers.help/t/configurator-lookup-table-can-i-do-this/89607/3 "2022-04-21T13:33:19Z")

</div>

Like @Mark_Wonsil said - you’ll have to do some code.

From a different angle, we’ve been using a UD table or two to contain stacked data tables so we can do conditional queries like this. If you’re going to have to write some code, might as well write what you need. It’s a little more work to fill the dropdowns and such, but it’s not that bad. We use the lookups only for their originally intended purpose.

---

<div class="post-metadata">

**Author:** ![Mark\_Wonsil](https://www.epiusers.help/user_avatar/www.epiusers.help/mark_wonsil/32/51594_2.png) [@Mark\_Wonsil](https://www.epiusers.help/u/Mark_Wonsil)\
**Post date:** [April 21, 2022, 1:36pm UTC](https://www.epiusers.help/t/configurator-lookup-table-can-i-do-this/89607/4 "2022-04-21T13:36:47Z")

</div>

+1 on UD Tables. They are far more performant than the config tables.

---

<div class="post-metadata">

**Author:** ![Adrian\_Mepham](https://www.epiusers.help/user_avatar/www.epiusers.help/adrian_mepham/32/6960_2.png) [@Adrian\_Mepham](https://www.epiusers.help/u/Adrian_Mepham)\
**Post date:** [April 21, 2022, 2:32pm UTC](https://www.epiusers.help/t/configurator-lookup-table-can-i-do-this/89607/5 "2022-04-21T14:32:57Z")

</div>

Hi Guys, thanks for taking the time to reply, I do agree about the UD Tables but I am under strict instruction to use the Lookup tables provided. Any way, after spending way to long on this I eventually managed to get something that works. I realized (luckily) that I only needed the MIN-VAL value, as the first row where it is less than my BS() value is the one I want. I could not get anything to work with the two criteria.  
I have put what I did below, it may be of use to someone someday. Any advice / constructive criticism is more than welcome.  
Thanks again

```cs

decimal x = 0;
int a = 0;
decimal b = Convert.ToDecimal(BS());
foreach ( var result in (from row in Db.PcLookupTblValues
where row.Company == Context.CompanyID
&& row.LookupTblID == "DG-BLADES"
select row))
{
if (result != null)
{	
	if (result.ColName == "MIN-VAL" && result.DataValueDecimal <= b)
	a = result.RowNum;
	
}
}
var nextresult = (from row in Db.PcLookupTblValues where row.LookupTblID == "DG-BLADES" && row.RowNum == a && row.ColName == "BLADE-QTY"
select row).FirstOrDefault();
if (nextresult != null)
x = nextresult.DataValueDecimal;
return Convert.ToInt32(x);

```
