Avatar of Will
Will
Flag for United States of America asked on

Looking to get a count of procedural steps in an sql view

I am doing a rank over partition in an attempt to get a unique count of procedural steps.  the problem is the partition field is not unqiue, and I am trying to increment the step:  Here is a sample from the data:

Sample Data
the approach I am using is:

case when Type='Procedure' then rank() OVER (partition by Type ORDER BY ActionDate) end as PSeq, 

Open in new window


I understand why the 5 is repeating because I am using actiondate and the two dates are the same.

Any thoughts how I can get around this since the second 5 needs to be a 6.

Thank you!
Microsoft SQL ServerSQL

Avatar of undefined
Last Comment
Will

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Scott Pletcher

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Will

ASKER
Thank you
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck