You can add a formula directly within a Search-Driven Analytics search. Some common reasons for using a formula in a search are to perform mathematical functions, check for and replace null values, or add if...then...else logic.
From the list of documentation about formulas, select the relevant topic.