BusinessObjects Board

Totally lay person, formula formatting help

Hi,

Thank you for your assistance; I’m looking to format this formula so that it does NOT return a decimal point. Currently, it returns numbers like 25.0

I need just the 25

IF{cr_invoice;1.TYPE}=“ORDER” THEN CStr(DatePart(“ww”,{cr_invoice;1.INVOICE_DT}, crMonday))
ELSE " "


camper66 (BOB member since 2016-06-24)

The formula itself is not really the place to do that. Instead, right mouse click on the formula where it appears on the report canvas, select “format”, select the number tab and you should be able to change the decimal places, etc from there.


what’stheplandan :australia: (BOB member since 2016-03-07)

Thank you for the suggestion, however the “number” option is not available for this element, which is why I thought it needed to be done through the formula.
Number option.png


camper66 (BOB member since 2016-06-24)

It appears that it is a string. One way to do it is to use the left and instr functions.

i.e., left({somefield},instr({somefield},’.’)-1)


kevlray :us: (BOB member since 2010-06-23)

Just looked at your formula again (sorry, should have looked closer the first time). There are two ways to go:

  1. If you remove the CStr function you will return a number (and then my original suggestion will work).
  2. If you want a string returned, change the first line of your formula to:

IF{cr_invoice;1.TYPE}=“ORDER” THEN CStr(DatePart(“ww”,{cr_invoice;1.INVOICE_DT}, crMonday),“0”)

This will format that number with no decimal places.


what’stheplandan :australia: (BOB member since 2016-03-07)

Thanks very much mate


camper66 (BOB member since 2016-06-24)