Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
StacyCui
Creator
Creator

Accumulative OR Value

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

StacyCui_2-1669891276269.png

StacyCui_1-1669891208143.png

1 Solution

Accepted Solutions
MarcoWedel

Sum({<FY={'CY'},FROZENDATE= {"<=$(=max({$<Month>} FROZENDATE))"},Month>} ORVALUE)

View solution in original post

1 Reply
MarcoWedel

Sum({<FY={'CY'},FROZENDATE= {"<=$(=max({$<Month>} FROZENDATE))"},Month>} ORVALUE)