8 Replies Latest reply on Jun 13, 2012 12:37 AM by jo.cheaney

# Another calculation query - finding spaces

Hi

If anyone could kindly help I'd be most grateful.

I need to find mobiles numbers that have spaces in so I can delete them as they are entered as 0787 121212

Many thanks

• ###### 1. Re: Another calculation query - finding spaces

Joe,

Please try creating the following calculated field and placing it in the Rows Shelf:

if FIND([Mobile Number], ' ',1) > 0 then

[Mobile Number]

else

null

end

-Matt

• ###### 2. Re: Another calculation query - finding spaces

Hi Matt

I copied and pasted your answer as below - and I get the calculation contains error.

if FIND([Mobile Number],' ',1) >0 then [Mobile Number]else null end

Thanks

• ###### 3. Re: Another calculation query - finding spaces

My apologies Jo, the dimension "[Mobile Number]" needs to be replaced by the dimension in your data source which has the phone numbers. I put "[Mobile Number]" as a reference dimension.

-Matt

• ###### 4. Re: Another calculation query - finding spaces

Hi Matt

if FIND([MobileTelephone], ' ',1) > 0 then [MobileTelephone]else  null end

I then get an error in the formula and when you click on help it says, the formula must be a boolean formula

• ###### 5. Re: Another calculation query - finding spaces

Jo,

Will you be able to upload a packaged workbook (.twbx)?

-Matt

• ###### 6. Re: Another calculation query - finding spaces

Hi

Probably not due to security of data.

Jo

• ###### 7. Re: Another calculation query - finding spaces

Jo,

I believe I have figured out the problem. The code I provided was to create a new calculated field (right click dimension and select "Create Calculated Field").

A Boolean error could be that the code is being used to create a formula condition filter. If so, the code to use for a condition formula would be "FIND([MobileTelephone], ' ',1) > 0".

I have provided an example workbook that uses both options.

• ###### 8. Re: Another calculation query - finding spaces

Hi Matt

Thank you so much.  It works now.

Jo