Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

mwallman
Contributor

Previous 30 days flag from yesterday's date?

Hello,

I have a Master Calendar with a Date field.

It contains historic dates as well as future dates.

How can I create a Flag field that identifies all the dates that are within 30 days from yesterday's date?

E.g. Date field contains 05/03/2018, I want to create a 30 Day Flag field with a value of 1 until 03/02/2018 because all the dates in this range are in the 30 day range from yesterday's date.

3 Replies
MVP
MVP

Re: Previous 30 days flag from yesterday's date?

May be this

If(TempDate >= (Today() - 31) and TempDate < Today(), 1, 0) as Previous30DaysFlag

olivierrobin
Valued Contributor II

Re: Previous 30 days flag from yesterday's date?

hello,

why don't you use a piece of script like this :

let flag=if(date(today()-1)-DateField<30,1,0);

sas_fundm
New Contributor II

Re: Previous 30 days flag from yesterday's date?

depending on how do you like to process your data... I'd prefer a separate column im my table (filled as @sunny proposed). So I'm able to restrict data as I like

Community Browser