Hi
I need help with a JMP formula.
I have to up count rows (1 to x) based on a value of a second column, which changes after a while. With each change the up count has to start with 1 again.
Value Kit ID Count
2.3 00047 1
0.9 00047 2
1.8 00047 3
0.3 00264 1
5.7 00264 2
3.2 00053 1
0.1 00053 2
0.9 00053 3
8.3 00053 4
I got them counted in total by using col number() or counted from 1 to the end by using Sequence(), but i cannot make the formula start couting from 1 again after Kit ID changed.
Anyone who can help me out?
Edit:
You could probably shrink to:
data want; set have; by kitid; retain count; count=ifn(first.kitid,1,sum(count,1); run;
Assuming your data is sorted:
data want; set have; by kitid; retain count; if first.kitid then count=1; else count=count+1; run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.