# Issue with Dropdown menu

**URL:** <https://forum.inductiveautomation.com/t/issue-with-dropdown-menu/16885>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [February 6, 2018, 7:44am UTC](https://forum.inductiveautomation.com/t/issue-with-dropdown-menu/16885 "2018-02-06T07:44:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![liau.kwongweng](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@liau.kwongweng](https://forum.inductiveautomation.com/u/liau.kwongweng)\
**Post date:** [February 6, 2018, 7:44am UTC](https://forum.inductiveautomation.com/t/issue-with-dropdown-menu/16885/1 "2018-02-06T07:44:13Z")

</div>

Am new to Ignition  
Just trying out a data table and a drop down  
Data table has 4 columns and 12 rows of values. only column one is set as Integer(id), the other columns are set as Float(dr, v\_max, v\_allow)

In the dropdown , it has the property binding of  
SELECT distinct v\_allow from test\_ignition\_table  
and has a custom properties of “where” with the Expression of  
if({Root Container.Dropdown.selectedValue} = -1 , “1=1”,  
“v\_allow = '” + escapeSQL ({Root Container.Dropdown.selectedStringValue}) + “’”)

on the data table, it has the query of  
SELECT \* FROM test\_ignition\_table where {Root Container.Dropdown.where}

ISSUE is:  
When it is run, there is no error at all but whenever the dropdown select a value, on the data table it does not display any corresponding row.  
However, whenever the value of 9.75 is selected, that particular row will be displayed.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/20e885512beec9723e94c2860c91f9b8d537fe92.png)

Would appreciate any help or advise.Thank you

---

<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:** [February 6, 2018, 1:46pm UTC](https://forum.inductiveautomation.com/t/issue-with-dropdown-menu/16885/2 "2018-02-06T13:46:23Z")

</div>

If your `v_allow` column is numeric, remove your quoting in your `where` property’s expression.

---

<div class="post-metadata">

**Author:** ![liau.kwongweng](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@liau.kwongweng](https://forum.inductiveautomation.com/u/liau.kwongweng)\
**Post date:** [February 7, 2018, 12:55am UTC](https://forum.inductiveautomation.com/t/issue-with-dropdown-menu/16885/3 "2018-02-07T00:55:27Z")

</div>

Thanks for kind reply  
Not sure if I understood correctly. But the issue is still not solved.  
After removing the “where” from the query in data table as follows:  
SELECT \* FROM test\_ignition\_table

Basically, when the drop down is selected for any value, the data table always show all the rows, it does not show the particular row that corresponds to the value selected in the dropdown.

After trying out different things or to troubleshoot, still could not figure out what went wrong or what is missing.  
Would appreciate any advise/help. Thank you.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/dccc8b765a98c7b47c27ee591917fdb6dcb592e8.png)

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [February 7, 2018, 4:49pm UTC](https://forum.inductiveautomation.com/t/issue-with-dropdown-menu/16885/4 "2018-02-07T16:49:23Z")

</div>

> [@liau.kwongweng](#):
>
> "v\_allow = '" + escapeSQL ({Root Container.Dropdown.selectedStringValue}) + "'")

Leave your where clause as is but remove the quote (') delimiters:

```auto
"v_allow = " + escapeSQL ({Root Container.Dropdown.selectedStringValue}))

```

---

<div class="post-metadata">

**Author:** ![liau.kwongweng](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@liau.kwongweng](https://forum.inductiveautomation.com/u/liau.kwongweng)\
**Post date:** [February 8, 2018, 9:14am UTC](https://forum.inductiveautomation.com/t/issue-with-dropdown-menu/16885/5 "2018-02-08T09:14:31Z")

</div>

Thanks @bfuson and @pturmel. Its finally working after removing the quote (’) delimiters and also changing all the data table columns from float to decimal.

By the way, I have encountered further difficulties and would greatly appreciate any advise/help. Not sure should i start in a new topic but i thought just continue here(my apologies if it is not suppose to be):

Q1) Wonder how is it possible to generate a plot of two curves on the same graph based on the data (Eg the data table as shown the picture in post 2 above)?  
1)first curve is v\_max(y axis) versus dr(x axis)  
2)second curve is v\_allow(y axis) versus dr(x axis)  
Q2)is there any curve fitting to use(eg polynomial etc that is used in Excel) to best fit a curve to respective data?  
Q3)Let say, there is new information/data Eg dr=8.1, which does not exist in the data table  
a)how could it be used to interpolate to find out the values of v\_max and v\_allow that correspond to dr = 8.1 based on the best fitting curve?

---

<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:** [February 8, 2018, 2:18pm UTC](https://forum.inductiveautomation.com/t/issue-with-dropdown-menu/16885/6 "2018-02-08T14:18:44Z")

</div>

[quote=“liau.kwongweng, post:5, topic:16885”]  
Q1) Wonder how is it possible to generate a plot of two curves on the same graph based on the data (Eg the data table as shown the picture in post 2 above)?1)first curve is v\_max(y axis) versus dr(x axis)2)second curve is v\_allow(y axis) versus dr(x axis)[/quote]  
Use the Classic Chart in XY Plot mode. Place your x-axis data in the first column of your dataset, then the remaining columns will be y-axis.

[quote=“liau.kwongweng, post:5, topic:16885”]  
Q2)is there any curve fitting to use(eg polynomial etc that is used in Excel) to best fit a curve to respective data?[/quote]  
No, you’ll have to do it in a script with your own curve fit equation. The script would generate many values in a dataset for the chart to display, enough to make the line segments show the curvature.

---

<div class="post-metadata">

**Author:** ![liau.kwongweng](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@liau.kwongweng](https://forum.inductiveautomation.com/u/liau.kwongweng)\
**Post date:** [February 9, 2018, 7:33am UTC](https://forum.inductiveautomation.com/t/issue-with-dropdown-menu/16885/7 "2018-02-09T07:33:14Z")

</div>

Hello @pturmel  
Thanks for kind reply  
Had done it using Chart using two data sets  
1)Data - v\_allow versus dr (using the SQL query SELECT dr, v\_allow FROM test\_ignition\_table)  
2)Data2 - v\_max versus dr (SELECT dr, v\_max FROM test\_ignition\_table)  
So on the Y-axis tab(on the Chart Customizer), there is v\_allow and v\_max

Now the question is, there is two axis shown on Y-axis and both axis are scaled differently, so the curves does not look proportional to each other so much so that at around dr=6.0++, the two curves seem to be touching each other but in actual fact, should not be the case.

Q1)Hence is there any way to scale both axis correctly?  
Q2)Is there anyway to just use one Y-axis but able to plot out the two curves  
(v\_allow versus dr) and (v\_max versus dr) whereby the values of v\_allow and v\_max are almost within the range of each other(difference could just be at most 4-5)?

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/deb0a7a0370e054cb395c9f68c74a62328393991.png)

Thanks so much for any advise/help

---

<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:** [February 9, 2018, 1:20pm UTC](https://forum.inductiveautomation.com/t/issue-with-dropdown-menu/16885/8 "2018-02-09T13:20:18Z")

</div>

Yes to both questions. Either change the plot datasets to use the same y\_axis, or combine your data into one dataset:

```auto
SELECT dr, v_allow, v_max
FROM test_ignition_table

```
