Excel Spreadsheets as Datasource

   An Excel spreadsheet can be a data source for Instant Database data. Beginning with version 2016.2, it can also be a primary datasource in its own right.

  Location of Files: The 'default' location for Excel files as an IDB datasource is a folder called 'Excel' directly beneath IDB records folder. (To determine the current IDB Files Folder, click link.)

However, you can place your Excel files folder in any convenient location of your choosing. To set that location, follow these steps:

navigate to the Excel tab in the All Settings window (Pathagoras Features | Utilities & Settings | All Settings). Here is the screen you will see:

Click to enlarge.

 

    When the Instant Database Screen is displayed, the 'regular' records are gathered and displayed in the Existing Records dropdown. But click the Show .xlsx button and the section is transformed . . . .

Click to enlarge.

. . .  the Existing records box turns green (Excel's 'brand' color) and

Click to enlarge.

. . .  only the records in the Excel folder selected in step 1 are show. Select it and Pathagoras accomplishes two more steps. (1) Pathagoras determines whether the record is a simple 2 column record or a more elaborate spreadsheet with named fields. If the later, Pathagoras presents the names of the Named Fields in the left column and the values that reside in those named fields in the right column.

 

    Any new variables in the document that did not exist in the .xlsx file will be appended to the bottom of the new record (just like with 'regular' records).

 

Notes:

There is no 'write back' capability to the source Excel file. (You can, of course, save the data to a new IDB record. Indeed, this is the better choice since you likely will be adding variables to the record over time.)

Rules:

If the style of the spreadsheet you are reading is simple (that is, two columns, with the variable name in column A and the variable value in Column B, or two rows, row 1 being variables and row 2 their corresponding values), just about an value can be used in either column. (There may be exceptions, but none that we know about at this writing.) You don't even need the brackets indicating that column A (or row one) is a [variable]. Pathagoras will add brackets automatically.

However, if your spreadsheet contains named cells, a few special rules apply. Named cells allow you greater flexibility in the layout of the spreadsheet, but Microsoft imposes some rules that Pathagoras -- and you - must observe.

Named Cells issues:

If a spreadsheet has even one named cell, Pathagoras will see it as a 'named cell spreadsheet.' That means if you intended a 'simple' (two column) structure of data and have 100 separate rows of data, but accidentally have created, or left in, a single named cell, that single cell will trump the 100 rows of data. So, if you are getting strange results, check the spreadsheet for named cells and delete them. (In later versions of Pathagoras, you will be able to tell Pathagoras to ignore named cells.)

The 'name' of a named cell in Excel can contain only letter (a to z) and numbers, and an underscore. No spaces or special characters. If your Named cells contain the '!' mark signifying a group name or the '@' sign used by Pathagoras for incrementing variables (e.g., [Child@1 Name]; [Child@1 Name DOB], you will discover that Excel (not Pathagoras) replaces those symbols with an underscore. (Spaces will be replaced with underscores as well).

Ancillary to the above bullet, you should not try to use mimic in Excel Pathagoras' 'fancy' Instant Database tools (e.g., multiple choice variables and !groups!) in your spreadsheets. They won't work there, and the conversion back to Word may not be pretty. Use Excel tools to perform Excel calculations, but feed the results back to Word/Pathagoras using simple variable names.

EXCEPTION: As part of the Excel to IDB conversion process, Pathagoras will look for a pattern of 'text underscore #" (e.g., "Child_1_Name"). If detected, Pathagoras will replace the underscore preceding the number with a '@' sign. So while the name of the Excel cell might have to be [Child_1_Name], Pathagoras will convert it to [Child@1 Name]. So don't hesitate to assign your incrementing variables to named Excel cells.

Pathagoras will, by default, alphabetize the results when it reads a spreadsheet of named cells.

Created with Help & Manual 7 and styled with Premium Pack Version 2.70 © by EC Software