Hi, Petr!

I can advise you to pass through InterSystems Getting Started online courses.

Also Caché Programming Orientation guide can be useful.

A lot of people also find useful Caché ObjectScript Quick Reference

And you can buy any book about InterSystems Caché, or just ask Mike - he is the author of two books about InterSystems Caché.

Oh. I wanted to use this for Combined Cubes to have shared Date dimension with all the dates. It seems it will not help me, though maybe helpful thing in a lot of other cases. Is there any kind of setting in Architect to introduce all the dates in Dimension>

Unless I should create entries in fact table for all the days even there were no facts in this days for both cubes. Right?

One more optimisation. This:

Set list = $ListFromString(string,",") 
Set pointer = 0 
While $ListNext(list,pointer,piece) 
 { //Do something with piece... 
 }

Can be changed to:

Set list = $ListFromString(string,",") 
Set pointer = 0 
For   { 
 quit:'$ListNext(list,pointer,piece) 
 //Do something with piece... 
 }

Which is faster, as 'for' is generally faster than 'while'.

Took from Russian Caché forum

Hi!

You can make it with ParallelPeriod keyword.

F.e. let's take sales in Samples for the Holefoods cube.

To show YearToYear monthly growth in percent add in the pivot calculated measure "YTY growth" with expression:

(DateOfSale.CurrentMember-ParallelPeriod(DateofSale.YearSold,1,DateOfSale.CurrentMember))/ParallelPeriod(DateofSale.YearSold,1,DateOfSale.CurrentMember)

And format: ##.##%

How to use it. 

Place months in a pivot in Rows. Add YTY Calculated Measure to Cols. And add any Measure you want to compare into Measures, f.e. Revenue. 

You'll get following MDX:

 WITH  MEMBER [DateOfSale].[SelectedYear] AS '[DateOfSale].[Actual].[YearSold].$VARIABLE.Year' MEMBER [MEASURES].[YTY growth] AS '(DateOfSale.CurrentMember-ParallelPeriod(DateofSale.YearSold,1,DateOfSale.CurrentMember))/ParallelPeriod(DateofSale.YearSold,1,DateOfSale.CurrentMember)',FORMAT_STRING='###.##%' SELECT NON EMPTY {[Measures].[%COUNT],[MEASURES].[YTY GROWTH]} ON 0,NON EMPTY [DateOfSale].[Actual].[MonthSold].Members ON 1 FROM [HoleFoods]

See the result:

And here are 2011 and 2010 together to prove the measure above works properly:

Hope that helps.

Hi!

You can make it with ParallelPeriod keyword.

F.e. let's take sales in Samples for the Holefoods cube.

To show YearToYear monthly growth in percent add in the pivot calculated measure "YTY growth" with expression:

(DateOfSale.CurrentMember-ParallelPeriod(DateofSale.YearSold,1,DateOfSale.CurrentMember))/ParallelPeriod(DateofSale.YearSold,1,DateOfSale.CurrentMember)

And format: ##.##%

How to use it. 

Place months in a pivot in Rows. Add YTY Calculated Measure to Cols. And add any Measure you want to compare into Measures, f.e. Revenue. 

You'll get following MDX:

 WITH  MEMBER [DateOfSale].[SelectedYear] AS '[DateOfSale].[Actual].[YearSold].$VARIABLE.Year' MEMBER [MEASURES].[YTY growth] AS '(DateOfSale.CurrentMember-ParallelPeriod(DateofSale.YearSold,1,DateOfSale.CurrentMember))/ParallelPeriod(DateofSale.YearSold,1,DateOfSale.CurrentMember)',FORMAT_STRING='###.##%' SELECT NON EMPTY {[Measures].[%COUNT],[MEASURES].[YTY GROWTH]} ON 0,NON EMPTY [DateOfSale].[Actual].[MonthSold].Members ON 1 FROM [HoleFoods]

See the result:

And here are 2011 and 2010 together to prove the measure above works properly:

Hope it helps.