Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

need help with this expression

=Count({<IN1={">$(=SHIFTSTARTTIME)"},time((IN1-SHIFTSTARTTIME),'hh:mm:ss')={"<$(=00:10:00)"}>}Empid)

IN1 - Field

Shiftstarttime- field

Empid- primary key field

Empid- Employee id

IN1- in this Employee entry time is given in format '09-Apr-2014 09:35:00'

Shiftstarttime- in this Employee Shift Start time is given in format '09-Apr-2014 08:30:00'

by above expression i want to count no .of employee who are late but are late between 0- 10 min... but error is coming please help

1 Solution

Accepted Solutions
ToniKautto
Employee
Employee

It is generally a good approach to try and pre-calculate as much as possible in the script, to make the front end expressions simpler and more efficient.

In my attached example I have added two fields in the the data model. The first one is called Delay, and represents the interval corresponding to the difference between expected and registered times. The second field is a flag that is true (-1) if the delay is larger than 10 minutes, and false (0) if the delay is smaller than 10 minutes or if the employee is earlier.

This means that in the front-end expression you only need to address the delay flag to find the data rows that has been flagged.

=count({<IsLaterThan10Min={"-1"}>} Empid)

View solution in original post

2 Replies
ToniKautto
Employee
Employee

It is generally a good approach to try and pre-calculate as much as possible in the script, to make the front end expressions simpler and more efficient.

In my attached example I have added two fields in the the data model. The first one is called Delay, and represents the interval corresponding to the difference between expected and registered times. The second field is a flag that is true (-1) if the delay is larger than 10 minutes, and false (0) if the delay is smaller than 10 minutes or if the employee is earlier.

This means that in the front-end expression you only need to address the delay flag to find the data rows that has been flagged.

=count({<IsLaterThan10Min={"-1"}>} Empid)

Not applicable
Author

Thank you so much Toni, hats off man...