1 of 1 people found this helpful
Would this work ?
Flag (<--- title of your calculated field)
if [procode] > 0100 and [procode] < 01999 then "ANES" else "Not ANES" END
Do you need to consider the A and E at the beginning ?
What I'm asking is if there's E00123 and A00123 would they be different groupings or the same ?
In your pseudo code of 100 - 1999 range, is it only the number that is unique ?
CPT codes are 5 character long. Each code is unique. "00000" to "99999" are possible, then you have a letter followed by four numbers, example "A4595", etc. For anesthesia codes, since the codes are sequential, I can trick SAS into looking at
proccode IN (00100:01999) as numbers, and it flags the range for me.
So maybe the answer is to convert the numeric looking the CPTs to numeric and use the between function, or an if statement like Peter suggested above. Any other ideas welcome.
Is there such thing as an IN operator for Tableau?
I don't think we have IN operator in Tableau. the easiest way is to convert codes to integer and do range comparison.
int(proccode)>=100 and int(proccode)<=1999
Thanks, Ankit. Props to you and Peter Fakan.
I agree, converting that column from character to numeric and dealing with it as such, is the approach here.