Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
juanma21
Contributor III
Contributor III

Filter by Date Range Hour Minute

Dear, I am a QlikView user, please my need is to create a filter for a range of dates, but included with hours and minutes.

For example a range would be:

Start: Date: 09/07/2020 Time: 13 Minute: 30

End: Date: 09/13/2020 Time: 18 Minute: 59

In advance I appreciate your help.

Juan

1 Solution

Accepted Solutions
juanma21
Contributor III
Contributor III
Author

Thank you, you gave me some light on the way, I solved it as follows:

Filter panel

juanma21_0-1601482695201.png

structure

juanma21_1-1601482739442.png

I thank you

View solution in original post

8 Replies
Kushal_Chawda

@juanma21 can you please elaborate? 

juanma21
Contributor III
Contributor III
Author

Hello Kush,
I am trying to filter a start and end range that includes date, hour and minutes.

 

data.pngfiltters.png

Kushal_Chawda

@juanma21  is it fixed range you want to filter ? What is your filter criteria?

juanma21
Contributor III
Contributor III
Author

The initial and final data are entered by the user, and depending on that, the information must be filtered, they are not fixed data.

Kushal_Chawda

@juanma21   try below.

Set the timestamp format variable (In main tab of load script) which matches the values coming from source

SET TimestampFormat='DD/MM/YYYY hh:mm:ss';

Note : I have assumed the format but you need to provide the format according to your source data values.

see the attached qvw for the same.

 

juanma21
Contributor III
Contributor III
Author

Thank you, you gave me some light on the way, I solved it as follows:

Filter panel

juanma21_0-1601482695201.png

structure

juanma21_1-1601482739442.png

I thank you

Reliability-Engineer
Contributor III
Contributor III

Juan,

would you be so kind to share the example you made with me?

Thanks.

Jan Droog

juanma21
Contributor III
Contributor III
Author

The need arose to filter by date, hour and minute range, since the data comes in that format. Create 4 island tables, time_ini. end hour (from 0 to 23) and min_ini, end minute (from 0 to 59)

SCRIPT:

Hora_Ini:
Load RowNo()-1 as Hora_Ini
AutoGenerate(24);

Minuto_Ini:
Load RowNo()-1 as Minuto_Ini
AutoGenerate(60);

Hora_Fin:
Load RowNo()-1 as Hora_Fin
AutoGenerate(24);

Minuto_Fin:
Load RowNo()-1 as Minuto_fin
AutoGenerate(60);

and the button property has this string:  ='>='&(v_Rango_Ini)&'<='&(v_Rango_Fin)

juanma21_0-1601493610815.png

you have to create these variables

juanma21_1-1601494132369.png

v_Rango_Ini
=Date(Timestamp#( '$(v_Fecha_Ini)' &' '& '$(v_Hora_Ini)' &':'& '$(v_Minuto_Ini)' &':00', 'DD/MM/YYYY hh:mm:ss'), 'DD/MM/YYYY hh:mm:ss')

v_Rango_Fin
= Date(Timestamp#('$(v_Fecha_Fin)' &' '& '$(v_Hora_fin)' &':'& '$(v_Minuto_Fin)' & ':59', 'DD/MM/YYYY hh:mm:ss'), 'DD/MM/YYYY hh:mm:ss')

 

calendar objects

juanma21_2-1601494199036.png

 

If you have any questions, let me know.

Greetings

Juan