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: 
sona_sa
Creator II
Creator II

Date Help

Hi,

Suppose I have a date filed and max date is 31/12/2014 (DD/MM/YYYY) and I have to make a expression as on date. How we can make a expression = to count of employeeheadcpunt on the behalf of same date. But want as on date employeeheadcount.

Thanks.

1 Solution

Accepted Solutions
Not applicable

Use this

vMaxDate=Date(ReloadTime())

View solution in original post

8 Replies
MK_QSL
MVP
MVP

COUNT({<Date = {'31/12/2014'}>}Employee)

or

COUNT({<Date = {'$(=Max(Date))'}>}Employee)

OR

COUNT({<Date = {'31/12/2014'}>}Distinct Employee)

or

COUNT({<Date = {'$(=Max(Date))'}>}Distinct Employee)

MayilVahanan

Hi

Try like this

Count({<Date = {"$(=Date(Max(Date)),'DD/MM/YYYY')"}>}Distinct employeehead)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable

Try this

Create variable vMaxDate=Date(Max(Date),'DD/MM/YYYY')

COUNT({<Date = {"<=$(vMaxDate)"}>}Employee)

or

COUNT({<Date = {"<=$(vMaxDate)"}>}Distinct Employee)

sona_sa
Creator II
Creator II
Author

But suppose Today is 10/04/2014, I don't want maxdate,  of my dimension fields. In my database till 2016 data is available, but whatever date is today and when my qvd is refreshed last time, I want till date data.

Thanks

its_anandrjs

From max date you get max value which is your database date field like with this script

Count({< Date = {'$(=Date(Max(Date)),'DD/MM/YYYY')}>} employeehead)

Not applicable

Such case use this for variable

vMaxDate=Date(Today(),'DD/MM/YYYY')

sona_sa
Creator II
Creator II
Author

In Case My QVD is not reloaded and yesterday data is there, then it will not use today() function.

Not applicable

Use this

vMaxDate=Date(ReloadTime())