Page 1 of 1

TM1-How to send a cube view data to a csv file usign TI

Posted: Thu Aug 14, 2014 6:46 am
by shivangi
Hello, i want to extratc my cube view to a csv file, m using ascii output but the values for the elements are not going correct.can anyone please show me how to do it ? :?:

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Thu Aug 14, 2014 8:27 am
by Alan Kirk
shivangi wrote:Hello, i want to extratc my cube view to a csv file, m using ascii output but the values for the elements are not going correct.can anyone please show me how to do it ? :?:
Please refer to the Request For Assistance Guidelines:
4) Similarly if you're getting unexpected results, specifics of what you're running, how, and what results you're getting will yield a more valuable response than "I'm running a T.I. but my code doesn't work properly". If you're getting an error, please be specific about what the error is (full details, not just "a runtime error" or "process terminated with errors"), and the circumstances under which it's occurring. But remember that even if you do specify the exact error message, it's not likely to be helpful unless you provide the context for it; which part of the software the error is occurring in (point 2 above), and what, specifically, you were doing at the time. For Rules and TurboIntegrator processes, remember that including the actual code in your post will be a thousand times more useful than an attempted description of it. You can upload entire .pro and .cho files as attachments if necessary, or just copy and paste the relevant part into your post using the Code tag at the top of the post editing window.
In this case you should also provide details of how you've constructed the cube view that you're using as your data source.

NB: The post was moved to the correct forum. It did not belong in Commercial.

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Thu Aug 14, 2014 9:23 am
by BariAbdul

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Thu Aug 14, 2014 11:08 am
by shivangi
BariAbdul wrote:This might help:
http://www.tm1forum.com/viewtopic.php?f=3&t=3415 Thanks
Thanks a lot ! :)

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Thu Aug 14, 2014 11:23 am
by shivangi
How can i set my dimesnions in cols and rows in a ti ? though my view shows my 4 dims in cols and measure in a row, i want to that every measure element must become a column rather than appearing together in a measure column ? how can i acheive this?

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Thu Aug 14, 2014 12:13 pm
by tomok
shivangi wrote:How can i set my dimesnions in cols and rows in a ti ? though my view shows my 4 dims in cols and measure in a row, i want to that every measure element must become a column rather than appearing together in a measure column ? how can i acheive this?
You can't. Processing a view in a TI is going to read the dimensions in the order they appear in the cube. You can, however, control the order of the elements in the dimensions themselves via subset definition. For example, let;s say you have a cube with three dimensions and a measure dimension and each dimension has 3 elements. Here's the order of elements when you process the view:

Dim_1_Element_1,Dim_2_Element_1,Dim_3_Element_1, Measure_1
Dim_1_Element_1,Dim_2_Element_1,Dim_3_Element_1, Measure_2
Dim_1_Element_1,Dim_2_Element_1,Dim_3_Element_1, Measure_3
Dim_1_Element_1,Dim_2_Element_1,Dim_3_Element_2, Measure_1
Dim_1_Element_1,Dim_2_Element_1,Dim_3_Element_2, Measure_2
Dim_1_Element_1,Dim_2_Element_1,Dim_3_Element_2, Measure_3
Dim_1_Element_1,Dim_2_Element_1,Dim_3_Element_3, Measure_1
.....

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Sat Aug 16, 2014 4:06 am
by shivangi
cant i make something like this ? here if u see in the attached file, my views measure each of them comes as a diff col in sql table against the dims.

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Sat Aug 16, 2014 4:37 am
by Alan Kirk
shivangi wrote:cant i make something like this ? here if u see in the attached file, my views measure each of them comes as a diff col in sql table against the dims.
Your post is missing the attachment. It may be that you clicked the [Browse] button to select the file, but you then have to click the [Add the file] button to the right of that to add the file to your post.
Attachment.jpg
Attachment.jpg (134.6 KiB) Viewed 10907 times

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Sat Aug 16, 2014 5:21 am
by shivangi
sorry, done now.

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Mon Aug 18, 2014 4:56 am
by shivangi
Hello all,

