In the below example, I use a Data Filter to restrict the data - and a Local Data Filter inside the GraphBuilder Script to further restrict the data.
3 different Ranks are plotted.
- The fist Rank formula (blue points) doesn't have an Excluded() argument and therefore all the data point which are excluded by the (global) Data Filter are counted. This is why the first plotted entry already starts at a high value.
- The Second Rank formula (red) has an Excluded() argument, therefore some rows don't count and the Rank values are lower. But still, they on't start at 1. This is clear because the Formula is stored in the Data Table - and doesn't know about the rows which are excluded by the Local Data Filter of the Plot.
- The third Rank formula is the same as the second one, but it is used in a TRansform Column which is generated "inside" the Plot. Unfortunately, also this formula ignores the rows which are excluded by the Local Data Filter:
Which Trick do I have to apply such that the Local Data Filter is not ignored by the Formula?

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Data Filter( Add Filter( columns( :height ), Where( :height >= 65.815 ) ) );
dt << Graph Builder(
Transform Column( "Rank[height] 3", Formula( Col Rank( :height, Excluded() ) ) ),
Variables(
X(
:name,
Order By( :"Rank[height]"n, Ascending, Order Statistic( "Mean" ) )
),
Y( :"Rank[height]"n ),
Y( :"Rank[height] 2"n, Position( 1 ) ),
Y( :"Rank[height] 3"n, Position( 1 ) )
),
Elements( Points( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 14 ) ) ),
Local Data Filter( Add Filter( columns( :height ), Where( :height >= 65.815 ) ) ),
SendToReport(
Dispatch(
{},
"Rank[height]",
ScaleBox,
{Min( 0 ), Max( 42 ), Inc( 5 ), Minor Ticks( 0 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
14,
Level Name(
1,
"Rank[height, Excluded]",
Item ID( "Rank[height] 2", 1 )
),
Level Name(
2,
"Rank[height, excluded] Transform Column",
Item ID( "Rank[height] 3", 1 )
),
Properties( 1, {Marker Size( 20 )}, Item ID( "Rank[height] 2", 1 ) )
)}
)
)
)