Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can I save Last and before last dates in a date field as script variables and use them in where condition while joinning?
Sure, assuming your date field is named Date:
LET vLastDate = peek('Date');
LET vBeforeLastDate = peek('Date',-2);
If you want the max and second highest try:
Temp:
load max(Date) as Max1, max(Date,2) as Max2
Resident ...table_with_dates...;
LET vMax1 = peek('Max1');
LET vMax2 = peek('Max2');
drop Table Temp;
You can use the variables like this:
load * from ...sometable...
where OrderDate <= $(vLastDate) ;
Sure, assuming your date field is named Date:
LET vLastDate = peek('Date');
LET vBeforeLastDate = peek('Date',-2);
If you want the max and second highest try:
Temp:
load max(Date) as Max1, max(Date,2) as Max2
Resident ...table_with_dates...;
LET vMax1 = peek('Max1');
LET vMax2 = peek('Max2');
drop Table Temp;
You can use the variables like this:
load * from ...sometable...
where OrderDate <= $(vLastDate) ;
Thanks..