Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
raadwiptec
Creator II
Creator II

timestamps

hi all,

I need timestamps filter

for eg: 24hrs timestamp

2015-08-20 12:45:31

2015-08-20 11:45:31

2015-08-20 20:45:31

2015-08-20 00:45:31 - midnight

2015-08-20 18:45:31

for example user need to have another option to see all the values after 6 pm in the evening

I need to filter timestamps if  greater than '18 o Clock'  . how could I do this using a button>?or is their a better way?

1 Solution

Accepted Solutions
13 Replies
datanibbler
Champion
Champion

Hi,

timestamps are stored internally as a numeric decimal value.

=> You can use the FLOOR() and FRAC() functions to retrieve the date (left of the ,) or time (right of the ,).

=> Then you can use the DATE() or TIME() functions to format them as you like.

Using a button then to filter for all times greater than a certain time should after that be easy.

HTH

Best regards,

DataNibbler

Digvijay_Singh

Something like this -

time.PNG

raadwiptec
Creator II
Creator II
Author

hi digvjay,

I used a slider as well but how do we link..is it through variable or just column

Digvijay_Singh

Just column field, I added expression =Time(frac(Timestamp),'hh:mm:ss') in the Field/expression of data section of slider. Selected Multi Value  in Mode.

raadwiptec
Creator II
Creator II
Author

in the script is it possible like if the time is greater than 6pm then a new column ..other than the filter option

Digvijay_Singh

It is possible but then you are fixing this column to show entry only greater than 6 pm, you will need script change if you need greater than any other time later.

load Timestamp, if(frac(Timestamp)>18/24,Timestamp) as After6PM;

load * inline [

Timestamp

2015-08-20 01:45:31

2015-08-20 02:45:31

2015-09-20 20:45:31

2015-10-20 18:45:31

2015-11-20 20:45:31

2015-11-20 18:45:31

2015-12-20 20:45:31

2015-12-20 00:45:31

2015-12-20 18:45:31

];

See if below option can suit you, you can create list box with greater than 6 pm entries through expressions -

after6pm.PNG

sample qvw is attached -

Clever_Anjos
Employee
Employee

Please check if this logic fits to you

LOAD

  Time,

  Time(Round(Time,1/4)) as Flag; // This flag

LOAD

  MakeTime(RecNo()-1,IterNo()-1) as Time // use your data here

AutoGenerate 24

While IterNo() < 60;

MarcoWedel

Hi raadwiptec‌,

please take some time to review and close those of your threads that have received correct answers.

(Your threads will be closed by marking an answer as correct.)

thank you

regards

Marco

MarcoWedel

Hi,

one solution using a button could be some "select in field" action with a search string like:

='=Frac(yourtimestamps)>''18:00:00'''

QlikCommunity_Thread_186114_Pic1.JPG

QlikCommunity_Thread_186114_Pic2.JPG

hope this helps

regards

Marco