search for the last two rows (by date) in Filemaker 19 - filemaker

I have a Filemaker solution that stores measurement data. For a comparison report, I want to extract only the current and the previous rows of a specific set, and export them to XML.
I can easily search, filter and sort them, but how do I tell Filemaker to limit the resultset to a fixed number of rows?

Here is a simple script that reduces the current found set to the last two records. It is assumed that you have already performed a find and a sort. Then you can do simply:
Go to Record/Request/Page [ First ]
Omit Multiple Records [ Get ( FoundCount ) - 2 ] [ No dialog ]

Add a selection field (selected=1 or unselected=0) and mark the last row and the previous row as selected, then do a search for selected field, export the elements you need, then mark all selection fields back to 0. All this executed from a simple script.

Related

Google Sheets QUERY returns non-matching records

In this workbook 1 the second, "DMK Recent" sheet is populated by a query that returns two records that do not meet the [C > date'2019-12-16'] criterion. These are the last two rows on the sheet. To make things more mysterious, those records display values in the C "Date" field that do not match the source data.
If I reduce the size of the source data, only correctly selected records are returned. Is there some source data size beyond which the QUERY() function loses its grip? Many thanks for any light on this.
your query formula:
=QUERY(xFRm!A5:X,
"select A,B,C,D,F,E,K,M,G,J
where C > date'2019-12-16'
and G='THB'
order by C,D", 1)
is is working flawlessly.
the culprits in your case are wrongly entered dates
go and fix rows 4539 and 4540

Adding the totals of two seperate tables in a word document

this question relates to adding the totals of two tables and using that total in the body of the word document.
In my case I have a word document (docx) with two tables. These tables are populated through a word merge process of third party software over which I have no control. For ease of reference I will refer to each table as table1 and table2. Both tables will contain an unknown amount of rows, but the last row, will always contain a total in the last column, which will total the rows above using the formula =SUM(ABOVE).
In the body of the document, I know need to reference the total of each table and because I do not know how many rows there are, I am at a loss. For example, if I knew how many rows there are, I could use the answer given here.
I have tried to using a merge field - with the column names as follows - however I get a !Syntax error ...
=SUM(table1[Amount]+table2[InterestAmount])
Any and all help greatly appreciated.
If you bookmark the two tables (e.g. TblA, TblB), you can use a formula field to tally their totals:
{=SUM(TblA C:C)/2+SUM(TblB C:C)/2}
The reason for the /2 is that, unless you know the last row # beforehand, you need to reference the entire column (including your existing totals row), the sum of which will therefore be twice the total.
To see how to do a wide range of calculations in Word, check out my Microsoft Word Field Maths Tutorial, at:
http://www.msofficeforums.com/word/38720-microsoft-word-field-maths-tutorial.html
or:
http://www.gmayor.com/downloads.htm#Third_party
Fields can be bookmarked in Word, then referenced elsewhere in the document. When bookmarking in a table, be careful to not select the entire cell, only the field! If the entire cell is bookmarked then the cell structures are carried across to the REF and the field content can't be processed numerically.
For three bookmarked fields with the names Fld1, Fld2and Fld3 that should be multiplied the combined field code would look like this:
{ = { REF Fld1 } * { REF Fld2 } * { REF Fld3 } \# "0.00" }
Note that you could also use the PRODUCT function (like SUM, but multiplies, each factor separated using the system's list separator character.)
Notes for readers not familiar with working with Word field codes: the paired wavy braces must be inserted using Ctrl+F9 and cannot simply be typed from the keyboard. Alt+F9 will toggle between field code and field result display. Press F9 to force a field to update.

Set Data Range on Filemaker after search

After searching on Filemaker, I get 100 search results. I would like to get last 10 record only. How do you set a script?
You can use the script step Omit Multiple Records and then enter the number of records you want to omit from the found set, counting from the active record.

jaspersoft print specific records from csv file

I have a Label set up in Jaspersoft Studio that references a data adapter file in CSV format. The csv file contains thousands of records. I want the end user to be able to select or key enter the "order no" for the specific records to print. If one order no is entered - record is found and printed. If ten order no's are entered - 10 records will print.
Thank You.
You could use Parameters to let user make input. But because CSV is not query language, you can use Field Expression in Data Source
Here's how to add Parameter
https://community.jaspersoft.com/wiki/using-report-parameters
And this is how to use Field Expression
https://community.jaspersoft.com/wiki/how-apply-parameters-csv-data-source
Detail: Filter by attribute:
In query dialog, you select Filter Expression tab and fill the field with code like this
$F{order_no}.equals($P{order_no})
This code will filter the csv row that has order_no field that equal to order_no parameters
Filter by multiple order_no:
JasperReport are allowed user to do some scripting in Java or Groovy (depending or their settings). So you can do more complicated task like split input into array and use it to search rows.
What I have in mind, are ask end user to seperate order_no by space and use this script to filter the data.
Arrays.asList($P{order_no}.split(" ")).indexOf($F{order_no}) > -1
I have not tested this code yet, but hopefully you get the idea. (Experiment with the script).

Perform analysis on last three values of a FileMaker dataset

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.
There are several ways you could approach this. A simple one would be to use a script to:
Show all records in the given table;
Unsort them (assuming they were entered in chronological order; otherwise sort them by creation timestamp);
Omit all records except the last three;
Get the value of a summary field defined as Standard Deviation of your value field;
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.