Weird space issue in rules

Post Reply
User avatar
Steve Rowe
Site Admin
Posts: 2456
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Weird space issue in rules

Post 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
Technical Director
www.infocat.co.uk
User avatar
Michel Zijlema
Site Admin
Posts: 712
Joined: Wed May 14, 2008 5:22 am
OLAP Product: TM1, PALO
Version: both 2.5 and higher
Excel Version: 2003-2007-2010
Location: Netherlands
Contact:

Re: Weird space issue in rules

Post 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
John Hammond
Community Contributor
Posts: 300
Joined: Mon Mar 23, 2009 10:50 am
OLAP Product: PAW/PAX 2.0.72 Perspectives
Version: TM1 Server 11.8.003
Excel Version: 365 and 2016
Location: South London

Re: Weird space issue in rules

Post 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!
Alan Kirk
Site Admin
Posts: 6647
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Weird space issue in rules

Post 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!
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
Post Reply