/content/folder[@name='Samples']/folder[@name='Cubes']/package[@name='Sales and Marketing (cube)']/model[@name='2008-07-25T15:28:38.072Z']
case
when ParamValue('Group Size') = '1' then [Report].[No Overlap]
else
[Report].[No Overlap] + '-'
+ number2string(
string2int32(substring([Report].[No Overlap],1,4))
+ case
when mod (
case substring([Report].[No Overlap],6,3)
when 'Jan' then 1
when 'Feb' then 2
when 'Mar' then 3
when 'Apr' then 4
when 'May' then 5
when 'Jun' then 6
when 'Jul' then 7
when 'Aug' then 8
when 'Sep' then 9
when 'Oct' then 10
when 'Nov' then 11
when 'Dec' then 12
end
+ string2int32(ParamValue('Group Size'))-1,12) between 1 and (string2int32(ParamValue('Group Size'))-1)
then 1
else 0
end
)
+'/'+
case mod (
case substring([Report].[No Overlap],6,3)
when 'Jan' then 1
when 'Feb' then 2
when 'Mar' then 3
when 'Apr' then 4
when 'May' then 5
when 'Jun' then 6
when 'Jul' then 7
when 'Aug' then 8
when 'Sep' then 9
when 'Oct' then 10
when 'Nov' then 11
when 'Dec' then 12
end + string2int32(ParamValue('Group Size'))-1,12)
when 1 then 'Jan'
when 2 then 'Feb'
when 3 then 'Mar'
when 4 then 'Apr'
when 5 then 'May'
when 6 then 'Jun'
when 7 then 'Jul'
when 8 then 'Aug'
when 9 then 'Sep'
when 10 then 'Nov'
when 11 then 'Oct'
when 0 then 'Dec'
end
endNo Data Availablecase
when ParamValue('Group Size') = '1' then [Report].[Overlap]
else
[Report].[Overlap] + '-'
+ number2string(
string2int32(substring([Report].[Overlap],1,4))
+ case
when mod (
case substring([Report].[Overlap],6,3)
when 'Jan' then 1
when 'Feb' then 2
when 'Mar' then 3
when 'Apr' then 4
when 'May' then 5
when 'Jun' then 6
when 'Jul' then 7
when 'Aug' then 8
when 'Sep' then 9
when 'Oct' then 10
when 'Nov' then 11
when 'Dec' then 12
end
+ string2int32(ParamValue('Group Size'))-1,12) between 1 and (string2int32(ParamValue('Group Size'))-1)
then 1
else 0
end
)
+'/'+
case mod (
case substring([Report].[Overlap],6,3)
when 'Jan' then 1
when 'Feb' then 2
when 'Mar' then 3
when 'Apr' then 4
when 'May' then 5
when 'Jun' then 6
when 'Jul' then 7
when 'Aug' then 8
when 'Sep' then 9
when 'Oct' then 10
when 'Nov' then 11
when 'Dec' then 12
end + string2int32(ParamValue('Group Size'))-1,12)
when 1 then 'Jan'
when 2 then 'Feb'
when 3 then 'Mar'
when 4 then 'Apr'
when 5 then 'May'
when 6 then 'Jun'
when 7 then 'Jul'
when 8 then 'Aug'
when 9 then 'Sep'
when 10 then 'Nov'
when 11 then 'Oct'
when 0 then 'Dec'
end
endNo Data AvailableNo Data Availablecase
when ParamValue('Group Size') = '1' then [Report].[No Overlap]
else
[Report].[No Overlap] + '-'
+ number2string(
string2int32(substring([Report].[No Overlap],1,4))
+ case
when mod (
case substring([Report].[No Overlap],6,3)
when 'Jan' then 1
when 'Feb' then 2
when 'Mar' then 3
when 'Apr' then 4
when 'May' then 5
when 'Jun' then 6
when 'Jul' then 7
when 'Aug' then 8
when 'Sep' then 9
when 'Oct' then 10
when 'Nov' then 11
when 'Dec' then 12
end
+ string2int32(ParamValue('Group Size'))-1,12) between 1 and (string2int32(ParamValue('Group Size'))-1)
then 1
else 0
end
)
+'/'+
case mod (
case substring([Report].[No Overlap],6,3)
when 'Jan' then 1
when 'Feb' then 2
when 'Mar' then 3
when 'Apr' then 4
when 'May' then 5
when 'Jun' then 6
when 'Jul' then 7
when 'Aug' then 8
when 'Sep' then 9
when 'Oct' then 10
when 'Nov' then 11
when 'Dec' then 12
end + string2int32(ParamValue('Group Size'))-1,12)
when 1 then 'Jan'
when 2 then 'Feb'
when 3 then 'Mar'
when 4 then 'Apr'
when 5 then 'May'
when 6 then 'Jun'
when 7 then 'Jul'
when 8 then 'Aug'
when 9 then 'Sep'
when 10 then 'Nov'
when 11 then 'Oct'
when 0 then 'Dec'
end
endNo Data Availablecase
when ParamValue('Group Size') = '1' then [Report].[Overlap]
else
[Report].[Overlap] + '-'
+ number2string(
string2int32(substring([Report].[Overlap],1,4))
+ case
when mod (
case substring([Report].[Overlap],6,3)
when 'Jan' then 1
when 'Feb' then 2
when 'Mar' then 3
when 'Apr' then 4
when 'May' then 5
when 'Jun' then 6
when 'Jul' then 7
when 'Aug' then 8
when 'Sep' then 9
when 'Oct' then 10
when 'Nov' then 11
when 'Dec' then 12
end
+ string2int32(ParamValue('Group Size'))-1,12) between 1 and (string2int32(ParamValue('Group Size'))-1)
then 1
else 0
end
)
+'/'+
case mod (
case substring([Report].[Overlap],6,3)
when 'Jan' then 1
when 'Feb' then 2
when 'Mar' then 3
when 'Apr' then 4
when 'May' then 5
when 'Jun' then 6
when 'Jul' then 7
when 'Aug' then 8
when 'Sep' then 9
when 'Oct' then 10
when 'Nov' then 11
when 'Dec' then 12
end + string2int32(ParamValue('Group Size'))-1,12)
when 1 then 'Jan'
when 2 then 'Feb'
when 3 then 'Mar'
when 4 then 'Apr'
when 5 then 'May'
when 6 then 'Jun'
when 7 then 'Jul'
when 8 then 'Aug'
when 9 then 'Sep'
when 10 then 'Nov'
when 11 then 'Oct'
when 0 then 'Dec'
end
end
<script>
var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);
if ( !fW || fW == undefined)
{ fW = ( formWarpRequest_THIS_ ? formWarpRequest_THIS_ : formWarpRequest_NS_ );}
function parseMonthName(name) {
var Months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
for (i=0;i<12;i++){ if(Months[i]==name) {return i+1; break;}}
}
function addMonths(month,add){
add=add?add:0;
month = (month + add)%12;
month=month==0?12:month;
return month;
}
function getMonthName(month) {
var Months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
return Months[month-1];
}
function setMonthNames(startPrompt,endPrompt){
var Size
, Start = startPrompt
, End = endPrompt
, Month , newMonth, newYear
// Loop through the groupSize list to set the size variable. Subtract 1 from the value since the value includes the current month.
for(var i =0;i<fW._oLstChoices_groupSize.length;i++){if(fW._oLstChoices_groupSize[i].selected) Size=fW._oLstChoices_groupSize[i].value -1}
for (var i = 0;i<Start.length;i++){
if(!Start[i].getAttribute('Orig')) {Start[i].setAttribute('Orig' , Start[i].getAttribute('dv')); };
Month = Start[i].getAttribute('Orig');
// If the group size is set to 0, use the original label. This is for on the fly changes.
if(Size==0) {
Start[i].setAttribute('dv' , Month);
}
else {
newMonth = parseMonthName(Month.substr(5,3)) ;
newYear = addMonths(newMonth,Size)<Size?parseInt(Month.substr(0,4))+1:Month.substr(0,4);
Start[i].setAttribute('dv' , Month + '-' + newYear + '/' + getMonthName(addMonths(newMonth,Size)));
}
Start[i].innerHTML= Start[i].getAttribute('dv') ;
//if(i>=Size-1) {Start[i].display='none';} else {Start[i].display='';} //Really, IE? Really?!
}
}
</script>
Filter out overlapOverlapping MonthsGroup Size6
<script>
setMonthNames(fW._oLstChoices_startMonth,fW._oLstChoices_endMonth);
setMonthNames(fW._oLstChoices_startMonth1,fW._oLstChoices_endMonth1);
</script>Year Groupingsfilter(
[sales_and_marketing].[Time].[Time].[Month]
, [Mod]=0
)
[sales_and_marketing].[Time].[Time].[Month]
member(1,'One','One',[sales_and_marketing].[Measures])#/*
Referenced by Start Month
This will mod each month number on Group Size to return a 0 for the
correct periods.
Note: Not all MDX languages support MOD. Using floor to replicate the functionality.
What it SHOULD be:
mod(
total(
[One] within set periodsToDate(
[sales_and_marketing].[Time].[Time].[Time]
, currentMember([sales_and_marketing].[Time].[Time])
)
)
-
total(
[One] within set periodsToDate(
[sales_and_marketing].[Time].[Time].[Time]
, openingPeriod([sales_and_marketing].[Time].[Time].[Month])
)
)
, prompt('Group Size','integer','6')
)
*/#
(((total(
[One] within set periodsToDate(
[sales_and_marketing].[Time].[Time].[Time]
, currentMember([sales_and_marketing].[Time].[Time])
)
)-1)
/ #prompt('Group Size','integer','6')#)
-
floor((( total(
[One] within set periodsToDate(
[sales_and_marketing].[Time].[Time].[Time]
, currentMember([sales_and_marketing].[Time].[Time])
)
)-1)
/ #prompt('Group Size','integer','6')#)))
* #prompt('Group Size','integer','6')#
#promptmany('Overlap','mun','[sales_and_marketing].[Time].[Time].[Month]','set(','[sales_and_marketing].[Time].[Time].[Month]',')')##promptmany('noOverlap','mun','[filterMonth]','set(','[sales_and_marketing].[Time].[Time].[Month]',')')#filter(
[sales_and_marketing].[Time].[Time].[Month]
, [Mod]=0
)
member(1,'One','One',[sales_and_marketing].[Measures])#/*
Referenced by Start Month
This will mod each month number on Group Size to return a 0 for the
correct periods.
Note: Not all MDX languages support MOD. Using floor to replicate the functionality.
What it SHOULD be:
mod(
total(
[One] within set periodsToDate(
[sales_and_marketing].[Time].[Time].[Time]
, currentMember([sales_and_marketing].[Time].[Time])
)
)
-
total(
[One] within set periodsToDate(
[sales_and_marketing].[Time].[Time].[Time]
, openingPeriod([sales_and_marketing].[Time].[Time].[Month])
)
)
, prompt('Group Size','integer','6')
)
*/#
(((total(
[One] within set periodsToDate(
[sales_and_marketing].[Time].[Time].[Time]
, currentMember([sales_and_marketing].[Time].[Time])
)
)-1)
/ #prompt('Group Size','integer','6')#)
-
floor((( total(
[One] within set periodsToDate(
[sales_and_marketing].[Time].[Time].[Time]
, currentMember([sales_and_marketing].[Time].[Time])
)
)-1)
/ #prompt('Group Size','integer','6')#)))
* #prompt('Group Size','integer','6')#
[sales_and_marketing].[Measures].[Revenue]member(
total(
currentMeasure
within set
lastPeriods(
0-#prompt('Group Size','integer','5')#
,currentMember([sales_and_marketing].[Time].[Time])
)
)
,'Grouped Total'
,'Grouped Total'
,[sales_and_marketing].[Time].[Time])