Skip to Content

Totals for Tablets

Thanks Abhilash, I created a new formula, however, I am only getting a 0.00 when trying to get a total. Not sure what the issue is. Screenshot below is what the data look like when I do a 'browse data' in Crystal. My report only looks at certain medications and the dose for these medications is equal to a tablet. Like 100 tablets, 50 tablets, etc...I tried some other things but get an error that says 'the string is non-numeric'.

Here is what the data looks like:

Abhilash Kumar 7 hours ago

0

Hi Curt,

1. Change the code to (or create a new formula):

IF NumericText({ORDER_MED.QUANTITY})Then ToNumber({ORDER_MED.QUANTITY})ELSE0
uhjcr.png (4.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Feb 07 at 04:21 PM

    It looks like your quantity field actually has two parts - quantity and unit - and we need just the quantity. There are a couple of ways of doing this. Here's one:

    {@GetQty}
    Local Numbervar nAt := InStr({ORDER_MED.QUANTITY}, ' ');
    If NumericText(Left({ORDER_MED.QUANTITY}, nAt-1)) then
      qty := ToNumber(Left({ORDER_MED.QUANTITY}, nAt-1)
    else
      0

    Use this formula to get your total.

    -Dell

    Add comment
    10|10000 characters needed characters exceeded