Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to create variable for yesterday and i want to count no of employees present yesterday using that variable
Create variable in front end
vYesterday = date(max(YourDateField)-1,'YourDateFormat')
Now use below expression to count the employees
=Count({<YourDateField= {'$(=vYesterday)'}>} EmpID)
Without variable you can use below expression
=Count({<YourDateField= {'$(=date(max(YourDateField)-1))'}>} EmpID)
Use this to create Yesterday variable
Let vYesterday = Date(Today()-1)
TO count no of employees use this
=Count({<YourDateField = {'$(vYesterday)'}>} Distinct EmpID)
that is ok but how can use variable in count expr
I want to find no of employees present yesterday
=Count({<YourDateField = {'$(vYesterday)'}>} Distinct EmpID)
vYesterDay = Date(Today()-1)
Count(Distinct {<Date={'$(vYesterDay)'}>} Employees)
To supply you with a ready-to-use expression, we need to know more about the table in which you keep employee presence information.
You can use this as an example (set analysis):
=Count({<RecordDate = {"$(vYesterday)"}>} DISTINCT EmployeeID)
Shouldn't distinct go after the set analysis spec?
expression
count({$ <Date={'$(vYesterday)'}>} IdEmployee)
variable vYesterday
=date(today()-1)
or
=(today()-1)
Create variable in front end
vYesterday = date(max(YourDateField)-1,'YourDateFormat')
Now use below expression to count the employees
=Count({<YourDateField= {'$(=vYesterday)'}>} EmpID)
Without variable you can use below expression
=Count({<YourDateField= {'$(=date(max(YourDateField)-1))'}>} EmpID)
Hi Peter,
It actually works both ways.