The filter code below is supposed to limit the number of rows in an exploration to 5. First up, do you agree the code is correct? Why do I ask? Because it works on one pc but not on another....very strange. That is, I get more than five rows on one pc and only five on another. Any thoughts appreciated as to what could cause the difference.
Filter = c > 100;
/// output only n-recent true filter occurrences
n = 5;// set N most recent filter occurrences
cum_filt = Cum(Filter);
Filter = Filter AND cum_filt >= Max(1,LastValue(cum_filt)-(n-1));
When posting code that is not your own you are supposed to give credit to original author.
These are forum rules.
You need to teach your "friend" NOT to remove copyright notes and @link statements from original formula taken from the forum.
People like @fxshrat spend time writing code for free - show some respect and appreciation to those who actually give their time to others and at minimum acknowledge original author, click on "heart" to like their post and mark post as "solution". This takes less then a second.