Pat Posted January 25, 2011 Posted January 25, 2011 Hello! I have a calculation which takes a supply on hand, and subtracts a daily use amount by day. How do I stop it from subtracting once the supply runs out? To make matters more complicated, the calculation already uses an 'and' statement, as two other variables are involved (ie in A = a certain value, and B = a certain value, then do this calculation). I can't add another 'and' to an 'and' statement, eg if A = certain value and B = certain value and self is < 0, then 0. Hope this makes sense. Thanks for any help you can give me. Pat
comment Posted January 25, 2011 Posted January 25, 2011 Hope this makes sense. Hope springs eternal, but... I would think that if someone records using a non-existing resource, then it's not the calculation's fault. In any case, there's no reason why you couldn't add together several statements using multiple AND operators.
Pat Posted January 25, 2011 Author Posted January 25, 2011 Hi which is your actual calculation ? here it is: Case ( RXUsagePattern__lxt = "acute-regular" and not IsEmpty ( TotalDailyQuantity__lxn ); OnHandQuantityCount__lxn - ( TotalDailyQuantity__lxn * (Get ( CurrentDate ) - DateOfQuantityOnHand__lxd)); RXUsagePattern__lxt = "acute-regular" and not IsEmpty ( TotalWeeklyQuantity__lxn ); OnHandQuantityCount__lxn - (TotalWeeklyQuantity__lxn * ((Get ( CurrentDate ) - DateOfQuantityOnHand__lxd) / 7 )); RXUsagePattern__lxt = "chronic-regular" and not IsEmpty ( TotalDailyQuantity__lxn ); OnHandQuantityCount__lxn - (( OriginalRefillNumber__lxn - NumberRefillsInOnHandQuantity__lxn) * PrescribedQuantity__lxn) - (TotalDailyQuantity__lxn * (Get ( CurrentDate ) - DateOfQuantityOnHand__lxd)); RXUsagePattern__lxt = "chronic-regular" and not IsEmpty ( TotalWeeklyQuantity__lxn ); OnHandQuantityCount__lxn - (( OriginalRefillNumber__lxn - NumberRefillsInOnHandQuantity__lxn) * PrescribedQuantity__lxn) - (TotalWeeklyQuantity__lxn * ((Get ( CurrentDate ) - DateOfQuantityOnHand__lxd) / 7 )); "" )
Recommended Posts
This topic is 5109 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