This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help

Next Topic

Book Contents

Book Index

Derived literal variable

Derived Literal Variables are used to perform operations on other variables, the result of which will be stored as a string.

You can use any variable. If it is not a literal variable, it will be converted to a text representation and then used. You can also use pieces of text surrounded by quote marks (eg, "cat").

You can embed variable names in quoted text if they are surround by {} characters.

For example, if you wished to create a single field from someone's personal and family name to export to an external database you could create a derived variable and load it with the personal and family name data, separated by a space. If the person's family name ("Jones") is stored in a variable fname, and their personal name ("Jenny") is stored in a variable pname,
"{pname} {fname}" would give Jenny Jones (with a space between the two names)

Derived literal variable definition

The fields for a Derived Literal Variable generally follow the same rules as described earlier in this section, with the exception of the following:

There is no source or length field as the variable refers to other variables that have their own source and length.

Valid value

A literal expression

Valid values include:

"{Q1b}: {Q6}" where Q1b is a time and Q6 is a literal

"{Q6} complete" where Q6 is a literal and the text " complete" is appended

You can also connect different pieces of text together using the : character. This allows you to insert the characters "{" and "}" into your text. For example, if you wished to produce the text Jenny {Jones}, you would have to use the value pname:" {":fname:"}".

See Also

Derived single variable

Derived multiple variable

Derived quantity variable

Derived date variable

Derived time variable