Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to compare two number fields. One number comes to me as #,### the other #,###.## So I also need to format these to read the same.
if (num((Sum(BUDGET_AMT) / count(PROJECT_ID)), '#,###,###,#00') <> num(Sum(BH_AMOUNT_BUD), '#,###,###,#00'),MasterKey)
No error and way too many results.
To format a number doesn't changed the value. This means - if this kind of adjustment is really needed for your data/results - you need to convert them - maybe per num#() - or to cut them - maybe per left/right/mid() or (probably more suitable) to round them - per round/floor(ceil(). I think I would use something like this:
if(floor(Sum(BUDGET_AMT) / count(PROJECT_ID)) - floor(Sum(BH_AMOUNT_BUD)), MasterKey)
You might need to use a different rounding-function and/or specifying the needed number of digits for it.
- Marcus
A question.
Do those numbers come in a number format (if you multiply them by 1 gives you the same number)?
If so, you should not have problems comparing them. 1,234 = 1,234.00 -> true.
if they come as text,
you should delete the characters that make the separation of thousands and pass it to decimal with the format you want
To format a number doesn't changed the value. This means - if this kind of adjustment is really needed for your data/results - you need to convert them - maybe per num#() - or to cut them - maybe per left/right/mid() or (probably more suitable) to round them - per round/floor(ceil(). I think I would use something like this:
if(floor(Sum(BUDGET_AMT) / count(PROJECT_ID)) - floor(Sum(BH_AMOUNT_BUD)), MasterKey)
You might need to use a different rounding-function and/or specifying the needed number of digits for it.
- Marcus
Rounding that is the ticket! Thanks!