Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
bhargavjm098
New Contributor III

Find the count based on date condition.

Hi All,

lastUpdatedDate                     Count(id)

14/02/2018  02:12:00 AM          35

14/02/2018  02:37:00 AM          48

13/02/2018  12:45:00 AM          44

13/02/2018  03:54:00 AM          34

i need the count only for 14th of Feb but i get the count of 14th and 13th as well. I used the below script to do this. But not getting the count of 83 only for 14th.

Count({<lastUpdatedDate = {"=$(=Date(Today()-1))"}>} id)

How to achieve the count only for 14th Feb??

5 Replies
Highlighted

Re: Find the count based on date condition.

First of all, you have a timestamp which cannot be directly equated to a date field...( you can use search string, but why not fix this in the script)

LOAD lastUpdatedDate as TimeStamp,

     Date(Floor(lastUpdatedDate)) as lastUpdatedDate

     ....

FROM ...;

Now try this

Count({<lastUpdatedDate = {"$(=Date(Today()-1))"}>} id)

Alternatively, you can use a search string like this

Count({<lastUpdatedDate  = {"=Floor(lastUpdatedDate) = Today()"}>}id)

But, again, I would suggest to use the first method over the second one because there is some more evaluation required for the second one, where as first one is very straight forward.

Highlighted
bhargavjm098
New Contributor III

Re: Find the count based on date condition.

Thank you Sunny

Highlighted
bhargavjm098
New Contributor III

Re: Find the count based on date condition.

Also i need to add an and condition for the syntax Count({<lastUpdatedDate = {"$(=Date(Today()-1))"}>} id)


onlinePrice >=0 then id


I tried in many ways but my syntax is not getting correct. Could you please help me

Highlighted

Re: Find the count based on date condition.

May be this

Count({<lastUpdatedDate = {"$(=Date(Today()-1))"}, onlinePrice = {">=0"}>} id)

Highlighted
bhargavjm098
New Contributor III

Re: Find the count based on date condition.

Thank you very much