在下面的示例中,我使用数据过滤器来限制数据,并在 GraphBuilder 脚本中使用本地数据过滤器来进一步限制数据。
绘制了 3 个不同的排名。
- 第一个排名公式(蓝点)没有 Excluded() 参数,因此所有被(全局)数据过滤器排除的数据点都会被计数。 这就是为什么第一个绘制的条目已经以高值开始。
- 第二个排名公式(红色)具有 Excluded() 参数,因此某些行不计算在内,并且排名值较低。 但它们仍然不是从 1 开始的。 这是很清楚的,因为公式存储在数据表中 - 并且不知道被绘图的本地数据过滤器排除的行。
- 第三个 Rank 公式与第二个相同,但它用在图“内部”生成的 TRansform 列中。 不幸的是,这个公式也忽略了本地数据过滤器排除的行:
我必须应用哪种技巧才能使公式不忽略本地数据过滤器?

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 ) )
)}
)
)
)