File Dataview will prompt for information about the file as specified on the initial screen, starting with the Records tab.

All Records and Fields for a Flat File are entered manually.

Statelake forces all record names and field names to uppercase for consistency across all definitions.

image-20240408-020522.png

Fields

Field Name

Description

Record Details Name

The Name of the record. This will become the name of the dataview.

Record Position

An integer that is used to manage the sequencing of records at the same level within the file where there are multiple dataviews for the definition. The default value is zero (0).

Where there is more than one ( 1 ) dataview, the dataviews must hold a different and unique Record Position within the definition.

For instance there could be three ( 3 ) dataviews - A, B, and C. So rather than have them in the natural order of A-B-C, you could have them as B-C-A by specifiying the record position 3 for A, 1 for B, and 2 for C.

Record ID

An alphanumeric field that accepts both upper and lower case. Used as the level separator within the Flat File, to identify a group of data to keep together.

This field can be left blank if not required.

Create separate file for each record

Tick this box to create a separate file for each individual record.

Buttons

Button Name

Description

OK

Click to save any changes you have made. All changes will be lost if you do not click the OK button. Add your fields via the Fields tab before clicking this button.

Cancel

Click to Cancel any changes you have made.

In this example, the Name used was NEIGHBOURS. If you only have one ( 1 ) dataview for this definition, then all you need is to enter the Name before specifiying the fields,

image-20240409-223355.png

However, if there will be more than one ( 1 ) dataview for this definition, then you will also need to populate the Record ID field, to separate the header records from any line records. Header records could be purchase order details, with the line records being the purchase order contents. Or header records could simply be a list of friends and relatives to be sent Christmas cards, while the line records could be the dates and years that cards were sent. There can be as many different “lines” as you require - but all the header records must have an identifier that envelops those records and groups them together, as must each lot of line records.

So using the dataview NEIGHBOURS as the example, this will be a list of all the local neighbours with their relevant associated details - and this group of records will be identified by the Record ID of X.

image-20240429-213837.png

Continue to process the fields required, and save the dataview. All records in your Flat File that are identified as belonging to this group, will be made available to this dataview query.

The next dataview for this example definition is called FRIENDS. This will be a list of friends and their nicknames - and this group of records will be identified by the Record ID of B.

image-20240429-230040.png

Continue to process the other fields required and save the dataview. All records in your Flat File that are identified as belonging to this group, will be made available to this dataview query.

The data in the Flat File for this definition, would record this Record ID value in the first position of each line, such as the example below.

image-20240429-230328.png

Add as many dataviews as you require - but each must have a unique Record ID,

Please review File Dataview - Preview Tab - Flat File Definitions for examples.