Perform analysis on last three values of a FileMaker dataset

99封情书 提交于 2020-01-06 17:59:19

问题


My end goal is to have a box change color when the last 3 records input into a field (based on the time of input) in FileMaker achieve a certain criteria (ex. variance < 2). I would like to know how to make this happen, or how a calculation/script can be written to only look at the last 3 records.


回答1:


There are several ways you could approach this. A simple one would be to use a script to:

  1. Show all records in the given table;
  2. Unsort them (assuming they were entered in chronological order; otherwise sort them by creation timestamp);
  3. Omit all records except the last three;
  4. Get the value of a summary field defined as Standard Deviation of your value field;
  5. Set a global variable/field to the square of the returned value.

Then use the global variable/field to conditionally format your "box".


If you don't want to use a script, you will have to define a relationship in order to get the last three values in the table, regardless of the current found set and/or sort order. Or you may use the ExecuteSQL() function for this.



来源:https://stackoverflow.com/questions/43793152/perform-analysis-on-last-three-values-of-a-filemaker-dataset

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!