Discussion board where members can get started with Qlik Sense.
I have data for many date, I want to load only recent two days data. I tried loading max(Date) and max(Date-1). But It is not working.
Go to Solution.
Load Max(DateField) as MaxDate
Let vMaxDate = num(peek('MaxDate',0,'MaxDateTable'));
where date(DateField ) >=date($(vMaxDate)-1) and date(DateField ) <=date($(vMaxDate))
may be this
max(date) & ' and ' & date(max(date-1))
you can use some functions like date(num(today())-2) or date(num(today())-2,'DD/MM/YYYY') if you need to format,
to compare the date column that you want to use for filter.
In this example I´m using today but you can use any date_column you have in your own table.Regards,Ricardo
Thanks & Regards,
If by "recent", you mean nased on the maximum date in the file:
FROM excelfile.xlsx (...)
LOAD Max(Date) as MaxDate
Let vMaxDate = Num(Peek('MaxDate'));
DROP Table Max_Date;
WHERE Date >= ($(vMaxDate) - 1);
DROP Table Raw;
If "recent" means today and yesterday:
Let vMaxDate = Num(Today());
Or even this:
WHERE Date >= (Num(Today()) - 1);