The error that you posted was by the expansion returning null. You cannot evaluate a Max() in this context.
Is not clear what you are trying to do - (1) you want a to use a field NumDate already loaded into QS, or (2) a field NumDate in the source database?
If (1), then you need to compute the Max value in a temp table, and Peek() the value into a variable.
LOAD Max(NumDate) - 29 as MaxDate Resident Data;
Let vMaxDate = Peek('MaxDate ');
Drop Table T_MaxDate;
SQL SELECT ....
Where NumBase > $(vMaxDate);
If (2), you will need to modify the SQL expression with a nested subquery or a join to compare NumDate and Max(NumDate)
You are tying to use the alias in where condition
try using the actual field name
basically numDate will not be visible to the where condition. Try something like below
Date#(deliverd#Date) as numDate
From Your Excel document;
Check if the numdate has the correct numeric date values
if it does
LOAD Max(NumDate) as MaxDate
Let vMaxDate = Peek('MaxDate ')-29;
Drop Table T1;