TM1 should display values in /1000 format.

Post Reply
Jlekkala
Posts: 5
Joined: Mon Jul 03, 2023 8:50 am
OLAP Product: IBM TM1
Version: 2.0.9.15
Excel Version: Version 2208 Build 1

TM1 should display values in /1000 format.

Post by Jlekkala »

Hello Everyone,

I need some help related to data formatting.
We re loading the data values form SQL, and data load is working as excepted.
Now user wants to see the values in TM1 in /1000 format.
Ex - of the cube view data is displaying as 4,880,505 - user wants to see value as /1000.
4880505 /1000 = 4881
I have updated the TI process with the below line of code
nValue1= nAmount1\1000; and by using cellputn i am loading the nValue into cube.
but the problem i am facing is, when i am adding that code, values are not matching, it seems may be because of dimension consolidation. i am attaching the dimension structure.
but with normal load values are matching.

please give me some idea.
Any custom format we can use? if so please suggest.
Thank you in advance.

--------------------------------------------------------

asciioutput('E:\TM1Data\CE DM\Extracts\financial'| vAdjType |''|vPostingPeriod|'.csv', vItem, vPostingLevel, vConsolidationUnit, vFunctionalArea, vProfitCenter, vFinDataVersion, vBrandFamily
, vProductType, vPLLine, vAdjustmentType, vPostingPeriod,NumberToString(vAmount),NumberToString(vAmount1));


vItem=SUBST(vItem,4,5);
vAccount='In'| vItem;
vConsolUnit=SUBST(vConsolidationUnit,4,4);
vFunctArea=vFunctionalArea;
vSKUMarket='In'|SUBST(vProfitCenter,6,5);
vBrand = vBrandFamily;
vAdjType=IF(StringToNumber(vAdjustmentType)<10,'000'|vAdjustmentType,'00'|vAdjustmentType);
vProfitCenter1=SUBST(vProfitCenter,6,5);
vProfitCenter = TRIM(vProfitCenter1);
vPostingPeriod=IF(StringToNumber(vPostingPeriod)<10,'M0'|vPostingPeriod,'M'|vPostingPeriod);
vValue=vAmount;
vValue1=vAmount1;

vMarket = ELPAR('CE DM SKU Market PLAN', vProfitCenter,1);


IF( StringToNumber( vPostingLevel ) < 10 );
vPostingLevel = '0' | vPostingLevel;
ENDIF;

IF(vPLLine @= 'PRIMARY PRODUCION COST');
vPLLine = 'PRIMARY PRODUCTION COST';
ENDIF;


IF( vValue = 0 & vValue1=0 );
ItemSkip;
ENDIF;

IF(LONG(vProfitCenter)>4);
ITEMSKIP;
ENDIF;

IF(DIMIX('CE DM P&L Account', vAccount) = 0);
ITEMSKIP;
ENDIF;


vPCBrand = vProfitCenter | ' ' | vBrand;
vInPCBrand = 'In'|vPCBrand;

ATTRPUTS( vProfitCenter, 'CE DM Profit Center', vPCBrand, 'Market Parent');


ATTRPUTS( vBrand, 'CE DM Profit Center', vPCBrand, 'Brand Parent');

sBrandWithSameParent = vBrand | vBrand;

IF(DIMIX('CE DM Profit Center', sBrandWithSameParent)>0);
ATTRPUTS( sBrandWithSameParent, 'CE DM Profit Center', vPCBrand, 'Brand Parent');
ENDIF;

ATTRPUTN( 1, 'CE DM SKU Market', vInPCBrand, 'PCBrandDummy');


#=====================
# Define Cube Dimensions
#=====================

vDim01=pScenarioTarget;
vDim02=vPostingPeriod;
vDim03=vAdjType;
vDim04=vPostingLevel;
vDim05=ATTRS('CE DM Scenario',pScenarioTarget,'FXRateType');
vDim06=vConsolUnit;
vDim07='SDxx';
#vDim08=vSKUMarket;
vDim08=vInPCBrand;
vDim09=vPCBrand;
vDim10='CC00000';
vDim11='InternalOrder01';
vDim12=vFunctArea;
vDim13=vAccount;
vDim14=vPLLine;
vDim15='BaseValue';

#=====================
# Update attributes
#=====================


AttrPutS(vPCBrand, 'CE DM SKU Market PLAN', vInPCBrand, 'Level1_BrandStyle');
AttrPutS(vProfitCenter, 'CE DM SKU Market PLAN',vInPCBrand, 'Level2_ProfitCenter');
AttrPutS(vMarket, 'CE DM SKU Market PLAN', vInPCBrand, 'Level3_Market');
AttrPutS('PC-MAR', 'CE DM SKU Market PLAN', vInPCBrand, 'Level5_MarketTotal');


##=====================
# Load Amount
#=====================

nOldAmount = CELLGETN(vCube,vDim01,vDim02,vDim03,vDim04,vDim05,vDim06,vDim07,vDim08,vDim09,vDim10,vDim11,vDim12,vDim13,vDim14,vDim15);
#noldamount = noldamount\1000;
asciioutput('E:\TM1Data\CE DM\Logfiles\cedm_noldamount.csv',numbertostring(noldamount),numbertostring(vValue),vCube,vDim01,vDim02,vDim03,vDim04,vDim05,vDim06,vDim07,vDim08,vDim09,vDim10,vDim11,vDim12,vDim13,vDim14,vDim15);


IF(vValue<>0);

#vValue=vValue\1000;
nAmount = nOldAmount + vValue;
## conversion to /1000
#nValue = nAmount\1000;