Any suggestions ?

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Mon Aug 18, 2014 11:03 am
by tomok
You can't do what you want without some special coding. This is because when you use a cube view as a data source you get one intersection per record. Your picture shows 5 intersections (the 5 columns). The only way to output these 5 columns in one line in the CSV is going to be to pull one column from the view and then do a CellGetN for all the remaining columns and then configure your ASCIIOutput statement to output the dimension elements and then the 5 measures. You'll also want to create a consolidation of the measures you want and use that in the view. Then you can CellGetN for each of the children of that consolidation and write them out to your file.

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Tue Aug 19, 2014 3:28 am
by shivangi
tomok wrote:You can't do what you want without some special coding. This is because when you use a cube view as a data source you get one intersection per record. Your picture shows 5 intersections (the 5 columns). The only way to output these 5 columns in one line in the CSV is going to be to pull one column from the view and then do a CellGetN for all the remaining columns and then configure your ASCIIOutput statement to output the dimension elements and then the 5 measures. You'll also want to create a consolidation of the measures you want and use that in the view. Then you can CellGetN for each of the children of that consolidation and write them out to your file.
Hey, can u pls tell me or write the syntax and show me.I am pretty new to TM1, so i dont really have much knowledge about coding. :(

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Tue Aug 19, 2014 6:43 am
by lotsaram
shivangi wrote:Hey, can u pls tell me or write the syntax and show me.I am pretty new to TM1, so i dont really have much knowledge about coding. :(
That is not how this works. No one is here to do your job for you. Alan has already directed you to the Request For Assistance Guidelines once already. Please follow the link and read for comprehension. Show evidence of what you have done already to tackle the problem, provide the code that you have, then maybe someone will offer a tip on improving it.

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Tue Aug 19, 2014 8:06 am
by rmackenzie
lotsaram wrote:
shivangi wrote:Hey, can u pls tell me or write the syntax and show me.I am pretty new to TM1, so i dont really have much knowledge about coding. :(
That is not how this works. No one is here to do your job for you.
Shivangi,

Just to make it clear why you are getting a negative response: the code you are asking for isn't a couple of lines long, nor is it information someone can give you a quick example on a special TI function.

The code you need would be reasonably complex and be dependent on how the data is stored in your cube and the types of hierarchies you have in the specific dimensions of that cube. If for example, you were willing to pay for someone to do this job for you, they could easily quote you a full days work to develop and test this particular script. How much does that normally cost your company?

Even people who have done these sort of scripts before can't just hand you an old script they might have as normally they are quite cube-specific and the old script would probably need so much re-writing that it would be easier to start at the beginning. This is what tomok means by 'special coding' - not that it is 'expert coding' - but that it requires thought, effort and time to test.

Robin

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Tue Aug 19, 2014 8:35 am
by shivangi
lotsaram wrote:
shivangi wrote:Hey, can u pls tell me or write the syntax and show me.I am pretty new to TM1, so i dont really have much knowledge about coding. :(
That is not how this works. No one is here to do your job for you. Alan has already directed you to the Request For Assistance Guidelines once already. Please follow the link and read for comprehension. Show evidence of what you have done already to tackle the problem, provide the code that you have, then maybe someone will offer a tip on improving it.
Hey, i had just posted above the image , i was little confused, i m not asking you all do work on it only, i was just askign for a suggestion caus i have already taken my data out to a sql table so i just wanted to knw how can i get my cols in such a way , which when some one posted i just wanted to knw it caus i m pretty new to tm1,Anyways its ok , thanks for the time spent.

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Tue Aug 19, 2014 7:15 pm
by uchow10
shivangi wrote:How can i set my dimesnions in cols and rows in a ti ? though my view shows my 4 dims in cols and measure in a row, i want to that every measure element must become a column rather than appearing together in a measure column ? how can i acheive this?
If you already have the cubeview setup the way you want, i.e. dimensions in cols and measure on the row why not just do a snapshot to Excel? You can then in Excel format it and then save it as a .csv file assuming the view is not monstrously large...

of course if this is too much manual work then you will have to do special coding which as the others mention is not a simple few lines of code

Re: TM1-How to send a cube view data to a csv file usign TI

Posted: Tue Aug 26, 2014 1:27 pm
by rmackenzie
Similar discussion here.