Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 mikegrattan
		
			mikegrattan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Please help me figure out the set expression below.
I have the following expression which is working, as long as I am manually selecting a CommodityCode and a DateFlag. It does not work by itself at this point, even though I am specifying the correct filters in the set expression.
What I would like to do is modify the expression so that it will work for a specific CommodityCode, such as LTC, and a specific DateFlag, such as DateFlag_SixWeeks. The DateFlag_SixWeeks dimension is defined in the data load, and it selects all dates that are prior to the current week - 6 weeks; the value is 1 when true and 0 when false.
RangeSum(Above(Total (RangeSum(Above( (Aggr(Avg(TOTAL Aggr(Sum({<DateFlag_SixWeek={'1'}, CommodityCode={'LTC'}>} EquivalentQuantity),
ShipDate,Week)), ShipDate,Week) ) , 0, 6)) ) , 0, 6))
The table I'm using for this example contains the following columns:
CommodityCode
Week
Avg (cumulative expression above)
Although ShipDate is not in the table it appears that it is needed in order for the correct accumulation week-over-week.
I imagine that the set expression, {<DateFlag_SixWeek={1},CommodityCode={'LTC'}>}, needs to be added to the RangeSum and/or Aggr functions but I have not been able to get it to work after trying several variations.
Any suggestions?
 
					
				
		
 mikegrattan
		
			mikegrattan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Wow...yes, that works perfectly. Thank you so much.
