You are here: Help Topics > Customization > Calculation > XWKS Function

XWKS Function

The XWKS function allows information from a cell in another CaseView document to be linked to a cell in the current document.

Syntax

XWKS("document identifier",cell number)

Document identifier is either

  • the identifier specified in the Document Manager, such as FS, or

  • an absolute file path to the document, like c:\test\testfileFT.cvw.

Cell is the cell number in the CaseView document being referenced.

This function also has a second format:

XWKS("path", "cell number")

Where path is the file path (including file extension) to a CaseView document. The path must be absolute starting with the drive identification (C:\or \\alpha).

Example 1

XWKS("FS","c233")

Returns the value of cell number c233 in the CaseView document with FS as the document identifier.

Example 2

XWKS("c:\Data\abcFT.cvw","c148")

Returns the value of cell number c148 in the CaseView document abcFT.cvw located in the folder c:\Data.

Notes

  • An easy way to link cells together is to use the nested formula:

    XWKS("FS",cellno())

  • The XWKS function should not be used to do cell referencing within a document. CaseView tracks cell references within a document, so that if one cell changes, all of its dependent cells are recalculated. Using the XWKS function breaks the chain of dependent cells preventing the program from properly recalculating cells. The LOOKUP function should be used. To see how to create a look up function, click here.
  • The XWKS function has been built to ignore inconsistent version numbers. In this way, calculations in a newly upgraded version of a CaseView document can still retrieve relevant data from other documents, even if they themselves have not been opened and converted.
  • When using XWKS, the current value saved in the external document is linked, but the document itself is not opened and refreshed. Consider as an example document 1/cell 1 links to the current year cash balance and is saved and closed. An adjustment is made in Working Papers which changes the cash balance. If document 2/cell 2 uses the XWKS function to link to cell 1, the linked value will not include the adjustment.
  • To carry this example one step further, caution must be exercised when using XWKS in conjunction with the document setting Changes due to Recalculations do not mark the document modified. In the example above, document 1 would need to be opened, which automatically recalculates the value in cell 1, marks the document as modified, and prompts for a save when it is closed. With this option enabled, the automatic recalculation does not mark the document as modified, and no prompt to save will appear. If the document is not saved when it is closed, the value of the cell, and hence the value linked through XWKS, will still not include the adjustment.

Related Topics