Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
sunny_talwar

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.

Anonymous
Not applicable
Author

Thank you Sunny

Anonymous
Not applicable
Author

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

sunny_talwar

May be this

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

Anonymous
Not applicable
Author

Thank you very much