<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />I'm trying to run a Col Rank formula on a "BLOCKERASECYCLE" column and then output the result to a new column "TEMPCOLUMN"
However it runs Col Rank even on rows that I hide and exclude (rows are not "VERSION1").
How can I get Col Rank to skip rows that I hide and exclude (non "VERSION1" rows)?
BLOCKERASECYCLE_COL = Column("BLOCKERASECYCLE");
foundrows = dt << Get Rows Where(:PART_VERSION=="VERSION1");
dt<
dt<
dt<
dt<
dt<
dt<Re: how to exclude rows from Col Rank formula in JSL?
Thanks, replacing the last statement with this new one is able to ignore the excluded rows:
dt<Re: how to exclude rows from Col Rank formula in JSL?
Hi, Steve.
The following formula will calculate the rank for only un-excluded rows:
Col Rank(If(Excluded(), ., :height))
You can verify that the formula is correct by running a Distribution on your BLOCKERASECYCLE column and then save the ranks (red triangle > Save > Ranks). This will generate a new column that contains the ranks for un-excluded rows, which you can compare to the formula column. Of course, you could just use the Distribution platform to generate the rank column in the first place, as well.
Hope that helps.
Wendy
Try this. A bit klugy but it works
dt = current data table();
foundrows = dt << Get Rows Where(:PART_VERSION=="VERSION1");
nv1 = nrows(foundrows);
dt << New Column( "TEMPCOLUMN", Numeric,
Formula( if (:PART_VERSION != "VERSION1", Col Rank( :BLOCKERASECYCLE ) - nv1 ) ) );