exporting data by month

Post Reply
Wim Gielis
MVP
Posts: 3223
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

exporting data by month

Post by Wim Gielis »

Hi all

Today, I needed to export data from a cube to a flat file. The cube has 15 dimensions, one of them being a Months dimension. There you have a consolidation for "Total months", containing 12 months as children. The customer wanted to have 12 columns for the months. In front of these the metadata.

Now, you could look at the consolidation for Total months. Create a view with TI code, holding the consolidations that are non-zero. Set this as the data source for a process, and write the ASCIIOUTPUT (a.o. 12 CELLGETN statements).

But Total months could be zero while the individual months are not... You would neglect these in the view. Looping through all cells is not an option of course.

What I did was:

- create a view containing the data at the level of the months (not the conso)
- create a temporary cube with the same dimensions as the original cube
- write a 1 in the correct combination in the temporary cube, for all combinations that should come in the text file (store them for instance on month January, doesn't matter, as long as you recall where you put them :D)
- create a view containing the ones
- create the ASCIIOUTPUT statement
- destroy the temporary cube

It works very well.

Any thoughts on this? Could it be done better?

I thought about using rules, to populate a measure when the measure to be tracked, is different from zero. This would work but creates extra memory consumption. The export to a flat file is not very often. A view extract would list the values of the months one below the other as 1 long list; even not when the view itself is nicely laid out as 12 columns in the column area.

Greetz,

Wim Gielis
Best regards,

Wim Gielis

IBM Champion 2024-2025
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
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Re: exporting data by month

Post by Steve Vincent »

Wish i did have a better solution - you were lucky you only had 12 months to grab, i had from 2009 to 2024 by month... :shock:
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
David Usherwood
Site Admin
Posts: 1458
Joined: Wed May 28, 2008 9:09 am

Re: exporting data by month

Post by David Usherwood »

Depending on whether you have a measures dimension in the main cube (if not, as you say, build a temp cube), a rule on the lines of
['Flag'] = n: abs(sign(['Value']);
['Flag2','Jan'] = n:['Flag','Year'];
Zero and C suppression on Flag2/Jan should give you what you want.
User avatar
Steve Rowe
Site Admin
Posts: 2455
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: exporting data by month

Post by Steve Rowe »

Hi Wim,
I think I would have gone with the ruled measure approach and the commented the rule out after I was done. Whichever way you do it's not pretty.

Easiest would be to get the customer to change the requirements and have it all in 1 column!
Cheers
Technical Director
www.infocat.co.uk
Wim Gielis
MVP
Posts: 3223
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: exporting data by month

Post by Wim Gielis »

Thanks for the replies!

Wim
Best regards,

Wim Gielis

IBM Champion 2024-2025
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
Post Reply