Neuronal Nerd Posted February 17, 2008 Posted February 17, 2008 My calculation is as follows: GetAsNumber (Appointment Type). I cannot figure out why my GetAsNumber function keeps returning negative values. For instance, the following text: Diagnostic Interview (90801) returns the value of: -90801 and I want it to return: 90801 Any ideas as to what I'm doing wrong? Thanks in advance!
The Shadow Posted February 17, 2008 Posted February 17, 2008 "(56)" means negative 56 in accounting. GetAsNumber apparently is interpreting that. You could try applying Filter first: GetAsNumber( Filter( Appointment Type; "0123456789"))
LaRetta Posted February 18, 2008 Posted February 18, 2008 Shawn, can you explain why you still used GetAsNumber()? Wouldn't Filter() by itself have produced the same thing in this instance? I thought originally it might be because many diagnoses can contain a decimal (DSMIV, for instance) but even that wouldn't make a difference in this situation; neither would minus. You simply don't do things without reason but I can't spot it and I want to understand! Can you help me out?
LaRetta Posted February 18, 2008 Posted February 18, 2008 (edited) Oh, well, leading zeros I suppose - if they should be dropped off. Edited February 18, 2008 by Guest
comment Posted February 18, 2008 Posted February 18, 2008 Filter ( "Diagnostic Interview (0123)" ; "0123456789" ) = "0123" GetAsNumber ( Filter ( "Diagnostic Interview (0123)" ; "0123456789" ) ) = 123 BTW: Abs ( "Diagnostic Interview (0123)" ) = 123
The Shadow Posted February 18, 2008 Posted February 18, 2008 Oh, well, leading zeros I suppose - if they should be dropped off. That's a good reason but I didn't even think it over - the original was returning a number type so I was just sticking with that. :
Recommended Posts
This topic is 6184 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now