Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ilanbaruch
Specialist
Specialist

14 Days Flag

Hi All,

I'm trying to create a flag field (0/1) base on a condition like:  if (condition,1,0) as flag

I want the flag to be true (flag = 1) for 14 days disregarding any condition.

in other words once flag=1 for 14 days than becomes flag = 0 again.

any ideas ?

thank you

Ilan 


8 Replies
marcus_sommer

You mean something like:

if(Date >= today() -14, 1, 0) as flag

maybe within your fact-table unless you creates a master-calendar new with each reload - then it would be better within the calendar-dimension-table.

- Marcus

Anonymous
Not applicable

hi,

Maybe:

if(Interval(Today() - Date,'dd') <= 14,1,0)  as Flag


Regards

Neetha

ilanbaruch
Specialist
Specialist
Author

Hi Marcus,

thanks for your quick replay.

the default condition for the flag is not based on date or days its something like:

if (amount >=150,1,0) as flag

but the flag needs to be there only for 14 days disregarding any condition, than 0 again.

ilanbaruch
Specialist
Specialist
Author

Hi All,

thanks for you're quick replay.

the default condition for the flag is not based on date or days, its something like:

if (amount >=150,1,0) as flag

but the flag needs to be there only for 14 days disregarding any condition, than 0 again.

qlikviewwizard
Master II
Master II

Hi,

You can use either one.

MarcoWedel

-(Date>=Today()-13 and Date<=Today()) as flag

Regards

Marco

Anonymous
Not applicable

hi,

Maybe try:

if( amount >=150 and Date >= today() -14, 1, 0) as flag


Regards

Neetha

MarcoWedel

-(Date>=Today()-13 and Date<=Today() and amount>=150) as flag

regards

Marco