Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sat_tok52
Creator
Creator

How to create last seven days Flag in Qlik sense

Hi All,

I have to create last seven days flag in script ,instead of today() i have to take  max date of my date less than 7 days . Any help.

IF(Date >max(Date)-7,1,0)

Thanks,

 

Labels (1)
2 Replies
menta
Partner - Creator II
Partner - Creator II

You can load the fact table and store the max date into variable.

DateTmp:

Load Max(Date) as MaxDate

resident <your fact table>;

Let vMaxDate = peek('MaxDate',-1,'DateTmp');

 

NOW

 

IF(Date >$(vMaxDate )-7,1,0)