Page 1 of 1

Weird space issue in rules

Posted: Fri Mar 19, 2010 12:36 pm
by Steve Rowe
Just wanted to put this out there as I've just had a problem that's taken me a while to track and caused a little bit of head scratching.

I was refering to a hardcoded element in rules in DB statement, but the DB statement would not make the link to the cube.
I copied the reference in the rule and the element from the dimension side by side in Excel and visually they were identical.
The one from the rule however produced a key error, where as the one from the subset did not.

It's only when I compared the reference on a character by character basis that I discovered one of the spaces in the bad name from the rule was ASCII code 160 rather than the normal 32. I don't have the first clue how this happened but just in case anyone else hits it.

Cheers

Re: Weird space issue in rules

Posted: Fri Mar 19, 2010 2:13 pm
by Michel Zijlema
Hi Steve,

I recently ran into the same thing when the Trim function failed to remove two preceeding 'space' characters from a field in a statistics file pulled from a website. Also here the space appeared to be character 160 instead of 32.

Michel

Re: Weird space issue in rules

Posted: Fri Mar 19, 2010 3:10 pm
by John Hammond
I have had the exact same problem: This seems to occur when you cut and paste between excel and SQL server.

Another problem of non obvious lookalikes is the dash and the em-dash which has given me hours of fun!

Re: Weird space issue in rules

Posted: Fri Mar 19, 2010 7:40 pm
by Alan Kirk
Steve Rowe wrote:Just wanted to put this out there as I've just had a problem that's taken me a while to track and caused a little bit of head scratching.

I was refering to a hardcoded element in rules in DB statement, but the DB statement would not make the link to the cube.
I copied the reference in the rule and the element from the dimension side by side in Excel and visually they were identical.
The one from the rule however produced a key error, where as the one from the subset did not.

It's only when I compared the reference on a character by character basis that I discovered one of the spaces in the bad name from the rule was ASCII code 160 rather than the normal 32. I don't have the first clue how this happened but just in case anyone else hits it.
Ah, the dreaded non-breaking space, usually picked up from copying a web page. It's caused me grief in VBA/Excel application programming in the past as well, particularly for apps intended to manipulate data within a worksheet. But I agree that I've never seen it raise its head in a rules statement before!