TaiChi56 Posted October 6, 2012 Posted October 6, 2012 I have a portal that filters records for students absences. Two fields that are important are "Credit" and "Abs_count" Credit is either 1 or .5 Abs_count is the total absences over a certain allowed amount. 1 credit = you are only allowed 18 absences .5 = you are only allowed 9 absences I am trying to do a calculation that will look at the credit field and see if it is "1" or ".5" then take the appropriate number either "18", "9" and subtract from the total abs_count. I have looked a IF statements and Case and having a problem with both. I made a field called "MakeUpHours" Case ( Get ( Credit ) = 1 - (abs_count) = Sum Get (Credit ) < 1 - (abs_count) = Sum ) As you see I am a complete newbie with calcualations. Can you point me in the right direction? Thank you.
LaRetta Posted October 6, 2012 Posted October 6, 2012 Try: Case ( AbsCount ; Let ( deduct = Credit * 18 ; AbsCount - deduct ) ) I wrapped with case so that it would not evaluate unless there was a value. If your business rules require a different result If one or both fields are empty, let me know. :-) Or without the Let() since it really isn't needed: Case ( AbsCount ; AbsCount - Credit * 18 )
LaRetta Posted October 6, 2012 Posted October 6, 2012 I should explain if you are very new to calculations ... deduct is not a field - it is a declared variable we are using only within this calculation. you might want to use my second calc since it is clearer and more efficient. AbsCount and Credit are fields.
TaiChi56 Posted October 6, 2012 Author Posted October 6, 2012 You are fantastic. It worked perfectly. Thank you.
Recommended Posts
This topic is 4488 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