Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get correct employee count datewise

Hi All

PFA

here by using below script

Data:

LOAD *,Date(Floor(TimeData)) as Date,

       Time(Frac(TimeData)) as Time  ;

      

LOAD id,

     [Employee id],

     EventID,

     TimeData

FROM

(ooxml, embedded labels, table is Sheet1);

and in text object expression count(employee id) it is giving 30

i want count as 3 here only 3 dates are available

how to get this please reply me

Regards

Hemesh

1 Solution

Accepted Solutions
raju_insights
Partner - Creator III
Partner - Creator III

Hi,

Try this in back end.

Data:

LOAD *,Date(Floor(TimeData)) as Date,

       [Employee id]&'-'&Date(Floor(TimeData))as Employee_id,

       Time(Frac(TimeData)) as Time  ;

LOAD id,

     [Employee id],

     EventID,

     TimeData

FROM

(ooxml, embedded labels, table is Sheet1);

By this you are creating Employee id & Date combo.

So, in front end use Count(Distinct Employee_id). You will get 3.

View solution in original post

22 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try count(Distinct [employee id])

Regards,

jagan.

jagan
Luminary Alumni
Luminary Alumni

Try this expression

=Sum(Aggr(Count(Distinct [employee id]), Date)


Hope this helps you.


Regards,

Jagan.

Not applicable
Author

i am going to use count(employee id ) in many situations so is their any way to make changes in background

Not applicable
Author

By using this  i am not getting the correct results


=Sum(Aggr(Count(Distinct [employee id]), Date))

Not applicable
Author

i have to get count as 3 i.e. here 3 dates are available

only one employee for one date

by removing floor it will show count as 30

HirisH_V7
Master
Master

Hi,

You can get the count of date with respect to emp.id Like this,

=Aggr(Count(Distinct Date),[Employee id])

PFA.

Emp Count Date.PNG

Hope this helps,

Regards,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
Not applicable
Author

also have a look on  the post by me with name How to get correct total

for this also i didn't received answer

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you are not using time remove that column and use Distinct  in the load statement like below.

Data:

LOAD DISTINCT

id,

     [Employee id],

     EventID,

Date(Floor(TimeData)) as Date;

     

LOAD id,

     [Employee id],

     EventID,

     TimeData

FROM

(ooxml, embedded labels, table is Sheet1);

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

i want to use time column in coming scripts