Hi TM1 masters,
Need your advice in below issue.
Issue is quite a general one and I have read other posts in this forum, but I am still thinking it will not cause a problem afterwards.
I am loading a csv into a cube. Cube has 4dimensions:dim1,dim2,dim3,Measure.
Measure dimension contains around 150 elements f which all elements store numeric values ,only 2 elements store string values.
In variables tab, If I consider measure as "Numeric", so while loading csv it will generate below error-"Cannot convert field number '', value " " to a real number.
I can understand that cellputN,cellputS giving error for this case.
If I use below code, then I need to take measure as "String" using NUMBR function, it does not generate any error
ctype= dtype('Measure',Value);
If( ctype @= 'N');
cellputN(numbr(Value),cCube,dim1,dim2,dim3,Measure);
else;
CellPutS(Value,cCube,dim1,dim2,dim3,Measure);
endif;
is this the right approach or there is any other workaround?
I will use this cube as a staging cube and using Rules, I will load the values into other cubes.
Please guide. thanks.
Loading a csv with numeric and string value
-
- Posts: 9
- Joined: Fri Aug 26, 2016 11:27 am
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2010
-
- MVP
- Posts: 3117
- 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: Loading a csv with numeric and string value
Yes this is fine.
Other conversion functions that you can consider:
http://www.wimgielis.com/tm1_numbersandstrings_EN.htm
Other conversion functions that you can consider:
http://www.wimgielis.com/tm1_numbersandstrings_EN.htm
Last edited by Wim Gielis on Tue Apr 18, 2017 5:19 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
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
-
- Posts: 9
- Joined: Fri Aug 26, 2016 11:27 am
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2010
Re: Loading a csv with numeric and string value
Thanks Wim. Cheers!
-
- Regular Participant
- Posts: 424
- Joined: Sat Mar 10, 2012 1:03 pm
- OLAP Product: IBM TM1, Planning Analytics, P
- Version: PAW 2.0.8
- Excel Version: 2019
Re: Loading a csv with numeric and string value
This might also help:
http://www.tm1forum.com/viewtopic.php?f=3&t=1109&p=6155 Thanks
http://www.tm1forum.com/viewtopic.php?f=3&t=1109&p=6155 Thanks
"You Never Fail Until You Stop Trying......"