Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, We have a requirement that calculate the accumulative OR Value. I created a master calendar table . The script is as follow, Our fiscal year is from 1st Oct:
Master_Calendar_Temp:
LOAD
Date(TempDate) as "FROZENDATE",
Day(TempDate) as 日,
Num(Month(TempDate)) as 月,
if(YearToDate(TempDate,0, 10) or YearToDate(date(num(TempDate)+1),-1, 10),'YTD') as FYTD,
'P'&Month(AddMonths (Date(TempDate,'MM/dd/yyyy'),3))*1 as Fmonth,
Month(TempDate) as 月份,
Year(TempDate) as 年,
if (date(TempDate)>='10/1/2022', 'CY','PY') as FY,
'Q'&Ceil(month(addMonths(TempDate,3)) / 3) as FQ;
LOAD
$(vMinDate) + IterNo() - 1 as TempDate
Autogenerate 1 While ($(vMinDate) + IterNo() - 1) <= $(vMaxDate);
CrossTable(Flag, Month)
LOAD FROZENDATE, FYTD, Fmonth Resident Master_Calendar_Temp;
DROP Field Flag;
And this is my set analysis for accumulative or value :
Sum({<FY={'CY'},FROZENDATE= {"<=$(=max(FROZENDATE))"},Month>} ORVALUE)
But when I select the Month P1, There is a or value, the same as P2, But when I select P3, It shows as 0, I hope P3 is also shows 488225. It seems the function not work. How to solve it? Thank you so much
Sum({<FY={'CY'},FROZENDATE= {"<=$(=max({$<Month>} FROZENDATE))"},Month>} ORVALUE)
Sum({<FY={'CY'},FROZENDATE= {"<=$(=max({$<Month>} FROZENDATE))"},Month>} ORVALUE)