Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
matbelli
Contributor
Contributor

Compare two dates to see if one is an hour after or before another one

Hi, i have a table like this:

CodiceAAMSNomeSalarc_id_ticketanti_data_emissioneAperturaChiusuraIf(anti_data_emissione <= Chiusura - MakeTime(1) and anti_data_emissione >= Apertura + MakeTime(1),
'Alert',
'OK')
anti_importo
EA170050445HSALA BINGO TRASTEVERE13132423579984139519/12/2018 10:51:5019/12/2018 09:00:0019/12/2018 23:00:00Alert605

 

I need to check if "anti_data_emissione" is between the interval [ Apertura,Apertura+1h] or [Chiusura-1h,Chiusura], in those cases my expression should give Alert, if "anti_data_emissione" is not in those interval, it has to say OK.

Thanks

1 Solution

Accepted Solutions
Anil_Babu_Samineni

May be try this?

If((anti_data_emissione>=Apertura and anti_data_emissione<=(Apertura+Hour(MakeTime(01)))) or (anti_data_emissione>=(Chiusura-Hour(MakeTime(01))) and anti_data_emissione<=Chiusura), 'Alert', 'OK')

Or

If((anti_data_emissione>=Apertura and anti_data_emissione<=(Apertura+1)) or (anti_data_emissione>=(Chiusura-1) and anti_data_emissione<=Chiusura), 'Alert', 'OK')

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

1 Reply
Anil_Babu_Samineni

May be try this?

If((anti_data_emissione>=Apertura and anti_data_emissione<=(Apertura+Hour(MakeTime(01)))) or (anti_data_emissione>=(Chiusura-Hour(MakeTime(01))) and anti_data_emissione<=Chiusura), 'Alert', 'OK')

Or

If((anti_data_emissione>=Apertura and anti_data_emissione<=(Apertura+1)) or (anti_data_emissione>=(Chiusura-1) and anti_data_emissione<=Chiusura), 'Alert', 'OK')

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post