在下面的示例中,我使用數據過濾器來限制數據,並在 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 ) )
)}
)
)
)