Sometimes your data may not have all the pieces you need for your analysis. A common way to handle this is to create a calculated column [also referred to as a calculated field or just a calculation] that modifies the existing data. Calculations can be created by opening the Analysis menu and selecting Create Calculated Field...
It's important to note that there are often several different ways to achieve the same results for a calculated field. Additionally, the correct value of a calculation may depend on how the data is shaped and how the visualization is set up. Make sure you understand your data structure and how the viz will be built when determining how to write a calculation.
Examples of when a calculation might be useful
Combine first and last name
You may have First name and Last name in two different columns and want a single field for name.
The calculation:
[First name] + " " + [Last name]
A finished viz might look like this
Find a sequence inside a string
You may want to flag every record that has a certain manufacturing code XYZ in the Product ID field.
The calculation will return "true" if the code is present and "false" if not.
CONTAINS[[Product ID}, "XYZ"]
A finished viz might look like this, with the calculation on Color.
Assign categories for value ranges
You want to assign categories based on several thresholds.
The calculation will evaluate each student's GPA against the cutoff value and assign a label.
IF [GPA] Number
Format.
In the Default Number Format dialog box, set the format to Currency [Custom] and the Decimal places to 0.
Format the 2014 measure the exact same way.
Format the YOY Pct. Change field as Percentage, with 2 decimal places.
Build the view
Drag 2013 to Text on the Marks card.
Double-click 2014 and then YOY Pct. Change.
Drag Measure Names from Rows to Columns.
Drag Sub-Category to Rows.
Your view should now look like the one at the beginning of this section.