are you trying to find all Oil Sample records for a particular vehicle?
is gFindContent formatted with a value list that enters Vehicle ID's when you select a vehicle?
Hi Phil, sorry for very late reply. To be clearer, as an example, I am trying to display the results of the Iron content of every Oil Sample record for a particular vehicle. Same goes for Chromium, Nickel etc etc. What I have done is the following:
On a layout I have a dropdown menu with a value list of vehicle ID's. With a script, when a vehicle is selected, all the Oil Samples of that particular vehicle are in the found count. So far no problems here.
What I then want to do, is have another dropdown menu, where I can select say Iron, and in the chart it will display the IronContent for each Oil Sample for that vehicle. I have written a script for this (attached), but I know it is wrong and I know where it is wrong but I think I need to change my relationships for it to work.
The Set Field needs to be set to something general that covers all the metals instead of just WearMetals::Iron, however I don't know how I can do this. All of the metals fields are under the Oil Sample table. Do I need to create a new table just for these fields and have a relationship to Oil Samples?
Thanks a lot.
How is, for example, the "iron content" recorded? Is this a value in a specific field for iron content or is it recorded differently than that?
"iron content" is a field ( called WearMetals | Iron ) in the Oil Samples table. The value of the iron content for a certain oil sample is just entered into that field on the layout.
"iron content" is a field
Then performing a find makes no sense as this will find records, not fields within the record.
Create a a set of charts, each one based on a different "wear metals" field. Place each chart in a different panel of a tab control. You can then select a chart for a specific metal by clicking it's tab.
Create a single chart that charts a calculation that uses the Case Function to return values from any of the "wear metals" fields based on a value in a selection field.
Case ( Table::gSelectedMetal = "Iron" ; Table::WearMetals | Iron ;
Table::gselectedMetal = "Aluminum" ; Table::called WearMetals | Aluminum
//and so forth...
You can then set up the global gSelectedMetal field with a value list for selecting a metal to see it charted.
Use a chart style such as a line chart and specify a different y-series for each such WearMetals field. This will chart all the metals on a single chart.
I have Option 3 already set up and working, but I am wanting to do exactly what you described in Option 2. Sorry but how do I set the chart up so that it "charts a calculation"? I wasn't aware you could do that.
The same place where you select a field as the data source for a y or x data series also has an option for selecting a calculation--which will open up the same specify calculation dialog that you have used in other contexts.
Thanks Phil! Works wonderfully! One more question, would I be able to display the average iron value on the same chart that is displaying the individual oil sample results for iron?
IF you want a horizontal line marking the average, I believe that you can define a second Y series and reference a summary field set up to compute the average to get that value. That will require adding a different summary field for each such field and then setting up another case function for this y-series similar to the first example.