[TI] Round, Truncate

Post Reply
Jonsulli
Posts: 39
Joined: Tue Jan 04, 2011 3:42 pm
OLAP Product: TM1
Version: 9.5
Excel Version: 2003

[TI] Round, Truncate

Post by Jonsulli »

Hello,

2 questions about TI,

- How can I truncate with turbo integrator ?
- How can I round data to export it ? for example I want a csv file with 2 decimals.

Many thanks for you help,

Jon
Jonsulli
Posts: 39
Joined: Tue Jan 04, 2011 3:42 pm
OLAP Product: TM1
Version: 9.5
Excel Version: 2003

Re: [TI] Round, Truncate

Post by Jonsulli »

For the Rounding, I used roundp(formula,2) into a rule before exporting so now I have almost figures with 2 decimals but some look like : xx.9999999999 or xx.00000001 anyway to truncate it ?
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: [TI] Round, Truncate

Post by tomok »

TM1 uses the equivalent of the SQL Float data type. I believe, and sometimes numbers that go in as 1 end up in the cube like .99999999999 or 1.000000001. There is no way to remedy this in the cube. You have to account for it in your report formatting. If you export the data by right-clicking on the view or cube and choose Export, you can't do anything about it either. However, if you export the data through TI you can alter the formatting of the output with the NumberToStringEx function.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Alan Kirk
Site Admin
Posts: 6667
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: [TI] Round, Truncate

Post by Alan Kirk »

tomok wrote:However, if you export the data through TI you can alter the formatting of the output with the NumberToStringEx function.
Or, if you want no formatting at all (such as if it's going to be reimported into another system) the Str() function.
"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.
Jonsulli
Posts: 39
Joined: Tue Jan 04, 2011 3:42 pm
OLAP Product: TM1
Version: 9.5
Excel Version: 2003

Re: [TI] Round, Truncate

Post by Jonsulli »

Ok so I want to reimport the csv file into another system so I used Str() function into the variable process as : V8=STR(Value,0,2) and it looks good :)

I find out how to truncate, this is the SUBST function as Susbstring... (shame on me :oops: ...)
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: [TI] Round, Truncate

Post by tomok »

Jonsulli wrote:Ok so I want to reimport the csv file into another system so I used Str() function into the variable process as : V8=STR(Value,0,2) and it looks good :)
You really should do:

STR(ROUNDP(Value,2),0,2)

Just using the STR function alone will truncate everything to the right of the specified decimal point where you probably should round it first, then truncate and export.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Jonsulli
Posts: 39
Joined: Tue Jan 04, 2011 3:42 pm
OLAP Product: TM1
Version: 9.5
Excel Version: 2003

Re: [TI] Round, Truncate

Post by Jonsulli »

Ok I will try STR(ROUNDP(Value,2),0,2) thanks !
I notice another problem if I use V8=STR(Value,30,2), I have a lot of space chars so to resolve the problem I do V8=STR(Value,30,2) then V9=TRIM(V8); It looks OK no more space chars
Post Reply