Let’s check some scenarios where we can use SELF operator with Previous function.
- Example 1. If we want to populate a specific sequence or series
=3 + Previous(Self)
We can use any calculation such as =3 +1.5* Previous(Self).
- Example 2. Showing concatenated values
A slight change in arrangement- reset on Country name.
- Example 3. Now, consider a business requisite.
Issue here is absence of Target values for each date. Since for few dates, target value is not present, we could not compare Sales value and suggest a color-code for those dates.
Business informs that when we do not have Target for any Date, pick the last available target.
So, Target for 9/17/15 will be 75 for USA.
Here SELF operator becomes helpful to pull targets from previous values.
We are adding a updated target column with formula as:
=If IsNull([Target]) Then Previous(Self;([Country])) Else [Target]
If target is null for a specific date, it will go to previous dates and pull last available target value.
(In this case, we have sorted Date in ascending order.)
Now we we compare Sales with updated target, everything looks good as expected.
(for this example to work fine, first row should have a target value that will be pulled down.)
Let us know how you are using SELF operator.