I have a dataset, TempSP, for a chart that is bound to SQL. Its columns are “StepNumber”, “Temperature”.
I need to bind a second dataset, TempSP_LL, that is “StepNumber”, (“Temperature” - 20).
The code below is the expression I have tried to use in the binding for TempSP_LL.
{Root Container.Root Container.R1P1.Chart.TempSP}["StepNumber",("Temperature"-20)]
It gives an error (Expected ‘Number’, found ‘String’).
Thank you for your help.
Hello,
I understand what you’re trying to do, but the Expression language doesn’t do that. Instead, you need to bind the second dataset to another SQL query like SELECT StepNumber, Temperature-20 AS NewTemp FROM MyTable
Hope this helps,
Ok. I was trying to limit the number of SQL queries. I will have many graphs that will include “+20” and “-20” lines.
Thanks.
Yeah, limiting the number of queries is always a good idea. Why don’t you simply run the query like this:
SELECT StepNumber, Temperature, Temperature + 20 AS HighLine, Temperature - 20 AS LowLine FROM MyTable
You don’t need a query per line for the chart component. Or, even better, use the Easy Chart - it’ll group queries together like that for you when it can.
Hope this helps,