Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ALL,
i want sum my sales for currentmonth, how can i do his?
sum( {$<Month(maxMonth>} Sales.Amount) not working
pleae help
May be like:
Sum({<MonthField={"$(=Max(MonthField))"}>} Sales.Amount)
Assuming your monthfield is created in the script using month().
sum( {$<Month={$(=Month(maxMonth))}>} Sales.Amount)
still not working, my master calendar script is:
UNQUALIFY *;
Min:
LOAD
min (Date) as MinDate
resident Fact;
Max:
LOAD
max (Date) as MaxDate
resident Fact;
vMinDate = Peek('MinDate',0,'Min');
vMaxDate = Peek('MaxDate',-1,'Max');
Temp:
LOAD
date($(vMinDate) + RowNo() - 1) as Date
AutoGenerate
$(vMaxDate) - $(vMinDate) + 1
;
Calendar:
Load
Date as Date,
Month(Date) as Month,
Year(Date) as Year,
Week(Date) as Week,
WeekDay(Date) as WeekDay,
Day(Date) as Day,
'Q'&Ceil(Month(Date)/3) as Quarter,
'H'&Ceil(Month(Date)/6) as HalfYear,
MonthName(Date) as YearMonth,
Year(Date) &'-Q'& Ceil(Month(Date)/3) as YearQuarter,
Year(Date) &'-H'& Ceil(Month(Date)/6) as YearHalfYear
resident Temp;
drop tables Min,Max,Temp;
This?
Sum({<Month={"$(=MaxString(Month))"}>} Sales.Amount)
works great, thanks