#asciioutput('E:\TM1Data\CE DM\Logfiles\cedm_actualsifNOT0'|sPromptName4|''|vPostingPeriod|'.csv',numbertostring(vValue),numbertostring(nValue),sPromptName0|sPromptName3,vCube,vDim01,vDim02,vDim03,vDim04,vDim05,vDim06,vDim07,vDim08,vDim09,vDim10,vDim11,vDim12,vDim13,vDim14,vDim15);
CELLPUTN(nValue ,vCube,vDim01,vDim02,vDim03,vDim04,vDim05,vDim06,vDim07,vDim08,vDim09,vDim10,vDim11,vDim12,vDim13,vDim14,vDim15);
ENDIF;

IF( vDim01 @= '2023 Actuals BW @AP23');
nOldAmount = CELLGETN(vCube,vDim01,vDim02,vDim03,vDim04,vDim05,vDim06,vDim07,vDim08,vDim09,vDim10,vDim11,vDim12,vDim13,vDim14,vDim15);
nAmount1 = nOldAmount + vValue1;
## conversion to /1000
#nValue1= nAmount1\1000;
asciioutput('E:\TM1Data\CE DM\Logfiles\@23cedm_actualsifNOT0'|sPromptName4|'.csv',numbertostring(vValue1),sPromptName0|sPromptName3,vCube,vDim01,vDim02,vDim03,vDim04,vDim05,vDim06,vDim07,vDim08,vDim09,vDim10,vDim11,vDim12,vDim13,vDim14,vDim15);
CELLPUTN(nValue1,vCube,vDim01,vDim02,vDim03,vDim04,vDim05,vDim06,vDim07,vDim08,vDim09,vDim10,vDim11,vDim12,vDim13,vDim14,vDim15);
ENDIF;
Attachments
dim_mes.png
dim_mes.png (17.7 KiB) Viewed 1768 times
Cube view
Cube view
Screenshot 2023-07-28 080534.png (30.06 KiB) Viewed 1768 times
ascheevel
Community Contributor
Posts: 288
Joined: Fri Feb 15, 2013 5:49 pm
OLAP Product: TM1
Version: PA 2.0.9.1
Excel Version: 365
Location: Minneapolis, USA

Re: TM1 should display values in /1000 format.

Post by ascheevel »

Have you considered loading the data as is from source and using formatting in TM1 to display millions as thousands?

Thousands: #,##0,;(#,##0,)
Millions: #,##0,,;(#,##0,,)
MarenC
Regular Participant
Posts: 350
Joined: Sat Jun 08, 2019 9:55 am
OLAP Product: Planning Analytics
Version: Planning Analytics 2.0
Excel Version: Excel 2016

Re: TM1 should display values in /1000 format.

Post by MarenC »

Hi,

I have used the formatting suggested by ascheevel and it works well in PAW, but the main problem with this is that for the excel reports it won't use the server formatting unless you select the option to do this, and then you might not want that.

The other option is to create a rule for the Thousands measure

Maren
Wim Gielis
MVP
Posts: 3120
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: TM1 should display values in /1000 format.

Post by Wim Gielis »

Or create a new measure with the old measure as a child.
The weight is 0.001 for thousands.
No need for rules and you are not loading your values twice.
Maybe what is needed is a bit of formatting to not show decimals.
Last edited by Wim Gielis on Sat Jul 29, 2023 1:45 pm, edited 1 time in total.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Jlekkala
Posts: 5
Joined: Mon Jul 03, 2023 8:50 am
OLAP Product: IBM TM1
Version: 2.0.9.15
Excel Version: Version 2208 Build 1

Re: TM1 should display values in /1000 format.

Post by Jlekkala »

Thank you for suggestions.
I edited the element weight of base measure to 0.001 and it worked.
User is checking the consolidations, and is happy that its displaying as excepted.
Thank you for support.

Best Regards,
Jagadish
Jlekkala
Posts: 5
Joined: Mon Jul 03, 2023 8:50 am
OLAP Product: IBM TM1
Version: 2.0.9.15
Excel Version: Version 2208 Build 1

Re: TM1 should display values in /1000 format.

Post by Jlekkala »

I have one doubt,
is there any chance it applies to N level also.
As of now its applying only for C level element.
Please suggest
Last edited by Jlekkala on Mon Jul 31, 2023 8:35 am, edited 1 time in total.
Wim Gielis
MVP
Posts: 3120
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: TM1 should display values in /1000 format.

Post by Wim Gielis »

By adding a child you indeed convert to a C element.
What is the requirement for keeping it as an n-element ?
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Jlekkala
Posts: 5
Joined: Mon Jul 03, 2023 8:50 am
OLAP Product: IBM TM1
Version: 2.0.9.15
Excel Version: Version 2208 Build 1

Re: TM1 should display values in /1000 format.

Post by Jlekkala »

Yes, /1000 fromat is applied to C level element
but for N level, its not showing /1000 value.
Please suggest
Attachments
1000fromat_Nelement.png
1000fromat_Nelement.png (73.93 KiB) Viewed 868 times
Wim Gielis
MVP
Posts: 3120
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: TM1 should display values in /1000 format.

Post by Wim Gielis »

How can the n level show the value /1000 ?
It is the big value that is divided by 1000 and shown on the C level. The n level is unchanged.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Jlekkala
Posts: 5
Joined: Mon Jul 03, 2023 8:50 am
OLAP Product: IBM TM1
Version: 2.0.9.15
Excel Version: Version 2208 Build 1

Re: TM1 should display values in /1000 format.

Post by Jlekkala »

Got it Wim.
Thank you for support.

Regards,
Jagadish
Post Reply