Page 1 of 1

Exporting Data in CSV file

Posted: Tue Aug 28, 2012 6:36 am
by AshokReddy
Hi ,

I am trying to export data from a cube and putting in a CSV file. To do this i am creating a view , In that view i need to export data for 2 measures.

When i am creating the View in the subset for measure dimension i am wrinting as below.

SubsetCreate('Measure',Subsetname);
SubsetElementInsert('Measure',Subsetname,monthlyvalue,1);

When view is creating it creates with monthlyvalue (measure),

when i am extracting the data into the file it is missing some data because for those elements monthlyvalue is 0 for other measure there is data but it is not exporing into the file.

Here when i am extracting i am skipping the data which is 0 by using viewextractskipzerosets(cube,view,1).

Any one can help on this.

Re: Exporting Data in CSV file

Posted: Tue Aug 28, 2012 8:37 am
by MSidat
The Ti is behaving as it should as you have not defined the second measure in your view.

If you need to export data from both measures you need to create a View with both measures i.e. add another line when creating a view like:

SubsetElementInsert('Measure',Subsetname,AnotherMeasure,2);

This will ensure your data source contains all rows of data where there is a value against either or both of the measures.

Re: Exporting Data in CSV file

Posted: Tue Aug 28, 2012 9:49 pm
by David Usherwood
Just to point out that you will then get the two values on different rows. A TM1 view delivers data a cell at a time, iterating round the other dimensions. I suspect that the OP wanted to output both values on the same row - and hit problems with zero suppression when one cell was zero and the other was not.