Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
DestinedTale
Contributor II
Contributor II

Nested aggregation not allowed

Hi, 

I have an issue with adding $(DiffDate) to the expression in load script. 

set DiffDateformula = num(DayStart(Date#(left([@9], 8), 'YYYYMMDD'))) - num(DayStart(Date#(left([@5], 8), 'YYYYMMDD')));
let DiffDate = $(DiffDateformula) + 1;

if MonthStart($(timeStampDate)) = MonthStart($(today)) then
whichDay = $(today);
else
whichDay = num(DayStart(MonthEnd($(timeStampDate))));
endif

if (max($(whichDay)- num(DayStart(Date#(left([Due Date], 8), 'YYYYMMDD') - $(DiffDate)))) < 0, 0, max($(whichDay)- num(DayStart(Date#(left([Due Date], 8), 'YYYYMMDD') - $(DiffDate)))))) as [Aging Days]

Regards,

Labels (2)
1 Reply
uacg0009
Partner - Specialist
Partner - Specialist

Hi,
Could you please share a small sample data, so I can try to find the reason,
I think maybe the variable can't get the right value, but I need a sample to prove it.
Aiolos Zhao