TM1Web and Perspectives diff. on double quoted numbers

Post Reply
John Zhang
Posts: 9
Joined: Tue Jan 05, 2010 4:09 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2007
Location: Hong Kong

TM1Web and Perspectives diff. on double quoted numbers

Post by John Zhang »

There is a discrepancy observed on Excel formula behaviors in TM1Web and Perspectives regarding a number wrapped in double quote marks.

We tried to use IF formula to compare whether a simple number (say, a number 5) equals to a specific value. We found that in Excel the IF statement will return FALSE when the Type of Data (i.e. a "number" or a "text") is different. Whilst in TM1Web it will return TRUE even if we compare a number (say, 5) with a text (i.e. “5”). Some examples are given in below table.

Has any one else ever seen this behavior before? Advice on how to gracefully write Excel formulas for TM1Web to avoid this is also appreciated.

TM1 version: 10.1.1
Excel: 2003 or 2007
FormulaResult in ExcelResult in TM1Web
=IF(9=9, "TRUE", "FALSE")TRUETRUE
=IF(9="9", "TRUE", "FALSE")FALSETRUE
=IF(9.01=9.01, "TRUE", "FALSE")TRUETRUE
=IF(9.01="9.01", "TRUE", "FALSE")FALSETRUE
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: TM1Web and Perspectives diff. on double quoted numbers

Post by rmackenzie »

This might work:

Code: Select all

=IF(TEXT(A1,"@")=TEXT(B1,"@"),TRUE,FALSE)
That way its apples and apples. Note there's no need to quote the TRUE and FALSE outcomes otherwise you will be casting strings back to booleans.
Robin Mackenzie
blackhawk
Community Contributor
Posts: 136
Joined: Thu May 29, 2008 2:29 pm

Re: TM1Web and Perspectives diff. on double quoted numbers

Post by blackhawk »

Hmmm....that is interesting...have you tried this in 10.2.2 yet?
John Zhang
Posts: 9
Joined: Tue Jan 05, 2010 4:09 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2007
Location: Hong Kong

Re: TM1Web and Perspectives diff. on double quoted numbers

Post by John Zhang »

rmackenzie wrote:This might work:

Code: Select all

=IF(TEXT(A1,"@")=TEXT(B1,"@"),TRUE,FALSE)
That way its apples and apples. Note there's no need to quote the TRUE and FALSE outcomes otherwise you will be casting strings back to booleans.
Thanks Robin for the good code suggestion. What does the @ symbol do as placed in format parameter for TEXT function?

And yes, you are right, no need to add quote for TRUE and FALSE. That was just kept there when I replaced the original output texts.
John Zhang
Posts: 9
Joined: Tue Jan 05, 2010 4:09 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2007
Location: Hong Kong

Re: TM1Web and Perspectives diff. on double quoted numbers

Post by John Zhang »

blackhawk wrote:Hmmm....that is interesting...have you tried this in 10.2.2 yet?
Nope.... not yet. Anyone tried it please let us know.
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: TM1Web and Perspectives diff. on double quoted numbers

Post by rmackenzie »

John Zhang wrote:What does the @ symbol do as placed in format parameter for TEXT function?.
It's part of the syntax for custom number formats - in this case, it converts a number to a string. It's a bit like sticking an ' in front a number. For your problem, it is just saying compare text with text, not numbers with text which won't work, i.e. this is FALSE:

Code: Select all

="1"=1
But this is TRUE:

Code: Select all

=TEXT(1,"@")=TEXT("1","@")
Does this solve the TM1 Web problem? I don't know if TM1 Web will interpret all the different types of custom number formats that can be set in Excel itself.
Robin Mackenzie
Post Reply