New "contains" calculation for Text Calculations

 

You can now add in a text or option calculation to specify if the answer to a question contains specific characters or words

You can now add in a text or option calculation to specify if the answer to a question contains specific characters or words

The image in the example here shows that the activity at the time of injury can be selected as "Running" or "Running with Ball". To determine if "Running" (either Running with or without the ball) is the activity at the time of injury, you can now use the "contains" function in a Text Calculation or an Option calculation.

Performing a "Contains" search will return 1 (True-search term met) or 0 (False- search term not met)

Writing a Contains Calculation

A contains calculation is written as follows:

contains (Field Name, "Search term"), e.g. contains( Activity at Time of Injury, "unning")

N.B. we have used "unning" NOT Running as the search is case sensitive and running is written in both upper and lower case in the Activity at Time of Injury Field.

The Contains Raw Output

The output for a contains field is:

1= True

0= False

oOu can also use the Contains in an If/Then equation to return text or options

oOu can also use the Contains in an If/Then equation to return text or options

The example in the image here shows that the contains is being used in a Text Calculation to return additional information (not just 1 or 0). The calculation will return "Running" if the Activity at time of injury had "unning" in it (as shown in the image in the step below).

The contains calculation returns "Running"

The contains calculation returns "Running"

 

Be careful of case sensitivity; you must type in the exact case of the word as the search will not return anything if it is not exact

The example here shows that "running" was added as the search term and not "unning", and it is NOT calculating correctly when "Running" is selected.

Make sure you test that you have set up the calculation as you require it.

 

0 Comments

Add your comment

E-Mail me when someone replies to this comment